- From: Naomi Dushay <Naomi@cs.cornell.edu>
- Date: Fri, 30 Nov 2001 15:04:58 -0500 (EST)
- To: <xmlschema-dev@w3.org>
I'm running into a problem with prefix scoping. My instance document (simplified): <bar:A xmlns:bar="ignored" xmlns:foo="http://foo.namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ignored bar.xsd"> <foo:B xsi:schemaLocation="http://foo.namespace fooB.xsd"> <foo:Q /> <foo:R /> </foo:B> <foo:C xsi:schemaLocation="http://foo.namespace fooC.xsd"> <foo:Y /> <foo:Z /> </foo:C> </bar:A> I have XML schemas bar.xsd, fooB.xsd and fooC.xsd, all of which are valid. I can't find anything in the XML Schema spec that implies the above instance doc shouldn't work. But there seems to be a namespace prefix collision for prefix "foo." This is true for XSV and for the topologi Schematron Validator. Is this a "bug" in those two validators? Is it a "feature"? Note that the two following instance documents validate just fine: <bar:A xmlns:bar="ignored" xmlns:foo="http://foo.namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ignored bar.xsd"> <foo:B xsi:schemaLocation="http://foo.namespace fooB.xsd"> <foo:Q /> <foo:R /> </foo:B> </bar:A> <bar:A xmlns:bar="ignored" xmlns:foo="http://foo.namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ignored bar.xsd"> <foo:C xsi:schemaLocation="http://foo.namespace fooC.xsd"> <foo:Y /> <foo:Z /> </foo:C> </bar:A> Also note that moving the prefix declaration doesn't solve the problem -- the following also bombs on both validators. <bar:A xmlns:bar="ignored" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ignored bar.xsd"> <foo:B xmlns:foo="http://foo.namespace" xsi:schemaLocation="http://foo.namespace fooB.xsd"> <foo:Q /> <foo:R /> </foo:B> <foo:C xmlns:foo="http://foo.namespace" xsi:schemaLocation="http://foo.namespace fooC.xsd"> <foo:Y /> <foo:Z /> </foo:C> </bar:A> I am happy to send documents to anyone who wants more information. - Naomi Dushay Naomi Dushay Cornell Digital Library Research Group Department of Computer Science Cornell University 4130 Upson Hall Ithaca, NY 14853-7501 USA naomi@cs.cornell.edu 607-255-2528 (voice)
Received on Saturday, 1 December 2001 07:25:18 UTC