XML Catalog not working?
Oxygen general issues.
-
- Posts: 11
- Joined: Sun Dec 10, 2006 9:23 pm
XML Catalog not working?
Post by Nicol Bolas »
I was using Oxygen on what became a standalone machine (we lost Internet access for a period of time), and something very peculiar happened.
I was unable to validate any of my documents. Nor could I get content completion to work. Now, the schema's they were using (DocBook 5 CR3) were assigned with the standard <?oxygen RNGSchema="" type="xml"?> command. The thing that makes this odd is that I had an XML catalog (the one that comes with the DocBook 5 download) attached.
So it would appear that Oxygen's XML Catalog support isn't actually working, that it's just using the URL directly instead of translating it into a local resource.
I tried playing around with the settings, and I made sure that the URL in the document was an exact match with one in the catalog. It still didn't work.
The particular sequence of errors that I got were:
Any ideas? Did I do something wrong, or is this just an overlooked bug with the XML Catalog support?
I was unable to validate any of my documents. Nor could I get content completion to work. Now, the schema's they were using (DocBook 5 CR3) were assigned with the standard <?oxygen RNGSchema="" type="xml"?> command. The thing that makes this odd is that I had an XML catalog (the one that comes with the DocBook 5 download) attached.
So it would appear that Oxygen's XML Catalog support isn't actually working, that it's just using the URL directly instead of translating it into a local resource.
I tried playing around with the settings, and I made sure that the URL in the document was an exact match with one in the catalog. It still didn't work.
The particular sequence of errors that I got were:
Code: Select all
E org.apache.commons.httpclientHttpException-docbook.org (http://docbook.org/xml/5.0CR3/rng/docbookxi.rng)
E java.lang.IllegalStateException-cannot validate without schema
E Failure reading http://docbook.org/xml/5.0CR3/rng/docbookxi.rng
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: XML Catalog not working?
Post by sorin_ristache »
Hello,
So if you keep the directory structure and you use one of these system IDs then oXygen will use the local RELAX NG schema. Of course you have to add the catalog to the list of XML catalogs in Preferences -> XML -> XML Catalog.
Regards,
Sorin
If you keep the directory structure of the downloaded DocBook archive then the XML catalog that comes in the archive works without problems. In that catalog the entries for the RELAX NG schemas are:Nicol Bolas wrote:Now, the schema's they were using (DocBook 5 CR3) were assigned with the standard <?oxygen RNGSchema="" type="xml"?> command. The thing that makes this odd is that I had an XML catalog (the one that comes with the DocBook 5 download) attached.
Code: Select all
<system systemId="http://www.oasis-open.org/docbook/xml/5.0b5/rng/docbook.rng" uri="rng/docbook.rng"/>
<system systemId="http://docbook.org/xml/5.0b5/rng/docbook.rng" uri="rng/docbook.rng"/>
<system systemId="http://www.oasis-open.org/docbook/xml/5.0b5/rng/docbookxi.rng" uri="rng/docbookxi.rng"/>
<system systemId="http://docbook.org/xml/5.0b5/rng/docbookxi.rng" uri="rng/docbookxi.rng"/>
If it does not work on your computer please post a small sample document. Did you add in Preferences -> XML -> XML Catalog the catalog.xml file that comes in the downloaded DocBook archive from the location where you unzipped the archive?Nicol Bolas wrote:So it would appear that Oxygen's XML Catalog support isn't actually working, that it's just using the URL directly instead of translating it into a local resource.
I tried playing around with the settings, and I made sure that the URL in the document was an exact match with one in the catalog. It still didn't work.
Regards,
Sorin
-
- Posts: 11
- Joined: Sun Dec 10, 2006 9:23 pm
Post by Nicol Bolas »
OK:If it does not work on your computer please post a small sample document.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://docbook.org/xml/5.0CR3/rng/docbookxi.rng" type="xml"?>
<book xmlns="http://docbook.org/ns/docbook" version="5.0cr3">
<title>Book Title</title>
<chapter>
<title>Some Title</title>
<para>A line of text.</para>
</chapter>
</book>
-
- Posts: 11
- Joined: Sun Dec 10, 2006 9:23 pm
Post by Nicol Bolas »
Alright:
[/code]
Code: Select all
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
<!-- ............................................................ -->
<!-- XML Catalog for DocBook .................................... -->
<!-- File catalog.xml ........................................... -->
<!-- Please direct all questions, bug reports, or suggestions for
changes to the docbook@lists.oasis-open.org mailing list.
For more information, see http://www.oasis-open.org/.
-->
<!-- This is a catalog data file for DocBook. It is provided as a
convenience in building your own catalog files. You need not
use the filenames listed here, and need not use the filename
method of identifying storage objects at all. See the
documentation for detailed information on the files associated
with the DocBook DTD. See XML Catalogs at
http://www.oasis-open.org/committees/entity/ for detailed
information on supplying and using catalog data.
-->
<public publicId="-//OASIS//DTD DocBook XML 5.0CR3//EN" uri="dtd/docbook.dtd"/>
<system systemId="http://www.oasis-open.org/docbook/xml/5.0CR3/dtd/docbook.dtd" uri="dtd/docbook.dtd"/>
<system systemId="http://docbook.org/xml/5.0CR3/dtd/docbook.dtd" uri="dtd/docbook.dtd"/>
<uri name="http://www.oasis-open.org/docbook/xml/5.0CR3/rng/docbook.rng" uri="rng/docbook.rng"/>
<uri name="http://docbook.org/xml/5.0CR3/rng/docbook.rng" uri="rng/docbook.rng"/>
<uri name="http://www.oasis-open.org/docbook/xml/5.0CR3/rng/docbookxi.rng" uri="rng/docbookxi.rng"/>
<uri name="http://docbook.org/xml/5.0CR3/rng/docbookxi.rng" uri="rng/docbookxi.rng"/>
<uri name="http://www.oasis-open.org/docbook/xml/5.0CR3/rng/docbook.rnc" uri="rng/docbook.rnc"/>
<uri name="http://docbook.org/xml/5.0CR3/rng/docbook.rnc" uri="rng/docbook.rnc"/>
<uri name="http://www.oasis-open.org/docbook/xml/5.0CR3/rng/docbookxi.rnc" uri="rng/docbookxi.rnc"/>
<uri name="http://docbook.org/xml/5.0CR3/rng/docbookxi.rnc" uri="rng/docbookxi.rnc"/>
<uri name="http://www.oasis-open.org/docbook/xml/5.0CR3/xsd/docbook.xsd" uri="xsd/docbook.xsd"/>
<uri name="http://docbook.org/xml/5.0CR3/xsd/docbook.xsd" uri="xsd/docbook.xsd"/>
<uri name="http://www.oasis-open.org/docbook/xml/5.0CR3/xsd/docbookxi.xsd" uri="xsd/docbookxi.xsd"/>
<uri name="http://docbook.org/xml/5.0CR3/xsd/docbookxi.xsd" uri="xsd/docbookxi.xsd"/>
<uri name="http://www.oasis-open.org/docbook/xml/5.0CR3/xsd/xi.xsd" uri="xsd/xi.xsd"/>
<uri name="http://docbook.org/xml/5.0CR3/xsd/xi.xsd" uri="xsd/xi.xsd"/>
<uri name="http://www.oasis-open.org/docbook/xml/5.0CR3/xsd/xlink.xsd" uri="xsd/xlink.xsd"/>
<uri name="http://docbook.org/xml/5.0CR3/xsd/xlink.xsd" uri="xsd/xlink.xsd"/>
<uri name="http://www.oasis-open.org/docbook/xml/5.0CR3/xsd/xml.xsd" uri="xsd/xml.xsd"/>
<uri name="http://docbook.org/xml/5.0CR3/xsd/xml.xsd" uri="xsd/xml.xsd"/>
<uri name="http://www.oasis-open.org/docbook/xml/5.0CR3/sch/docbook.sch" uri="sch/docbook.sch"/>
<uri name="http://docbook.org/xml/5.0CR3/sch/docbook.sch" uri="sch/docbook.sch"/>
<!-- End of XML Catalog for DocBook ............................. -->
<!-- ............................................................ -->
</catalog>
-
- Posts: 11
- Joined: Sun Dec 10, 2006 9:23 pm
Post by Nicol Bolas »
As mentioned in my initial post, I didn't write this catalog; it's the one that came with the DocBook 5 download. Presumably, they think it is a valid catalog.oXygen uses system mappings to solve schema locations and you have only uri mappings in the catalog.
Is there some specific reasoning for the disconnect between what the OASIS guys think is a working catalog and what oXygen thinks is a working catalog?
More to the point, I don't understand how to write catalogs. How would I go about fixing this one?
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Well, the problem is that oXygen uses the parser at SAX level and there we have no distinction between external entities for instance and schema locations. That was for XML Schema and we choose the same implementation for consistency also for Relax NG. We have recorded an issue on our Jira to use uri mappings for XML Schema and other schema languages.
To make this working you need to add for each uri entry in the catalog an equivalent system entry, for instance for
<uri name="http://www.oasis-open.org/docbook/xml/5 ... ocbook.rng" uri="rng/docbook.rng"/>
add
<system systemId="http://www.oasis-open.org/docbook/xml/5 ... ocbook.rng" uri="rng/docbook.rng"/>
Best Regards,
George
To make this working you need to add for each uri entry in the catalog an equivalent system entry, for instance for
<uri name="http://www.oasis-open.org/docbook/xml/5 ... ocbook.rng" uri="rng/docbook.rng"/>
add
<system systemId="http://www.oasis-open.org/docbook/xml/5 ... ocbook.rng" uri="rng/docbook.rng"/>
Best Regards,
George
George Cristian Bina
-
- Posts: 11
- Joined: Sun Dec 10, 2006 9:23 pm
Post by Nicol Bolas »
It almost works now. Or to be fair, the example I posted works, but I then realized that a slightly more complex yet still important example fails.
One where this line comes after the RNGSchema include:
Thus allowing validation with the embedded Schematron rules. The RNG alone validates just fine; the Schematron schema throws an error, saying that it can't find the document.
One where this line comes after the RNGSchema include:
Code: Select all
<?oxygen SCHSchema="http://docbook.org/xml/5.0CR3/rng/docbookxi.rng"?>
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
That is correct, good catch. It will be fixed in 8.2.
In the meanwhile you can configure the association with the schema externally, using the Options->Preferences -- Editor -- Default Schema Association. There select the Relax NG schema and set as type "Relax NG + Schematron". You can make the association based on the document namespace for instance - this is described also in the DocBook howto:
http://www.docbook.org/docs/howto/#editors-oxygen
Best Regards,
George
In the meanwhile you can configure the association with the schema externally, using the Options->Preferences -- Editor -- Default Schema Association. There select the Relax NG schema and set as type "Relax NG + Schematron". You can make the association based on the document namespace for instance - this is described also in the DocBook howto:
http://www.docbook.org/docs/howto/#editors-oxygen
Best Regards,
George
George Cristian Bina
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