Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

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

 
 
Aray
Guest
Posts: n/a
 
      12-19-2006
Let us see the test file following:

-------file nowork.xsd begin-----------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlnss="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.bonc.com.cn" targetNamespace="http://www.bonc.com.cn"
elementFormDefault="qualified">
<xs:attribute name="testAttribute" type="xs:string"/>
<xs:attributeGroup name="testAttributeGroup">
<xs:attribute ref="testAttribute"/>
</xs:attributeGroup>
<xs:complexType name="testType">
<xs:attributeGroup ref="testAttributeGroup"/>
</xs:complexType>
<xs:element name="test" type="testType"/>
</xs:schema>
-------file nowork.xsd end-----------


-------file nowork.xml end-----------
<?xml version="1.0" encoding="UTF-8"?>
<test
xmlns="http://www.bonc.com.cn"
xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bonc.com.cn nowork.xsd"

testAttribute="a"
></test>

-------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
Details
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 http://www.w3schools.com/schema/default.asp. Did I miss
something?

Any help will be preciouse

--



 
Reply With Quote
 
 
 
Reply

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.... osama178@gmail.com C++ 22 04-30-2008 10:42 AM
passing ref to ptr again as ref to ptr.... osama178@gmail.com C++ 6 04-29-2008 08:09 AM
passing ref to ptr again as ref to ptr.... osama178@gmail.com C++ 0 04-24-2008 08:23 PM
strong ref from weak ref? Navindra Umanee Ruby 2 02-12-2005 05:06 PM



Advertisments