A
acolomitchi
Hi,
I'm battling this problem for some time now.
Assuming PlatformCatalogue is a class generated by AXIS, I'm circling
the following piece of code (on the idea that BeanDeserializer is a
org.xml.sax.helpers.DefaultHandler):
TypeDesc plCatTypeDesc=PlatformCatalogue.getTypeDesc();
BeanDeserializer deserializer=
new BeanDeserializer(PlatformCatalogue.class,
plCatTypeDesc.getXmlType(), plCatTypeDesc);
XMLReader reader;
PlatformCatalogue toUse=null;
try {
reader = XMLReaderFactory.createXMLReader();
reader.setContentHandler(deserializer);
reader.setErrorHandler(deserializer);
reader.setEntityResolver(deserializer);
reader.setDTDHandler(deserializer);
reader.parse("/home/colo/PlatformCatalogue.xml");
toUse=(PlatformCatalogue)deserializer.getValue();
} catch (SAXException e) {
e.printStackTrace();
}
catch (IOException ioe) {
ioe.printStackTrace();
}
I my mind, the above should work, but in reality it doesn't!!
No exception thrown, however the loaded PlatformCatalogue toUse
instance is empty (no inner elements are created/set). What's wrong
with it? The XML file does have a valid and non-empty content for the
<PlatformCatalogue> root tag (I validated the file against the
original schema).
It drives my crazy, I'll end totally bald!! Someone, please help!
Best regards and thanks in advance,
Adrian
I'm battling this problem for some time now.
Assuming PlatformCatalogue is a class generated by AXIS, I'm circling
the following piece of code (on the idea that BeanDeserializer is a
org.xml.sax.helpers.DefaultHandler):
TypeDesc plCatTypeDesc=PlatformCatalogue.getTypeDesc();
BeanDeserializer deserializer=
new BeanDeserializer(PlatformCatalogue.class,
plCatTypeDesc.getXmlType(), plCatTypeDesc);
XMLReader reader;
PlatformCatalogue toUse=null;
try {
reader = XMLReaderFactory.createXMLReader();
reader.setContentHandler(deserializer);
reader.setErrorHandler(deserializer);
reader.setEntityResolver(deserializer);
reader.setDTDHandler(deserializer);
reader.parse("/home/colo/PlatformCatalogue.xml");
toUse=(PlatformCatalogue)deserializer.getValue();
} catch (SAXException e) {
e.printStackTrace();
}
catch (IOException ioe) {
ioe.printStackTrace();
}
I my mind, the above should work, but in reality it doesn't!!
No exception thrown, however the loaded PlatformCatalogue toUse
instance is empty (no inner elements are created/set). What's wrong
with it? The XML file does have a valid and non-empty content for the
<PlatformCatalogue> root tag (I validated the file against the
original schema).
It drives my crazy, I'll end totally bald!! Someone, please help!
Best regards and thanks in advance,
Adrian