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,
usually I work with two Elements: »Lernziele« and »Einführung«. I would like to use the xs:assert to give an error indication, if someone choose one of them twice. You see it below.
If I test »Lernziele« this way, everything is OK. If I test »Einführung« there is an error:
E [Xerces] cvc-xpath.3.13.4.2a: XPST0003 - Assertion XPath expression ('count(le:Einführung) le 1') on the schema type 'defKapitel' couldn't compile successfully.
If I change »Einführung« to »Einfuhrung«, everything is OK - but then I have a new problem - a semantic one ...
Best regards
Ulrike Borinski
usually I work with two Elements: »Lernziele« and »Einführung«. I would like to use the xs:assert to give an error indication, if someone choose one of them twice. You see it below.
Code: Select all
<xs:complexType name="defKapitel">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="2">
<xs:element ref="le:Einführung"/>
<xs:element ref="le:Lernziele"/>
</xs:choice>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="le:Textebene-1"/>
</xs:sequence>
<xs:assert test="count(le:Einführung) le 1"/>
</xs:complexType>
E [Xerces] cvc-xpath.3.13.4.2a: XPST0003 - Assertion XPath expression ('count(le:Einführung) le 1') on the schema type 'defKapitel' couldn't compile successfully.
If I change »Einführung« to »Einfuhrung«, everything is OK - but then I have a new problem - a semantic one ...
Best regards
Ulrike Borinski
-
- Posts: 99
- Joined: Thu Oct 23, 2008 6:29 am
Re: xs:assert in Schema 1.1
Since no one responded, I took a quick look at this. I had to add more to your schema, since it was not posted in its entirety. I reproduced this issue.
It looks like the issue is due to the ü character in Einführung. Something is not able to handle this Unicode character would be my guess. If I change just that one character to something else (in my case, I changed it to u), it works without that error appearing.
It looks like the issue is due to the ü character in Einführung. Something is not able to handle this Unicode character would be my guess. If I change just that one character to something else (in my case, I changed it to u), it works without that error appearing.
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: xs:assert in Schema 1.1
Hello,
I've tested with your example in v15.1 of Oxygen and it looks like Xerces has trouble with special characters in XPath expressions from asserts. We'll forward this problem to the Xerces developers.
I can't find a workaround for Xerces. I've tried using character entity references, but it doesn't make any difference.
Note however that Saxon-EE validates this correctly, so one workaround in Oxygen is to set Saxon-EE as the default schema validation engine in: Options > Preferences, XML > XML Parser > XML Schema.
Regards,
Adrian
I've tested with your example in v15.1 of Oxygen and it looks like Xerces has trouble with special characters in XPath expressions from asserts. We'll forward this problem to the Xerces developers.
I can't find a workaround for Xerces. I've tried using character entity references, but it doesn't make any difference.
Note however that Saxon-EE validates this correctly, so one workaround in Oxygen is to set Saxon-EE as the default schema validation engine in: Options > Preferences, XML > XML Parser > XML Schema.
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
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