Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > <xs:attribute> with ref attribute nested in <xs:attribteGroup> does't work problem

Thread Tools

<xs:attribute> with ref attribute nested in <xs:attribteGroup> does't work problem

Posts: n/a
Let us see the test file following:

-------file nowork.xsd begin-----------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlnss=""
xmlns="" targetNamespace=""
<xs:attribute name="testAttribute" type="xs:string"/>
<xs:attributeGroup name="testAttributeGroup">
<xs:attribute ref="testAttribute"/>
<xs:complexType name="testType">
<xs:attributeGroup ref="testAttributeGroup"/>
<xs:element name="test" type="testType"/>
-------file nowork.xsd end-----------

-------file nowork.xml end-----------
<?xml version="1.0" encoding="UTF-8"?>
xsi:schemaLocation=" nowork.xsd"


-------file nowork.xml end-----------

I validate the nowork.xml with xmlSpy 2007. the following error countered:

------------error message begin----------------
File F:\work\temp\xmlStudy\form\nowork.xml is not valid.
Attribute 'testAttribute' is not allowed in element <test>
Error location: test / @testAttribute
cvc-complex-type.3.2.1: Complex type definition 'testType' of element
<test> does not allow attribute 'testAttribute' and no attribute wildcard
matches it.
cvc-elt.5.2.1: The element <test> is not valid with respect to the actual
type definition 'testType'.
------------error message end----------------

What I expect is, The nowork.xml is a valid xml file. But it doesn't.

I am newbie to xml and schema. I have just fished to read the XML Schema
Tutorial on Did I miss

Any help will be preciouse


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Giving an rvalue ref to a function taking an rvalue ref Juha Nieminen C++ 13 08-29-2012 09:25 PM
passing ref to ptr again as ref to ptr.... C++ 22 04-30-2008 10:42 AM
passing ref to ptr again as ref to ptr.... C++ 6 04-29-2008 08:09 AM
passing ref to ptr again as ref to ptr.... C++ 0 04-24-2008 08:23 PM
strong ref from weak ref? Navindra Umanee Ruby 2 02-12-2005 05:06 PM