Hi Mark,

Mark Brucks <bru...@charter.net> wrote on 10/19/2009 08:20:27 PM:

> I'm having trouble understanding how information about derived types
> is maintained.  I have a schema with a derived type declared, and an
> instance document which uses it (via xsi:type).  I know that this type
> information is maintained by the DOM, because if I parse a document
> and then write it back out, the type information appears in the saved
> document.

If you're referring to xsi:type it's an attribute like any other. If it was
in the document you loaded, it will be there when you serialize it. Nothing
special going on here.

> How do I access this information, and how do I create an element and
> specify that it is of the derived type?

Add an xsi:type attribute to the element.

> I currently use CoreDocImp.createElementNS to create elements, but I
> can find no other method to set the elements type.

Type information is available from the DOM if you've validated it. Take a
look at TypeInfo [1] and Xerces' PSVI DOM [2].

> Thanks - Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
> For additional commands, e-mail: j-users-h...@xerces.apache.org

Thanks.

[1]
http://xerces.apache.org/xerces2-j/javadocs/api/org/w3c/dom/TypeInfo.html
[2] http://xerces.apache.org/xerces2-j/faq-xs.html#faq-6

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org

Reply via email to