Resolve xs:import with a catalog
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 7
- Joined: Tue Oct 21, 2008 9:53 am
Resolve xs:import with a catalog
Hi,
I have several schemas with import statements like
that is without a schemaLocation-attribute. I tried to resolve these imports with an XML catalog file but the correct schemas never seem to be found. Enabling verbose-mode gives me
while the modified import statement
results in the log-line
.
Shouldn't the namespace be used as the "public" part of the query to the resolver? At least that's the way I've seen it in other applications that use a catalog file (e.g. XJC schema compiler from the JAXB RI) and I've been told, that Eclipse interprets catalog files like this, too.
Regards,
Janko
I have several schemas with import statements like
Code: Select all
<xs:import namespace="http://whatever"/>
Code: Select all
Public: null System: null = null
Code: Select all
<xs:import namespace="http://whatever" schemaLocation="http://there"/>
Code: Select all
Public: null System: http://there = null
Shouldn't the namespace be used as the "public" part of the query to the resolver? At least that's the way I've seen it in other applications that use a catalog file (e.g. XJC schema compiler from the JAXB RI) and I've been told, that Eclipse interprets catalog files like this, too.
Regards,
Janko
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Resolve xs:import with a catalog
Post by sorin_ristache »
Hello,
The catalog resolver tries to resolve the URI references from XML Schema schemas only with system ID catalog entries (system, systemSuffix, etc). It should try with URI entries (uri, uriSuffix, etc) and we have this problem logged in our system for implementation in a future version but in the current version (9.3) you have to use system ID entries in the XML catalog for resolving URI references used in xs:import and xs:include elements.
There is also a request for resolving a schema URI by mapping the namespace so that a schema location is not needed in the import/include element but it was not implemented yet.
Regards,
Sorin
The catalog resolver tries to resolve the URI references from XML Schema schemas only with system ID catalog entries (system, systemSuffix, etc). It should try with URI entries (uri, uriSuffix, etc) and we have this problem logged in our system for implementation in a future version but in the current version (9.3) you have to use system ID entries in the XML catalog for resolving URI references used in xs:import and xs:include elements.
There is also a request for resolving a schema URI by mapping the namespace so that a schema location is not needed in the import/include element but it was not implemented yet.
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Resolve xs:import with a catalog
Post by sorin_ristache »
Hello,
The current version (10.3) includes a fix for this problem. If you install this version it should resolve the namespace of the schema with the XML catalog.
Regards,
Sorin
The current version (10.3) includes a fix for this problem. If you install this version it should resolve the namespace of the schema with the XML catalog.
Regards,
Sorin
-
- Posts: 1
- Joined: Fri Oct 09, 2009 4:40 pm
Re: Resolve xs:import with a catalog
Sorry for digging this, but I have a similar problem. However, it is with 10.3
Here it is in short: we have a lot of XSDs, and catalogs that map them. For example"
Then for example:
And Oxygen fails to resolve the m:someType. I tried adding the catalogs as absolute paths, as relative paths, used ${pdu} - nothing.
Then I tried a type from one of the schemas that are mapped in the default oxygen catalog:
Again - fails to reoslve it. So, basically - how to make it work? (I'm using the standalone Oxygen)
Note that our catalogs work perfectly in Eclipse (without Oxygen).
Regards.
Here it is in short: we have a lot of XSDs, and catalogs that map them. For example"
Code: Select all
<public publicId="http://namespacesite.com/value/82" uri="address.xsd" />
Code: Select all
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="something" targetNamespace="someting" xmlns:m="http://namespacesite.com/value/82">
<xsd:import namespace="http://namespacesite.com/value/82" />
<xsd:complexType name="myType">
<xsd:all>
<xsd:element name="referenced" type="m:someType"/>
</xsd:all>
</xsd:complexType>
</xsd:schema>
Then I tried a type from one of the schemas that are mapped in the default oxygen catalog:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="something" targetNamespace="something" xmlns:fo="http://www.w3.org/1999/XSL/Format/xsd/fo.xsd">
<xsd:import namespace="http://www.w3.org/1999/XSL/Format/xsd/fo.xsd" />
<xsd:complexType name="myType">
<xsd:all>
<xsd:element name="referenced" type="fo:row-group"/>
</xsd:all>
</xsd:complexType>
</xsd:schema>
Note that our catalogs work perfectly in Eclipse (without Oxygen).
Regards.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Resolve xs:import with a catalog
Post by sorin_ristache »
You have to use a uri type entry in the XML catalog, for example:Glam wrote:...Code: Select all
<public publicId="http://namespacesite.com/value/82" uri="address.xsd" />
Code: Select all
<xsd:import namespace="http://namespacesite.com/value/82" />
Code: Select all
<uri name="http://namespacesite.com/value/82" uri="address.xsd"/>
Regards,
Sorin
-
- Posts: 3
- Joined: Thu Nov 12, 2009 6:47 pm
Re: Resolve xs:import with a catalog
Post by spryspectre »
Not to hijack the thread, but I have a similar issue with version 11. I have the project set to enable XInclude processing, and I've already added the project's catalog file to the project settings using ${pdu}/catalog.xml. The catalog file has the the following two rewrites:
The (docbook) xml file in question is as follows:
Does anyone know why the <!DOCTYPE> resolves correctly, but the <xi:include> does not?
Code: Select all
<rewriteURI uriStartString="file:///common/" rewritePrefix="../../../../../common/man/"/>
<rewriteSystem systemIdStartString="file:///common/" rewritePrefix="../../../../../common/man/"/>
Code: Select all
<!DOCTYPE book [
<!ENTITY % common_ents SYSTEM "file:///common/entities.ent">
%common_ents;
]>
<!-- the above entity file is being resolved correctly -->
...
<!-- this fails to resolve correctly -->
<xi:include href="file:///common/info.xml"/>
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Resolve xs:import with a catalog
Post by sorin_ristache »
Hello,
If info.xml is in the same folder as entities.ent it should work. I tested your rewriteSystem in an XML catalog that I added from Options -> Preferences -> XML -> XML Catalog. On what platform do you run Oxygen? What errors are reported in the Catalogs view if you set Verbosity to Unresolved entities in Preferences -> XML -> XML Catalog?
Regards,
Sorin
If info.xml is in the same folder as entities.ent it should work. I tested your rewriteSystem in an XML catalog that I added from Options -> Preferences -> XML -> XML Catalog. On what platform do you run Oxygen? What errors are reported in the Catalogs view if you set Verbosity to Unresolved entities in Preferences -> XML -> XML Catalog?
Regards,
Sorin
-
- Posts: 3
- Joined: Thu Nov 12, 2009 6:47 pm
Re: Resolve xs:import with a catalog
Post by spryspectre »
The messages I got from the Catalogs view said that "file:///local/" was resolving correctly, however the error message from Jing claimed it could not parse "file:/local/info.xml", which led me to think that Jing wasn't getting the rewritten value... However, I discovered a minor issue in the info.xml file (I apparently deleted a "/" on a closing tag by accident), and this fixed the problem.
The message from Jing was slightly misleading. Is there a way to put the rewritten value into the error messages?
The message from Jing was slightly misleading. Is there a way to put the rewritten value into the error messages?
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Resolve xs:import with a catalog
Post by sorin_ristache »
Hello,
Jing reports the file path that it cannot find. It does not know what is the rewritten value that was found in the catalog because that is handled by other component. If the rewritten value cannot be found you see it in the Catalogs view if you enable the verbosity option in Preferences -> XML -> XML Catalog.
Regards,
Sorin
Jing reports the file path that it cannot find. It does not know what is the rewritten value that was found in the catalog because that is handled by other component. If the rewritten value cannot be found you see it in the Catalogs view if you enable the verbosity option in Preferences -> XML -> XML Catalog.
Regards,
Sorin
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