You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Leonardo Palozzi <lp...@gmail.com> on 2005/03/22 20:37:11 UTC

XML Schema validation - xml:base attribute

The Xinclude faq (http://xml.apache.org/xerces2-j/faq-xinclude.html)
says to allow xml:base attributes to appear on elements that might be
included from different base URIs.

I've tried and get the following error when I run `java sax.Counter -s
entity-inc.xml' (note that entity-inc.xml has been pre-processed with
XIncluder)

[Error] entity.xsd:28:52: s4s-att-invalid-value: Invalid attribute
value for 'name' in element 'attribute'. Recorded reason:
cvc-datatype-valid.1.2.1: 'xml:base' is not a valid value for
'NCName'.

Why is 'xml:base' an invalid name for an attribute?


My xml:base attribute in entity.xsd is

  <xs:attribute name="xml:base" type="xs:anyURI" />


Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: XML Schema validation - xml:base attribute

Posted by Sandy Gao <sa...@ca.ibm.com>.
> [Error] entity.xsd:28:52

Apparently the parser's complaining about your schema, not your instance.

Did you have something like:

<attribute name="xml:base" ...>

This is not allowed. The value for "name" has to be an NCName, which means 
"no colon name".

You may want to import the "xml" xsd and use an attribute reference:

<attribute ref="xml:base" ...>

Cheers,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
sandygao@ca.ibm.com




Leonardo Palozzi <lp...@gmail.com> 
03/22/2005 02:37 PM
Please respond to
xerces-j-user


To
xerces-j-user@xml.apache.org
cc

Subject
XML Schema validation - xml:base attribute






The Xinclude faq (http://xml.apache.org/xerces2-j/faq-xinclude.html)
says to allow xml:base attributes to appear on elements that might be
included from different base URIs.

I've tried and get the following error when I run `java sax.Counter -s
entity-inc.xml' (note that entity-inc.xml has been pre-processed with
XIncluder)

[Error] entity.xsd:28:52: s4s-att-invalid-value: Invalid attribute
value for 'name' in element 'attribute'. Recorded reason:
cvc-datatype-valid.1.2.1: 'xml:base' is not a valid value for
'NCName'.

Why is 'xml:base' an invalid name for an attribute?


My xml:base attribute in entity.xsd is

  <xs:attribute name="xml:base" type="xs:anyURI" />


Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org