You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Julien Cugnière <ju...@gmail.com> on 2017/03/28 17:13:15 UTC

Trailing spaces in element name inside a schema

Hi all,

I've encountered an XSD file that most XML tools I tested can use
without problem, but that triggers an error when I try to use it with
Xerces C++ (version 3.1.3). After some investigation, it turns out the
problem is this :

    ...
    <xs:element ref="Foobar " minOccurs="0" maxOccurs="1"/>
    ...
     <xs:element name="Foobar " type="ns:Baz"/>
    ...

Notice how the name Foobar is followed by a space in both occurrences.
When loading the XSD with XercesDOMParser::loadGrammar, I get an error
"referenced element 'Foobar' not found" on the first occurrence. If I
remove the space in both occurrences, the XSD file can be used with
Xerces without a problem.

I'm not an XML expert, so I thought I'd post here before filing an
issue in Jira. Is this a bug, or is Xerces allowed to reject such an
XSD file?

-- 
Julien Cugnière