W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2004

Implementing xs:include for a schema without targetNamespace

From: Jochen Wiedmann <jochen.wiedmann@freenet.de>
Date: Sat, 21 Aug 2004 21:47:06 +0200
Message-ID: <4127A6BA.5080503@freenet.de>
To: xmlschema-dev@w3.org


if I have an XML schema with target namespace, that includes another 
instance of XML schema without target namespace, then the SPEC requires,
that the included schema be converted to a schema with the target
namespace of the including schema. My problem is, how to implement
this in a schema processor.

The basic approach would of course be, to load the schema, convert all 
references to the target namespace, and be done. However, IMO this is
not sufficient, because the schema might contain additional references.
For example, consider a language extending XML schema by using the
xs:appinfo elements, like JAXB (http://java.sun.com/xml/jaxb/) does:
It is quite possible, that attributes below xs:appinfo contains other
references, that my schema processor doesn't know about. My 
understanding is, that these should be converted too.

Thus, I have a different idea, which I would like to discuss: The
schema processor is iun fact a SAX parser. As such, it receives SAX 
events, in particular

     public void startElement(String pURI, String pLocalName,
                              String pQName, Attributes pAttrs);
     public void endElement(String pURI, String pLocalName,
                            String pQName);
     public void startPrefixMapping(String pPrefix, String pURI);

The idea is, to map all URI's in the above SAX events from the ""
(the absent namespace in SAX) to the desired target namespace.




Received on Saturday, 21 August 2004 19:46:07 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:23 UTC