InfoCenter Home > 4.2.3.4: Rendering XML documentsOptions for presenting XML documents include: Present the XML document in an XML-enabled browser. An XML-enabled browser can parse a document, apply its XSL stylesheet, and present the document to the user. Searching and enabling users to modify an XML document are other possible functions of XML-enabled browsers. Present the XML document to a browser that converts XML to HTML. Until XML-enabled browsers are readily available, presenting XML documents to users will involve converting the XML document to HTML. That conversion can be handled by conversion-capable browsers. Another option is to use JavaScript or ActiveX controls embedded within the XML document. Microsoft Internet Explorer Version 5 is an XML-to-HTML converter. HTML is not the only format to which XML documents can be converted. It's just the easiest to implement given the commerically available browsers and user agents. Send an HTML file to the browser. If the users do not have XML-capable browsers, the XML document must be converted at the server before being transmitted to the browser. The server-side XML application that handles the conversion could also determine the capability of the browser before converting the document to HTML, to avoid unnecessary processing if the browser is XML-capable. The XSL processor included with this product supports such server-side functions. Using XSL to convert XML documents to other formatsIBM WebSphere Application Server includes the Lotus XSL processor and its open-source version, Xalan, for formatting and converting XML documents. Processing can be done at the server or at the browser, to HTML or to other XML-compliant markup languages. For sample code, see the Xalan documentation. Use of the XSL processor with the Xerces XML parser requires a liaison object, as follows: XSLTProcessor processor = XSLTProcessorFactory.getProcessor(new com.lotus.xml.xml4j2dom.XML4JLiaison4dom()); Converting XML documents at the serverOne option for presenting an XML document is for the server to convert the XML document to HTML and return the HTML document to the client. On the server side, this typically requires the creation of a servlet to handle the processing of one data stream (the XML document) with another (the XSL document). The output of that process is then forwarded back to the browser. Server-side processing often requires the passing in of parameters through the XSL processor to customize the output. For an example, see the Xalan documentation. |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|