On Sat, May 28, 2011 at 9:40 PM, Bing Li <lbl...@gmail.com> wrote:
> The XML is pretty simple.
>
>    <?xml version="1.0" encoding="UTF-8"?>
>    <addresses>
>        <road>Orange ST</road>
>        <apt>RM235</apt>
>    </addresses>
>
> The following code is use to extract the value of the road, "Orange ST". In
> Java, the XPath is the same, i.e., /addresses/road.

You're selecting the <road> node which happens to contain a text node
with the value you want. That Java and Cocoa return different strings
when asked isn't a bug because what a toString()/description returns
isn't in a spec.

If you want the text node, you should be selecting:

/addresses/road/text()
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to