Hi John,

<[EMAIL PROTECTED]> wrote on 08/14/2007 12:46:00 PM:

> Hello,
> 
> I have an XML document which has a DOCTYPE tag referencing a DTD.
> Instead I want to reference an XSD which specifies this document
> structure.  I use the XMLCatalogResolver to detect the publicId in the
> DOCTYPE and replace it with a URI pointing to the XSD.

You can't replace the DTD with a schema. Whatever you return from this 
call to the resolver needs to be a DTD (in other words must match [1] the 
extSubset [2] production from the XML 1.0 specification) or null if you 
want the parser to use its default resolution mechanism.

> I think this
> part is working, however I get an error during the sax parsing:  "The
> markup declarations contained or pointed to by the document type
> declaration must be well-formed."  I believe the XML is well-formed
> because if I omit the DOCTYPE tag from the XML document the parsing
> occurs without error.  The namespace in the XSD is
> "http://www.ncbi.nlm.nih.gov"; and I don't have any reference to
> namespace in the XML document.  Is this what the error is refering to?

If your schema has a target namespace and your instance document declares 
no namespaces you need to change one of them in order for your document to 
be valid. Either add a namespace declaration to the instance document or 
remove the target namespace from the schema document.

<snip/>

> TIA,
> John
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

Thanks.

[1] http://www.w3.org/TR/2006/REC-xml-20060816/#ExtSubset
[2] http://www.w3.org/TR/2006/REC-xml-20060816/#NT-extSubset

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to