I missed the Schema comment.
How are you reading in the schema? Which Document class did you use?
It would help if you sent a snippet of code as to how you read in the XML Schema. My guess is that it ended up with the standard DocumentFactory.
DatatypeElement is extended from DefaultElement, so the instance you have apparently is not a DatatypeElement.
Check and make sure the read looks something like this:
SAXReader reader = new SAXReader();
reader.setDocumentFactory( DatatypeDocumentFactory.getInstance() );
Document doc = reader.read(xmlFile);
Try that. ;-)
Dave
Florian Georg wrote:
Hi, hmmm ... getData() just returns the same as getText().My problem is, that I only have a Document with elements containing a 'type'-attribute, which contains names of (simple) Schema datatypes (int,long,date,....) .. e.g. Element <field type="xsd:int">12345</field> should map to an java.lang.Integer(not String!) with the value 12345 - or throw an Exception if the mapping couldn't be performed. (think of a method like "Object mapElementToObject (Element element)") I thought dom4j would perhaps provide necessary mappers/wrappers to do the mapping in a simple manner.
--
+------------------------------------------------------------+
| David Lucas mailto:[EMAIL PROTECTED] |
| Lucas Software Engineering, Inc. (740) 964-6248 Voice |
| Unix,Java,C++,CORBA,XML,EJB (614) 668-4020 Mobile |
| Middleware,Frameworks (888) 866-4728 Fax/Msg |
+------------------------------------------------------------+
| GPS Location: 40.0150 deg Lat, -82.6378 deg Long |
| IMHC: "Jesus Christ is the way, the truth, and the life." |
| IMHC: "I know where I am; I know where I'm going." <>< |
+------------------------------------------------------------+
Notes: PGP Key Block=http://www.lse.com/~ddlucas/pgpblock.txt
IMHO="in my humble opinion" IMHC="in my humble conviction"
All trademarks above are those of their respective owners.
-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing your web site with SSL, click here to get a FREE TRIAL of a Thawte Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user