xs:assert in Schema 1.1
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 8
- Joined: Wed Jan 09, 2013 3:30 pm
xs:assert in Schema 1.1
Post by frauborinski »
Hello,
I have a complexType – amongst others a choose with two elements. Idea is, to have 1 »Einführung« and/or 1 »Lernziele« in any order. So I allow the choice twice. Next step was to give an error indication if the author chooses »Lernziele« twice. I tried xs:assert and got a Problem with the element-name »Einführung«. Only »Einfuhrung« works. Is this a rule or an error?
<xs:complexType name="defKapitelStudienbrief">
<xs:sequence>
<xs:element minOccurs="0" ref="le:Vorwort"/>
<xs:choice maxOccurs="2">
<xs:element ref="le:Einfuhrung" minOccurs="0" maxOccurs="1"/> <!-- le:Einführung-->
<xs:element ref="le:Lernziele" minOccurs="0" maxOccurs="1"/>
</xs:choice>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="le:Textebene-1"/>
</xs:sequence>
<xs:assert test="count(le:Einfuhrung) le 1"> <!-- le:Einführung-->
<xs:assert test="count(le:Lernziele) le 1"/>
</xs:complexType>
Kind regards
Ulrike Borinski
I have a complexType – amongst others a choose with two elements. Idea is, to have 1 »Einführung« and/or 1 »Lernziele« in any order. So I allow the choice twice. Next step was to give an error indication if the author chooses »Lernziele« twice. I tried xs:assert and got a Problem with the element-name »Einführung«. Only »Einfuhrung« works. Is this a rule or an error?
<xs:complexType name="defKapitelStudienbrief">
<xs:sequence>
<xs:element minOccurs="0" ref="le:Vorwort"/>
<xs:choice maxOccurs="2">
<xs:element ref="le:Einfuhrung" minOccurs="0" maxOccurs="1"/> <!-- le:Einführung-->
<xs:element ref="le:Lernziele" minOccurs="0" maxOccurs="1"/>
</xs:choice>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="le:Textebene-1"/>
</xs:sequence>
<xs:assert test="count(le:Einfuhrung) le 1"> <!-- le:Einführung-->
<xs:assert test="count(le:Lernziele) le 1"/>
</xs:complexType>
Kind regards
Ulrike Borinski
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: xs:assert in Schema 1.1
Hi,
Is this a duplicate of http://www.oxygenxml.com/forum/topic10318.html ?
It seems you're describing a different problem, but I can't reproduce it in the context you provided here.
What error message are you receiving in this case?
Regards,
Adrian
Is this a duplicate of http://www.oxygenxml.com/forum/topic10318.html ?
It seems you're describing a different problem, but I can't reproduce it in the context you provided here.
What error message are you receiving in this case?
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 8
- Joined: Wed Jan 09, 2013 3:30 pm
Re: xs:assert in Schema 1.1
Post by frauborinski »
Yes, it is a duplicate. I was not sure, wether my first post is on the way.
Kind regards
Ulrike Borinski
Kind regards
Ulrike Borinski
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