|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Relative URLs using the file scheme?
Hi all, I've run into a problem using Xerces (2.2.0) for W3C XML Schema validation when it comes to specifying relative paths to the schema document. Here is the scenario: I have an XML document located in the following location: C:\Files\test.xml and the W3C XML Schema file is in the following location: C:\Files\Schemas\test.xsd In the older versions of Xerces (pre 2.1.0) the following schema locations would all work in test.xml: (absolute) xsi:noNamespaceSchemaLocation="C:\Files\Schemas\test.xsd" (relative) xsi:noNamespaceSchemaLocation="Schemas\test.xsd" (absolute) xsi:noNamespaceSchemaLocation="file:///C:/Files/Schemas/test.xsd" In the new version of Xerces (2.2.0) only the following works: (absolute) xsi:noNamespaceSchemaLocation="file:///C:/Files/Schemas/test.xsd" Now, the problem is that in the newer versions of Xerces you can no longer specify the schema location using system dependant paths and instead this location must be specified as a URL. This is fine as long as the location is an absolute path but how do I specify a relative path using the file URL (URI?) scheme? This problem was originally caught by one of our clients who had previously used the following as a relative URL: (relative) xsi:noNamespaceSchemaLocation="file:Schemas/test.xsd" Apparently this relative URL works in both Xalan and Saxon but not in Xerces. When reporting this to Xerces i got the following response: -------------------------8<-------------------------------------------------- Hi Eddie. Is a string of the form "file:myDir/myFile" really a relative URI? I'm not sure it is; the hostname isn't mentioned at the very least. Shouldn't it be "file:///./myDir/myFile"? For now, I'll mark this invalid; please close the bug if this works and you agree. If not, please help enrich my understanding of relative URI syntax! :) --------------------------8<------------------------------------------------- So, this would suggest that the following should work but unfortunately it doesn't: (relative) xsi:noNamespaceSchemaLocation="file:///./Schemas/test.xsd" I've tried checking the specs for how the relative URL file schema should be specified but I can't seem to figure out how this is done. Suggestions? Cheers, /Eddie
|
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
|
|||||||||

Cart








