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 Alex Giladi <al...@harmonic.co.il> on 2001/03/01 08:24:07 UTC

RE: Fixed and default attributes

I tried both the DOMPrint sample and the serialization feature - both of
them produce the same result (i.e., w/o the default/fixed attributes)
Am I missing something?

Thank you in advance.

Alex.

-----Original Message-----
From: neilg@ca.ibm.com [mailto:neilg@ca.ibm.com]
Sent: Monday, February 26, 2001 21:12
To: xerces-j-user@xml.apache.org
Subject: Re: Fixed and default attributes




Hi Alex,

The default attribute values should be in the document's DOM tree when you
validate it against the schema.  Have you tried validating the document
against the schema (i.e., setting the validation and related features to
true, registering your errorHandler etc.) and then looking in the DOM tree
returned by the DOM parser for the values of the attributes you're
interested in?

Cheers,
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  416-448-3519, T/L 778-3519
E-mail:  neilg@ca.ibm.com



alexg@harmonic.co.il on 02/26/2001 01:55:43 PM

Please respond to xerces-j-user@xml.apache.org

To:   xerces-j-user@xml.apache.org
cc:
Subject:  Fixed and default attributes


Dear all!

I have an XML file and I also have its Schema specification. The schema
extensively uses the "default" and "fixed" features, therefore not all
attributes are explicitly specified in the xml file.
What I actually need is to build a complete DOM tree (i.e., with the
"missing"
attributes).
Is there a way of doing it in Xerces, without writing my own Schema
processing
code?

Sincerely yours, Alex.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.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


Re: Fixed and default attributes

Posted by se...@cern.ch.
It is normal. There is no need to put them in the xml document since they are
defined in the dtd. If you want to ensure that the attribtues are in the DOM
tree, just try to issue a getAttribute on the corresponding node. You should
get the default and fixed attributes too.

Sebastien


Alex Giladi wrote:

> I tried both the DOMPrint sample and the serialization feature - both of
> them produce the same result (i.e., w/o the default/fixed attributes)
> Am I missing something?
>
> Thank you in advance.
>
> Alex.
>
> -----Original Message-----
> From: neilg@ca.ibm.com [mailto:neilg@ca.ibm.com]
> Sent: Monday, February 26, 2001 21:12
> To: xerces-j-user@xml.apache.org
> Subject: Re: Fixed and default attributes
>
> Hi Alex,
>
> The default attribute values should be in the document's DOM tree when you
> validate it against the schema.  Have you tried validating the document
> against the schema (i.e., setting the validation and related features to
> true, registering your errorHandler etc.) and then looking in the DOM tree
> returned by the DOM parser for the values of the attributes you're
> interested in?
>
> Cheers,
> Neil
> Neil Graham
> XML Parser Development
> IBM Toronto Lab
> Phone:  416-448-3519, T/L 778-3519
> E-mail:  neilg@ca.ibm.com
>
> alexg@harmonic.co.il on 02/26/2001 01:55:43 PM
>
> Please respond to xerces-j-user@xml.apache.org
>
> To:   xerces-j-user@xml.apache.org
> cc:
> Subject:  Fixed and default attributes
>
> Dear all!
>
> I have an XML file and I also have its Schema specification. The schema
> extensively uses the "default" and "fixed" features, therefore not all
> attributes are explicitly specified in the xml file.
> What I actually need is to build a complete DOM tree (i.e., with the
> "missing"
> attributes).
> Is there a way of doing it in Xerces, without writing my own Schema
> processing
> code?
>
> Sincerely yours, Alex.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org