Re: XML development

"John Bruce" <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
Hi Gino,

I think the problem is that SaxBuilder does not take string input. You
need to wrap it in a StringReader instance eg

Document responseDoc = builder.build(new StringReader(data));

HTH,

John



On 12/7/06, Gino Pacitti <[email protected]> wrote:
> 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 = (String)this.request().formValueForKey("XmlMsg");
>     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
>
> _______________________________________________
> WebObjects-dev mailing list
> [email protected]
> http://www.omnigroup.com/mailman/listinfo/webobjects-dev
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.