Re: Help With XML
Re: Help With XML
- Subject: Re: Help With XML
- From: "Daniele Corti" <email@hidden>
- Date: Thu, 7 Dec 2006 09:37:02 +0100
Hi Gino,
why don't you try to use the javax.xml.parsers package?
When you have the xml file in a string write it in a File object myXml, then do:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance
();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(myXml);
that should work!
bye,
Daniele
2006/12/6, Gino Pacitti <
email@hidden>:
Hi All
I am working with an SMS company that supplies a Base64 encoded image
as part of an XML form submitted to my app.
If I am off track please point me in the right direction.
I am having it sent to a Direct Action but I am not sure what type of
data type I should have...
It is being sent so - Standard XML document posted as a form in a
single field called XmlMsg
I need to process it so this is what I am doing:
public WOActionResults MMSAction(){
String data = ""> org.jdom.input.SAXBuilder builder = new org.jdom.input.SAXBuilder
(false);
Document responseDoc = builder.build(data);
Element response = responseDoc.getRootElement();
Element rootElement = response.getChild("bspostevent");
List xmlList = rootElement.getChildren("field");
But I think this is wrong as I get a file not found error on the
builder.build(data); part!
This is an excerpt from the XML DTD:
<!-- bspostevent is an XML language - Typical usage: <?xml
version="1.0"?> <bspostevent> <field name="MobileNumber"
type="string">+4477111222333</field> <field name="Text"
type="string">An SMS message body being handled</field> </
bspostevent>-->
Can anyone help to give me some direction as the the correct syntax
to be able to work with the elements...
Gino
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (
This email sent to email@hidden
--
Daniele Corti
AIM: S0CR4TE5
Messenger:
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden