[oXygen-user] XSD, catalog and PUBLIC IDs

Sorin Ristache
Thu Jan 31 04:31:42 CST 2008


Hello,

The XML Schema specification does not provide a public ID mechanism for 
associating an XML Schema with a unique ID independent of the storage 
location. You have to use the system ID mechanism to map your XML 
Schemas references to XSD files through an XML catalog. That means a 
DOCTYPE declaration that associates an ID with an XSD file

<!DOCTYPE be PUBLIC "-//Kluwer/XSD BE-JUR-OFF-XML//NL" "be-jur-off.xsd">

does not make sense. Only a DTD can be associated in this way. All your 
XML documents validated against XML Schemas should look like:

<?xml version="1.0" encoding="US-ASCII"?>
<be 
xsi:noNamespaceSchemaLocation="file:/C:/Daidalos/PuMaSVN/relax/trunk/DTDs/be-jur-off/be-jur-off.xsd"
   xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance ">
...
</be>

or should be associated by default with the XML Schema set in an oXygen 
document type as you can read in the validation error message that you 
posted. You define a document type from menu Options -> Preferences -> 
Document Type Association:

http://www.oxygenxml.com/doc/ug-standalone/preferences-document-type-association.html

http://www.oxygenxml.com/doc/ug-standalone/author-predefined-doc-types.html

http://www.oxygenxml.com/doc/ug-standalone/dg_complex_customization_tutorial.html


The public ID mechanism available for DTDs was defined in the W3C XML 
specification where DTDs are also defined and was inherited from SGML. 
XML Schema was defined in a different specification (the W3C XML Schema 
specification) which defines only the system ID mechanism.


Regards,
Sorin


Theun Fleer wrote:
> But when I directly point to the xsd (Document > XML Document > 
> Associate Schema) I get this
> 
> <?xml version="1.0" encoding="US-ASCII"?>
> <!--<!DOCTYPE be PUBLIC "-//Kluwer/XSD BE-JUR-OFF-XML//NL" 
> "be-jur-off.xsd">-->
> <be 
> xsi:noNamespaceSchemaLocation="file:/C:/Daidalos/PuMaSVN/relax/trunk/DTDs/be-jur-off/be-jur-off.xsd" 
> 
>   xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance 
> <http://www.w3.org/2001/XMLSchema-instance> ">
> ...
> </be>
>  
> This xml-instance validates just fine. Note that I had to comment the 
> DOCTYPE declaration.
>  
> What's the problem with my setup of catalog and PUBLIC IDs?




More information about the oXygen-user mailing list