RELAX NG (Regular Language for XML Next Generation) was originally specified by OASIS and is now a standard (Part 2: Validation based on regular grammar of ISO/IEC 19757 – DSDL). RELAX NG schemas can be written in XML syntax or more compact non-XML syntax. Both syntaxes are isomorphic and James Clark`s conversion tool – Trang – can convert between them without loss of information. RELAX NG has a simpler definition and validation framework than XML Schema, making it easy to use and implement. It can also use data type infrastructure plug-ins. For example, a RELAX NG schema author might require that the values in an XML document match the definitions of XML schema data types. To define the format of XML messages or XML documents, Company A creates two document type definitions (DTDs): one that describes the information provided by A about customers and one that describes the information A wants to receive about a newly affiliated company. Company B must also create two DTDs: one to process XML documents received from Company A and one to prepare an XML document in a format that Company A can process. This is the risk of flexibility. Without standardized syntax, a company can create unique tags that are unrecognizable to its suppliers and buyers. To reduce this risk, many XML dictionaries are created in fields such as finance, mathematics, chemistry, and e-commerce.
These XML embedded dictionaries standardize tag definitions. On Wall Street, for example, JP Morgan and PricewaterhouseCoopers recently proposed FpML, a dictionary that would standardize XML tags for currency exchanges and other financial transactions. Similar efforts are underway in other industries. How you use XML and XSLT depends on your specific business needs. Most XML applications work as expected, even when new data is added (or removed). The main function of XML is to provide a «simple text format for representing structured information,» according to the World Wide Web Consortium (W3C), the standards body for the Web, including the following: As an illustration, consider the following HTML tags: The command signals a paragraph and the word is translated into words. HTML tags are fixed; Every website developer uses the same tags to do the same things. In contrast, XML allows you to create your own tags to indicate the meaning or use of the data.
So if you`re using XML to describe a widget you`re selling, your tags might look like this: $100″ SKU=»555432″ dealer=»Widgets Incorporated»>. =»superwidget»> With XML, data can be available to all types of «reading machines» such as humans, computers, speech engines, newsfeeds, etc. Empty elements can be closed as usual, or you can use a special short form instead. The tags in the above example (like and ) are not defined in any XML standard. These tags are «invented» by the author of the XML document. To achieve this goal, you can write your application to first create an XML document that represents the data sent to the client. The application can then convert the XML document that represents the data to HTML or WML, depending on the client`s browser type. The application can determine the type of client browser by examining the user-agent request header of an HTTP request. Once the application knows the client browser type, it uses the appropriate XSLT style sheet to transform the document into the correct markup language. For an example of how to access this type of header information, see the SnoopServlet sample in the examples/servlets directory of your WebLogic Server distribution. Simple API for XML (SAX) is an event-driven lexical API that serially reads a document and reports its contents as callbacks to various methods on a user`s design manager object. SAX is quick and efficient to implement, but difficult to use to extract random information from XML because it tends to instruct the application author to keep track of the part of the document being processed.
It is best suited for situations where certain types of information are always treated in the same way, regardless of where they appear in the document. One way to format XML output is to specify CSS to apply to the document using the xml-stylesheet processing instruction. The root element contains other elements that define the different parts of the XML document. In the example above, the root element contains the , which in turn consist of the two elements