Hello, I am experimenting with the DatatypeDocumentFactory and its schema
support and noticed the following limitation: lack of support for the
xsi:type attribute on document instances. 

For example, it would be nice to be able to specify in an xml document
something like:

<mydoc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
        <intvalue xsi:type="int">1234</intvalue>
</mydoc>

Then, in dom4j be able to select the <intvalue> Node using the
DatatypeDocumentFactory and call its getData() method. At first glance I
thought it would be easy to handle this by subclassing the
DatatypeDocumentFactory, but it appears that elements are constructed
solely on there QName and not on any document instance type information.
This is also a problem if your schema declares an element to be abstract
and the document instance must choose the appropriate concrete type; e.g.

<address xsi:type="USAddress">...</address>
<address xsi:type="UKAddress">...</address>

I am rather new to dom4j so perhaps I missed something obvious in using
the DatatypeDocumentFactory.

P.S. At first glance it seems odd that QName is not an immutable
object. Calling setDocumentFactory on a QName feels wrong to me. But
again, this is coming from someone completely new to working with dom4j!

Cheers,

--mike


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - 
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink

_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to