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 P L <pa...@yahoo.com> on 2003/10/03 01:34:22 UTC
Skip attribute validation
Hello,
One of the elements in my XML file contains 4 attributes. I validate my XML file with a DTD.
Now a requirement has come to skip validiting one of the attributes. I tried to remove the attribute declaration from DTD but xerces complains "Attribute must be declared for element type ...". I tried if any of the features,properties available through DocumentBuilderFactory may fit but none of them allow skipping attribute validation.
Any ideas on how to skip attribute validation ?.
Thank you,
---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
Re: Skip attribute validation
Posted by Michael Glavassevich <mr...@apache.org>.
Hello,
You cannot skip attribute validation. If you've requested that an XML
parser determine the validity [1] of a document it is required that it
report validity constraints that are violated as errors. The requirement
that all attributes included in the document must be declared [2] is one
of these.
If your document isn't valid, the errors the parser reports aren't fatal,
so if you can determine the context of the error (which I admit isn't easy
given that there's no standard that I know of for reporting this
information) you can ignore the error if you're not interested in it.
[1] http://www.w3.org/TR/REC-xml#dt-valid
[2] http://www.w3.org/TR/REC-xml#ValueType
On Thu, 2 Oct 2003, P L wrote:
>
> Hello,
>
> One of the elements in my XML file contains 4 attributes. I validate my XML file with a DTD.
>
> Now a requirement has come to skip validiting one of the attributes. I tried to remove the attribute declaration from DTD but xerces complains "Attribute must be declared for element type ...". I tried if any of the features,properties available through DocumentBuilderFactory may fit but none of them allow skipping attribute validation.
>
> Any ideas on how to skip attribute validation ?.
>
> Thank you,
>
>
>
> ---------------------------------
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
--------------------
Michael Glavassevich
mrglavas@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org