How to not validate an XML document that is called via the 'document' function in XSLT 2.0 [SEC=UNCLASSIFIED]

Hi all, I have an XSL that calls an XML document using the 'document' function. The document that I call has an incorrect 'schemaLocation' statement in it. This makes the XML document invalid. The document itself is well formed and does validate if one changes the schemaLocation to point to a real location of the included XSDs. I am trying to get the custodians of this XML document to change the schemaLocation to fix this problem. Meanwhile, I would like to be able to call this document using the 'document' function without validating it. Can this be done in XSLT 2.0 or Oxygen? If so what parameter settings do I make in my XSL or Oxygen. An example of the XSL is below. Thanks. John <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="text"></xsl:output> <xsl:template match="/"> <xsl:param name="URL">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml</xsl:param> <xsl:value-of select="$URL"/> <xsl:value-of select="document($URL)//CT_CodelistCatalogue/name" ></xsl:value-of> </xsl:template> </xsl:stylesheet> John Hockaday Geoscience Australia GPO Box 378 Canberra ACT 2601 (02) 6249 9735 http://www.ga.gov.au/ john.hockaday\@ga.gov.au

Hello John, If the incorrect URL specified in the schemaLocation attribute is the only error then the XML file is invalid but it is well-formed. That is reported as error only if you transform the XML file with Saxon SA. If you transform it with Saxon B the incorrect URL is not an error. Anyway you can map the incorrect URL to a correct one so that you get no transformation error without modifying the XML file. Just create an XML catalog with a URI entry and set the catalog in Preferences -> XML -> XML Catalog. The User Manual explains how to use XML catalogs: http://www.oxygenxml.com/doc/ug-oxygen/using-XML-Catalogs.html You can start from one of the templates "OASIS XML Catalog - 1.0" and "OASIS XML Catalog - 1.1" available in the dialog opened from menu File -> New. Regards, Sorin John.Hockaday@ga.gov.au wrote:
Hi all,
I have an XSL that calls an XML document using the 'document' function. The document that I call has an incorrect 'schemaLocation' statement in it. This makes the XML document invalid. The document itself is well formed and does validate if one changes the schemaLocation to point to a real location of the included XSDs.
I am trying to get the custodians of this XML document to change the schemaLocation to fix this problem. Meanwhile, I would like to be able to call this document using the 'document' function without validating it. Can this be done in XSLT 2.0 or Oxygen? If so what parameter settings do I make in my XSL or Oxygen.
An example of the XSL is below.
Thanks.
John
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="text"></xsl:output> <xsl:template match="/"> <xsl:param name="URL">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml</xsl:param> <xsl:value-of select="$URL"/>
<xsl:value-of select="document($URL)//CT_CodelistCatalogue/name" ></xsl:value-of>
</xsl:template> </xsl:stylesheet>
John Hockaday Geoscience Australia GPO Box 378 Canberra ACT 2601 (02) 6249 9735 http://www.ga.gov.au/ john.hockaday\@ga.gov.au _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (2)
-
John.Hockaday@ga.gov.au
-
Sorin Ristache