xml catalog
Having trouble installing Oxygen? Got a bug to report? Post it all here.
xml catalog
Post by ewinston »
I am trying to figure out the use os the xml catalog but it appears to be having no effect.
my xml has a schemaLocation attribute that looks like :
and my catalog file looks like :
and it still refuses to validate the xml. When i ask it to open external schemas, it looks like it is just looking at the schemaLocation attribute only.
Is there a way to tell if the catalog is getting used? The catalog is in the same directory as my xml files. I i have tried file:// in front of the rewritePrefix and it did not help either.
I'm stumped!
thanks
my xml has a schemaLocation attribute that looks like :
Code: Select all
xsi:schemaLocation="
http://a/1.1/ ../../a.xsd
http://b/0.95/ ../../../../../b/M.xsd
http://b/0.95/ ../../../../../b/P.xsd
http://b/0.95/ ../../../../../b/J.xsd"
Code: Select all
<rewriteURI
uriStartString="http://a/1.1/"
rewritePrefix="/abs/path/a.xsd"/>
Is there a way to tell if the catalog is getting used? The catalog is in the same directory as my xml files. I i have tried file:// in front of the rewritePrefix and it did not help either.
I'm stumped!
thanks
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
I would not use the rewrite URI, and also not use relative paths for the shema location. Instead you can try to define some locations using absolute URIs like this:
(they can exist on a server or not, the catalog will solve them)
And then create a catalog by mapping each system id to a local file. the local file can be specified relative to the catalog file.
Do not forget to restart the editor after modifying a catalog.
Best regards,
Dan
Code: Select all
xsi:schemaLocation="
http://a/1.1/ http://myserver/X/a.xsd
http://b/0.95/ http://myserver/Y/M.xsd
http://b/0.95/ http://myserver/Y/P.xsd
http://b/0.95/ http://myserver/Y/J.xsd"
And then create a catalog by mapping each system id to a local file. the local file can be specified relative to the catalog file.
Code: Select all
<system systemId="http://myserver/X/a.xsd"
uri="../../a.xsd"/>
<system systemId="http://myserver/Y/M.xsd"
uri="../../../m.xsd"/>
<system systemId="http://myserver/Y/P.xsd"
uri="../../../p.xsd"/>
<system systemId="http://myserver/Y/J.xsd"
uri="../../../j.xsd"/>
Best regards,
Dan
-
- Posts: 7
- Joined: Thu Feb 05, 2004 7:10 pm
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
I am not sure about solving relative paths with a catalog. The primary purpose of the catalog is to solve remote files to local ones. Of course, the immediate workaround is to have the XSD file locally, in a directory structure that matchs the relative paths, and avoid using the catalog.
Ex:
In directory:
C:/alpha/beta/
There is a document gamma.xml that refers to schema"../a.xsd".
Then if I put into alpha the a.xsd file the validation will work fine, with no need of an xml catalog.
Regards,
Dan
Ex:
In directory:
C:/alpha/beta/
There is a document gamma.xml that refers to schema"../a.xsd".
Then if I put into alpha the a.xsd file the validation will work fine, with no need of an xml catalog.
Regards,
Dan
-
- Posts: 7
- Joined: Thu Feb 05, 2004 7:10 pm
-
- Posts: 7
- Joined: Thu Feb 05, 2004 7:10 pm
Ok, i want to revisit this a bit to try to understand if what i am seeing is an error. I have created the catalog file as explained above, and changed the xml so that URI's are used instead of relative paths in the scemalLocation attribute.
My validation still fails. It appears that not all of the schemas are being searched. I get a message that says a certain element is not defined. I look, and it is defined. If i move the schema up in the list of items in the schemaLocation, then it is found,
So, it appears to be the case that only items in the first xsd of a namespace are found. Is this true? Is there a way around this?
I will try to create an example to better illustrate what i am doing.
thanks
edward
My validation still fails. It appears that not all of the schemas are being searched. I get a message that says a certain element is not defined. I look, and it is defined. If i move the schema up in the list of items in the schemaLocation, then it is found,
So, it appears to be the case that only items in the first xsd of a namespace are found. Is this true? Is there a way around this?
I will try to create an example to better illustrate what i am doing.
thanks
edward
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Edward,
This is true and this was also discussed a couple of times on the Xerces list. Xerces will consider the first schema it encounters for a namespace as defining everything in that namespace. The solution is simple, you should define a wrapper schema for that namespace that just includes all the sub-schemas.
Hope that helps,
George
This is true and this was also discussed a couple of times on the Xerces list. Xerces will consider the first schema it encounters for a namespace as defining everything in that namespace. The solution is simple, you should define a wrapper schema for that namespace that just includes all the sub-schemas.
Hope that helps,
George
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service