Hi Toby

I'll quickly give a status of XML Schema Data Types support, then in a
seperate mail I'll respond to your thoughts.

The current XML Schema Data Types support is built on top of Sun's XsdLib

http://www.sun.com/software/xml/developers/xsdlib/download.html

which currently has a few limitations. Kohsuke Kawaguchi is the author at
Sun and he's been very helpful during development and hopefully these issues
will be resolved soon.

There are currently a couple of issues over what standard Java objects
should map to which XML Schema Data Types. For example, should a
java.util.Calendar be returned for all date related fields? What about gYear
/ gMonth and gDuration and so on.

We're trying to get the JAXB and JAXM crowd together with the XSDLib people
to find out what the standard mappings should be. Once thats sorted out
hopefully version 2 of the XSDLib will come out which will solve many of the
current problems with XML Schema Data Type support.

What I want to be able to do is code things like:-

Number n = document.numberValueOf( "/order/amount" );
Number n = (Number) attribute.getData();
Number n = (Number) element.getData();

for all numerical types in an XML Schema document then different Number
implementations (Byte, Short, Integer, Long, BigDecimal, BigInteger and
others) could all be returned.

Probably for all dates and durations, Calendar will be the most applicable
since its timezone aware and works better with days of the month or months
of the year duractions. So a date like code would be

Element element = (Element) document.selectSingleNode(
"/order/invoiceDate" );
Calendar calendar = (Calendar) element.getData();
Date invoiceDate = calendar.getTime();

James

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 04, 2001 8:11 AM
Subject: [dom4j-user] Status of Schema support


> Hi everyone,
>
> I just wondering about a couple of things of Schema support in dom4j.
>
> First of all it seems that xsd:string is not supported. If I use
> SchemaBuilder with a existing schema that used xsd:string as a simple type
for an
> attribute I got a weired message :
>
> Warning: Couldn't find DataType for type: xsd:string attribute: Event
>
> As you can see that isn't a stack trace from an exception.  Here the code
> that I used:
>
>  public SchemaMapper(File file) throws Exception {
>     SAXReader reader = new SAXReader();
>     this.factory = SchemaDocumentFactory.getInstance();
>     reader.setDocumentFactory( this.factory);
>     this.schema = reader.read(file);
>     ((SchemaDocumentFactory)factory).loadSchema(this.schema);
>  }
>
> The schema builder reporst with the warning. Here is the a schema
snipplet:
>
> <xsd:element name="Message">
>   <xsd:attribute name="Event" type="xsd:string" />
> </xsd:element>
>
> Another question:
>
> How does dom4j handels ref attribute for groups, elements and attributes.
> new elements on heap or just references to them? I think this would safe
> memory. But I guess we need a method like  #isReferenced() and/o
> #resolveReference() that returns the source as an Elment instance. Any
further thought,
> comments, motivation ;-), ideas ?
>
> Bye and thx
>
> -toby
>
>
> --
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net
>
> GMX Tipp:
>
> Machen Sie Ihr Hobby zu Geld bei unserem Partner 1&1!
> http://profiseller.de/info/index.php3?ac=OM.PS.PS003K00596T0409a
>
>
> _______________________________________________
> dom4j-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dom4j-user
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

Reply via email to