This should cover W3C XML Schema, Relax NG and DTD related problems.
- Posts: 8
- Joined: Wed Jan 09, 2013 3:30 pm
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:choice minOccurs="0" maxOccurs="2">
<xs:element minOccurs="1" maxOccurs="unbounded" ref="le:Textebene-1"/>
<xs:assert test="count(le:Einführung) le 1"/>
If I test »Lernziele« this way, everything is OK. If I test »Einführung« there is an error:
E [Xerces] cvc-xpath.18.104.22.168a: 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 ...
- Posts: 77
- Joined: Thu Oct 23, 2008 6:29 am
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.
- Posts: 2515
- Joined: Tue May 17, 2005 4:01 pm
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.
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
- Posts: 6211
- Joined: Fri Jul 09, 2004 5:18 pm
This issue should be fixed in the Xerces parser which comes with Oxygen 16.0.
<oXygen/> XML Editor