[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Understanding the scope of XML catalog
Fellow XML-Dev'ers, I'm trying to better understand the use of an XML catalog to find a schema for validation. In addition to PUBLIC and SYSTEM identifier resolution, I understand that the <uri> element will map namespace names to locations per: Introduction https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html#s.intro "Mapping the URI reference of a resource (a namespace name, stylesheet, image, etc.) to another URI reference." URI Entries https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html#s.uri.ent "URI references that are not part of an <https://www.oasis-open.org/committees/download.php/14809/xml-catalogs.html#s.ext.ent>external identifier, such as namespace names, stylesheets, included files, graphics, and hypertext references, simply identify other resources. They are resolved using URI entries as described below." And so I created the following to map the UBL namespace name to the URI of the schema and I've confirmed the relative location from the catalog file: <uri name="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" uri="maindoc/UBL-Invoice-2.2.xsd"/> And my document begins with: <?xml version="1.0" encoding="UTF-8"?> <Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"> <cbc:UBLVersionID>2.1</cbc:UBLVersionID> <cbc:ID>TOSL108</cbc:ID> <cbc:IssueDate>2009-12-15</cbc:IssueDate> Yet using XJParse, I'm not able to validate my document: ~/t/os-UBL-2.2 $ xjparse -c xsd/UBL-2.2-catalog.xml -s ~/t/j.xml Attempting well-formed, namespace-aware parse Error:file:///Users/admin/t/j.xml:4:83:cvc-elt.1.a: Cannot find the declaration of element 'Invoice'. Parse succeeded (0.39) with 1 error and no warnings. ~/t/os-UBL-2.2 $ Can anyone see where I'm going wrong? This would seem so simple. Based on the documentation I'm expecting the namespace name of the document element of the instance to be matched in the catalog to the URI of the schema. Is that out of bounds of the specification? I'm clearly missing something. Thanks for any help anyone can be. . . . . . . Ken -- Contact info, blog, articles, etc. http://www.CraneSoftwrights.com/x/ | Check our site for free XML, XSLT, XSL-FO and UBL developer resources | Streaming hands-on XSLT/XPath 2 training class @ US$45 (5 hours free) |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|