"cvc-complex-type.2.4.b" error
Issues related with the oNVDL implementation of NVDL.
-
- Posts: 3
- Joined: Mon May 21, 2007 10:02 am
"cvc-complex-type.2.4.b" error
a.xsd:
<xs:schema xmlns:a="http://a" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://a" elementFormDefault="qualified">
<xs:element name="root_a">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="a:a"/>
<xs:choice>
<xs:element ref="a:b"/>
<xs:any namespace="http://b" processContents="lax"></xs:any>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="a"/>
<xs:element name="b"/>
</xs:schema>
b.xsd:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://b" elementFormDefault="qualified">
<xs:element name="root_b">
<xs:complexType>
<xs:sequence>
<xs:element name="b1"/>
<xs:element name="b2"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
a.nvdl:
<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
<namespace ns="http://a">
<validate schema="a.xsd"/>
</namespace>
<namespace ns="http://b">
<validate schema="b.xsd"/>
</namespace>
</rules>
a.xml:
<?oxygen NVDLSchema="a.nvdl"?>
<root_a xmlns="http://a">
<a>123</a>
<root_b xmlns="http://b">
<b1>1234</b1>
<b2>1234</b2>
</root_b>
</root_a>
there is a error:
cvc-complex-type.2.4.b: The content of element 'root_a' is not complete. One of '{"http://a":b, WC["http://b"]}' is expected.
is this a bug?
<xs:schema xmlns:a="http://a" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://a" elementFormDefault="qualified">
<xs:element name="root_a">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="a:a"/>
<xs:choice>
<xs:element ref="a:b"/>
<xs:any namespace="http://b" processContents="lax"></xs:any>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="a"/>
<xs:element name="b"/>
</xs:schema>
b.xsd:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://b" elementFormDefault="qualified">
<xs:element name="root_b">
<xs:complexType>
<xs:sequence>
<xs:element name="b1"/>
<xs:element name="b2"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
a.nvdl:
<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
<namespace ns="http://a">
<validate schema="a.xsd"/>
</namespace>
<namespace ns="http://b">
<validate schema="b.xsd"/>
</namespace>
</rules>
a.xml:
<?oxygen NVDLSchema="a.nvdl"?>
<root_a xmlns="http://a">
<a>123</a>
<root_b xmlns="http://b">
<b1>1234</b1>
<b2>1234</b2>
</root_b>
</root_a>
there is a error:
cvc-complex-type.2.4.b: The content of element 'root_a' is not complete. One of '{"http://a":b, WC["http://b"]}' is expected.
is this a bug?
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi,
No, it is not a bug.
All you need is to attach sections from http://b namespace so that the validation with schema a.xsd will validate also the root_b from http://b namespace, matching it against the wildcard. Otherwise what you get to validate with schema a.xsd is
which clearly needs either a:b or an element from the http://b namespace to be valid.
So, change the NVDL script as below:
Best Regards,
George
No, it is not a bug.
All you need is to attach sections from http://b namespace so that the validation with schema a.xsd will validate also the root_b from http://b namespace, matching it against the wildcard. Otherwise what you get to validate with schema a.xsd is
Code: Select all
<root_a xmlns="http://a">
<a>123</a>
</root_a>
So, change the NVDL script as below:
Code: Select all
<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
<namespace ns="http://a">
<validate schema="a.xsd"/>
</namespace>
<namespace ns="http://b">
<validate schema="b.xsd"/>
<attach/>
</namespace>
</rules>
George
George Cristian Bina
Return to “oNVDL Related Issues”
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