on XML catalogs and XSD
Posted: Wed Nov 17, 2004 4:44 pm
Hi, I'd really appreciate any help on integrating my existing XML schema into Oxygen's XML catalog, so I can use the nifty validation and content-assist features. I'm using Oxygen v5 as an eclipse plugin.
I have an XML document with the following header:
I have an XSD document that defines the schema on the local file system under H:\workspace\src\com\xyz\build\schema\databean.xsd
The schema is correct, and the document validates correctly when performed manually.
My understanding of Oxygen is that I need to define my mapping from a schema reference to a physical location in an OASIS XML Catalog. I've created a catalog file as follows:
My understanding is that the SYSTEM ID passed to the catalog will be the trailing end of the schemaLocation attribute com/xyz/build/schema/databean.xsd (is my understanding correct?), and I am trying to tell the catalog to rewrite it as file:///H:/workspace/src/com/xyz/build/schema/databean.xsd.
This should then enable the XML parser to locate the schema, and therefore validate the document.
Needless to say, it doesn't work. Instead, I get an inline error saying 'cvc-elt.1: Cannot find the declaration of element 'databean'.
Can anyone spot the mistake I've made? Anyone with more experience able to point me in the right direction?
I have configured Eclipse to use the custom XML catalog, and have restarted Eclipse after making the changes.
thanks
mike
I have an XML document with the following header:
Code: Select all
<databean
xmlns="http://www.xyz.com/databean"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xyz.com/databean
com/xyz/build/schema/databean.xsd">
The schema is correct, and the document validates correctly when performed manually.
My understanding of Oxygen is that I need to define my mapping from a schema reference to a physical location in an OASIS XML Catalog. I've created a catalog file as follows:
Code: Select all
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer='public'>
<rewriteSystem
systemIdStartString="com/xyz/build/schema"
rewritePrefix="file:///H:/workspace/src/com/xyz/build/schema"/>
</catalog>
This should then enable the XML parser to locate the schema, and therefore validate the document.
Needless to say, it doesn't work. Instead, I get an inline error saying 'cvc-elt.1: Cannot find the declaration of element 'databean'.
Can anyone spot the mistake I've made? Anyone with more experience able to point me in the right direction?
I have configured Eclipse to use the custom XML catalog, and have restarted Eclipse after making the changes.
thanks
mike