looks good to me, but the doc provides no sample and i don't really
know pythonelement, any easy sample to get started?
say I got this following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay
PaymentService v1//EN"
                                "http://dtd.worldpay.com/
paymentService_v1.dtd">
<paymentService version="1.4" merchantCode="1234">
        <reply>
                <error code="5"><![CDATA[XML failed validation: Invalid payment
details : Card number must be at least 10 digits.:1212****]]>
                </error>
        </reply>
</paymentService>

and I want to get the error code which is 5 in this case? thanks.

On Jul 19, 1:41 am, Andrew Lunny <[email protected]> wrote:
> https://github.com/racker/node-elementtreehas worked quite well in my
> experience.
>
> One catch I've found is that absolute XPath expressions don't work, so
> instead of:
>
> xmlDoc.get("/paymentService/reply/error")
>
> would need to say
>
> xmlDoc._root.get("paymentService/reply/error")
>
> Other than that (which is probably an easy patch, but I think they want to
> maintain API compatibility with the python source library), it's been fine.
>
> Andrew
>
> On 18 July 2012 07:27, Angelo Chen <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > is there such xml parser exists? js based. my need is simple,
> > something like this in libxmljs:
>
> > xmlDoc = libxmljs.parseXmlString(xml)
> >   s = xmlDoc.get("/paymentService/reply/error")
>
> > problem with libxmljs is, difficult to get it installed, any ideas?
>
> > Thanks,
>
> > Angelo
>
> > --
> > Job Board:http://jobs.nodejs.org/
> > Posting guidelines:
> >https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> >http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to