Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: XML::Twig and handles on regex/xpath

by dHarry (Abbot)
on Apr 28, 2011 at 11:14 UTC ( #901781=note: print w/replies, xml ) Need Help??

in reply to XML::Twig and handles on regex/xpath

As a general note on working with xpath: it pays off to use a decent XML editor. They support interactively constructing xpath expressions and validate them on the fly. You continuously see the results returned by the expression. In my experience this saves a lot of time debugging:) Before you use the expression in your script you have validated that it's correct. In your example it reports syntax errors e.g. 'XPath syntax error at char 25 in ... Unexpected token "<numeric literal>" after axis name'. While you could still argue that the message could be improved, it's better then the "unrecongnised expression in handler" message. I recommend you to take a look at oXygen or XMLspy. They can ease your "xml-life" considerably (try debugging a xslt!). (There are many free/open source XML editors available but IMHO none of them even comes close to the commercial ones.)



  • Comment on Re: XML::Twig and handles on regex/xpath

Replies are listed 'Best First'.
Re^2: XML::Twig and handles on regex/xpath
by Eythil (Acolyte) on Apr 28, 2011 at 11:27 UTC
    So far I've been using vim to look at my xml files.
    But I have to admit that it might not be the best tool to look at these files.

    I haven't looked at any plugins for it (if there are any) that would report syntax errors, but that might be a good idea.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://901781]
[marioroy]: I use the default and happens to be bash
[erix]: heh, I like the "Resolved" (Christiansen is really funny)
Discipulus is makita a reincarnation of grinder?
[erix]: I probably also need to understand TAP a bit better than I do
[Corion]: Discipulus: Hahaha ;)

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2017-03-23 08:33 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (285 votes). Check out past polls.