Title: Message
Hi
 
As you do not provide schema information for attr1, attr2 and attr3 you should use lax or skip for the processContent attribute of xs:anyAttribute element
    <xs:anyAttribute  processContents="lax"/>
or
    <xs:anyAttribute  processContents="skip"/>
 
Best Regards,
 George
-------------------------------------------------------------
George Cristian Bina mailto:[EMAIL PROTECTED]
COO - sync.ro
Phone  +40-(0)251-461480, +40-(0)251-461481
Fax       +40-(0)251-461482
Mobile +40-(0)723-224067
SyncRO Soft srl, Bd N. Titulescu 170, Craiova, 1100 - Romania
http://www.sync.ro
<oXygen/> - http://oxygen.sync.ro/
 
 
----- Original Message -----
From: Katz Guy
Sent: Wednesday, July 24, 2002 11:13 AM
Subject: Any attribute and validation



Hi all;
I am having a small problem and hope you can help.
I am using xerces 2 & jdk1.3 on win2000
I have a w3c schema that allows any attribute on an element.
While parsing an my xml through a validating parser I get the following line for each attribute in that element:
"org.xml.sax.SAXParseException: Attribute "ANY---attr1" must be declared for element type "d"……: (where xyz is the name of the actual attribute in the element).

Not that while validating my xml to my schema using xmlspy - there were no problems.

Did anyone have this problem before?
Any help would be appreciated.

My schema defenition:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <xs:element name="a">
                <xs:complexType>
                        <xs:sequence>
                                <xs:element name="b">
                                        <xs:complexType>
                                                <xs:sequence>
                                                        <xs:element name="c" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>

                                                </xs:sequence>
                                        </xs:complexType>
                                </xs:element>
                                <xs:element name="d" minOccurs="1" maxOccurs="unbounded">
                                        <xs:complexType>
                                                <xs:simpleContent>
                                                        <xs:extension base="xs:string">
                                                                <xs:anyAttribute/>
                                                        </xs:extension>
                                                </xs:simpleContent>
                                        </xs:complexType>
                                </xs:element>
                        </xs:sequence>
                </xs:complexType>
        </xs:element>
</xs:schema>

My xml

<?xml version="1.0" encoding="UTF-8"?>
<a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="pathToSchema">
        <b>
                <c>ggg</c>
                <c>ggg</c>
                <c>ggg</c>
        </b>
        <d attr1="ggg" attr2="ggg" attr3="ggg">ggg</d>
        <d attr1="ggg" attr2="ggg" attr3="ggg">ggg</d>
</a>

Reply via email to