[Previous] [Contents] [Next]

Programming with XSL and XSLT


Although Internet Explorer 5 cannot identify the namespace in an XSLT document, versions 2.6 and higher of the XML parser can use XSLT documents to transform XML documents. We will use the same BizTalk document we used earlier in this chapter, with some minor changes that will fix errors in the document, to perform the transformation using XSLT documents. Even though we did not receive any error messages when we used the BizTalk document, two errors do exist in the code. The following two elements are not defined in the schema as being children of the POlines element:


  <count>2</count>
  <totalAmount>192000.00</totalAmount>

If you try to work with the BizTalk document using the XML DOM, the load method of the IXMLDOMDocument interface will fail. It's important to note this, as we have come this far with no hint that there was an error in the document. This stresses the importance of validating your documents. To correct the error, delete the above two elements from the XML document and rename the document NorthwindPOXSLT.xml. You can also delete the references to these two elements in your XSL and XSLT document. Let's now look at a code sample, which you could use in your production systems, that shows how to code with the XML DOM.

[Previous] [Contents] [Next]