Re: does DOM Object contain schema elements also ??

anand awasthi wrote:

> Hi,
>
> i am parsing an xml file which is being validated by using schema.
> my question is when DOM object is generated then does this DOM object contain
> schema elements and node information also ?? (does DOM tree include schema
> information also ??)
>
> pls reply soon
> tx
> AA

In short - no.
In long -
DOM Lvl 1 and Lvl 2 do not provide access to schema information.  DOM Lvl 3 [1]
is currently being developed and _does_ include schema information, BUT this
schema information is not the W3C XML Schema information.  It is "schema"
information in the original sense of the word.
Having said this, both DOM Lvl 1 and Lvl 2 allow element information items to
contain default attribute values that have been specified in some "schema" (I
think they had DTD in mind).  I'm not sure if the xerces parser will supply these
defaults if you supply it with a schema.  Try it and find out.

mick

[1] http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010126/

Received on Monday, 5 February 2001 16:43:54 UTC