Trying to use custom datatype library in RELAX NG
This should cover W3C XML Schema, Relax NG and DTD related problems.
Trying to use custom datatype library in RELAX NG
I'm trying to make use of a datatype library I have defined in an XML Schema document in Oxygen for Eclipse.
Here's a portion of my RELAX NG schema where I try to import the custom library:
Here's the schema itself (in my-datatypes.xsd in the same directory):
I know that Oxygen can find this schema because I created an XML Catalog to point to this local version. If I right click on the URI in the datatypeLibrary attribute and select "Open File at Caret", the .xsd file is opened. I've tried changing the local resource that the XML Catalog points to and Oxygen opens up the correct file each time. So that seems fine.
However, Oxygen seems to keep telling me my RELAX NG document is invalid:
Thanks.
Here's a portion of my RELAX NG schema where I try to import the custom library:
Code: Select all
<element name="foo">
<data type="myCustomType" datatypeLibrary="http://example.com/my-datatypes" />
</element>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://example.com/my-datatypes"
targetNamespace="http://example.com/my-datatypes">
<xs:complexType name="myCustomType">
<xs:attribute name="id" type="xs:positiveInteger" use="required" />
<xs:attribute name="name" type="xs:string" use="optional" />
</xs:complexType>
</xs:schema>
However, Oxygen seems to keep telling me my RELAX NG document is invalid:
Can anyone give any clues as to where I'm going wrong?[oNVDL] datatype library "http://example.com/my-datatypes" not recognized
Thanks.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Trying to use custom datatype library in RELAX NG
Post by sorin_ristache »
Hello,
In RELAX NG a data type library is loaded from an external library file not from an XML Schema. Oxygen uses the Jing validator which requires a Java library that implements the data types, that is a jar file in the classpath of the application. You have to create Java classes that implement org.relaxng.datatype.Datatype, org.relaxng.datatype.DatatypeLibrary and org.relaxng.datatype.DatatypeLibraryFactory and include them in a jar that you copy to [Oxygen-install-folder]/lib.
Regards,
Sorin
In RELAX NG a data type library is loaded from an external library file not from an XML Schema. Oxygen uses the Jing validator which requires a Java library that implements the data types, that is a jar file in the classpath of the application. You have to create Java classes that implement org.relaxng.datatype.Datatype, org.relaxng.datatype.DatatypeLibrary and org.relaxng.datatype.DatatypeLibraryFactory and include them in a jar that you copy to [Oxygen-install-folder]/lib.
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