By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,402 Members | 1,107 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,402 IT Pros & Developers. It's quick & easy.

problem with <restriction>

P: n/a
Greetings.

Below is the schema snippet I am trying to explore attributegroups and attribute's use property. However I am getting a validation error saying "undefined value for base encountered", pointing to <xs:restriction>. Please help.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:attributeGroup name="grp">
<xs:attribute name="x" type="xs:string"/>
<xs:attribute name="y" type="xs:string"/>
<xs:attribute name="z" type="xs:string"/>
</xs:attributeGroup>
<xs:complexType name="A">
<xs:complexContent>
<xs:restriction base="xs:grp">
<xs:attribute name="x" use="required"/>
<xs:attribute name="y" use="prohibited"/>
<xs:attribute name="z" use="required"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:schema>

************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
The attributeGroup does not belong to the xs namespace, rather than
targetnamespace of the schema (which is no namespace in this case). Just
remove the xs prefix in the reference to the attribute group and it should
work:
<xs:restriction base="grp">

"Mahalakshmi Natarajan" <ma***********@yahoo.co.uk> wrote in message
news:el*************@TK2MSFTNGP11.phx.gbl... Greetings.

Below is the schema snippet I am trying to explore attributegroups and attribute's use property. However I am getting a validation error saying
"undefined value for base encountered", pointing to <xs:restriction>. Please
help.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:attributeGroup name="grp">
<xs:attribute name="x" type="xs:string"/>
<xs:attribute name="y" type="xs:string"/>
<xs:attribute name="z" type="xs:string"/>
</xs:attributeGroup>
<xs:complexType name="A">
<xs:complexContent>
<xs:restriction base="xs:grp">
<xs:attribute name="x" use="required"/>
<xs:attribute name="y" use="prohibited"/>
<xs:attribute name="z" use="required"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:schema>

************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &

ASP.NET resources...
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.