[thelist] XML Schema question

David.Cantrell at Gunter.AF.mil David.Cantrell at Gunter.AF.mil
Mon Oct 21 10:48:00 CDT 2002


Is it possible to reference an XML Schema in an XML document that has NO
namespaces? Or is the whole point of schemas that they apply to a specific
namespace only? If so, is there no way to validate the content model of a
document without resorting to namespaces?

I want to do this:

<leftnav xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="/ilspo/shared/schema/leftnav.xsd">

But schemaLocation requires a whitespace separated pair giving the affected
namespace and the URL.

I can get it working like this:

<leftnav xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="urn:mil.af.afmc.esc.ilspo/leftnav
/ilspo/shared/schema/leftnav.xsd"
		xmlns="urn:mil.af.afmc.esc.ilspo/leftnav">

But then I have to change the XSL file to reference the new namespace.
That's almost enough to keep me from using the schema, and I'd really like
to use it, both to learn it and to have the validation capabilities.

Thanks,
-dave



More information about the thelist mailing list