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 Raymond Tam <ra...@demandtec.com> on 2001/11/28 16:43:58 UTC
RE: anyattribute question
Thanks john!
-----Original Message-----
From: Anderson, John
Sent: Wed 11/28/2001 2:24 AM
To: 'xerces-j-user@xml.apache.org'
Cc:
Subject: RE: anyattribute question
Raymond,
It isn't as simple as that! Even an ANY content model in a DTD
requires the elements used to be declared somewhere.
When you use <xsd:anyAttribute>, it means anyAttribute in the
specified namespace (in this case the default being, I believe ##any).
It doesn't necessarily exonerate you from declaring those attributes
somewhere. However, you can get around this by using:
<xsd:anyAttribute processContents="skip" /> in which case it
only needs top be well-formed, or <xsd:anyAttribue processContents="lax"
/> in which case it will only be validated if a declaration exists for
the item.
John
_______________________________________________________
John Anderson
CTO BarbadosoftTM
The XML Management Company
+31 (0)20 750 7582 / +31 (0)6 65 347 448 / www.barbadosoft.com
- putting the "X" in "XML" -
-----Original Message-----
From: Raymond Tam [mailto:raymond.tam@demandtec.com]
Sent: 27 November 2001 20:45
To: xerces-j-user@xml.apache.org
Subject: anyattribute question
Hi,
in a xml schema, I defined any element to be 'anyattribute' :
....
<xsd:element name="RowData">
<xsd:complexType>
<xsd:anyAttribute/>
</xsd:complexType>
</xsd:element>
....
then in a xml file, when I try have something like this :
....
<RowData name="stuff" price="$2" vol="5000" />
...
the parse complains about
Attribute "ANY---name" must be declared for element type
"RowData".
Attribute "ANY---price" must be declared for element type
"RowData".
Attribute "ANY---vol" must be declared for element type
"RowData".
basically what I want to the ability that I have an 'RowData'
element
that contain whatever it wants
while not violate my schema.
any help greatly appreciated,
raymond
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
The information transmitted by this e-mail message is intended
solely for the use of the person to whom or entity to which it is
addressed. The message may contain information that is privileged and
confidential. Disclosure, dissemination, distribution, review,
retransmission to, other use of or taking any action in reliance upon
this information by anyone other than the intended recipient is
prohibited. If you are not the intended recipient, please do not
disseminate, distribute or copy this communication, by e-mail or
otherwise. Instead, please notify us immediately by return e-mail
(including the original message with your reply) and then delete and
discard all copies of the message.
Although we have taken precautions to minimize the risk of
transmitting viruses we nevertheless advise you to carry out your own
virus checks on any attachment to this message. We accept no liability
for any loss or damage caused by viruses.