Saturday, July 3, 2010

[android-developers] Re: Get all text (including encoded) from XML Text Node

I'm a little puzzled by this behavior. This is supposed to be
controlled by this:
http://developer.android.com/intl/de/reference/javax/xml/parsers/DocumentBuilderFactory.html#setExpandEntityReferences(boolean)
which is supposed to default to true.

On Jul 2, 8:06 pm, Julius Spencer <jul...@msa.co.nz> wrote:
> On closer inspection the index part I have misinterpreted - the whole string might be broken into parts eg.
> Text node j
> EntityReference node ó
> Text node bb
>
> Regards,
> Julius.
>
> ("on closer inspection zees are loafers")
>
> On 3/07/2010, at 2:47 PM, Julius Spencer wrote:
>
>
>
> > Hi,
>
> > Thank you for the reply.
>
> >> Something's not right. Although I have no experience with
> >> DocumentBuilder, (ask me a SAXParser question, please!)
> > I'm starting to think about converting it all to SAX!
>
> >> the API
> >> reference,http://developer.android.com/intl/de/reference/org/w3c/dom/EntityRefe...,
> >> appears to say that character references should be expanded. What HTML
> >> or XML processor, refered to in the API, are you using?
> > I'm not sure what these terms mean exactly so I may not be responding accurately.
>
> > I use the following to retrieve a response from the server:
>
> >            ResponseHandler<String> responseHandler = new BasicResponseHandler();
> >            String xmlResponse = httpClient.execute(getMethod, responseHandler);
>
> > (httpClient is from org.apache.http.client.HttpClient)
>
> > I then create a document using the following:
>
> >            DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
> >            Document doc = builder.parse(new ByteArrayInputStream(xmlResponse.getBytes()));
>
> > Regards.
> > Julius.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscribe@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment