Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2016-05-29 08:28 GMT
Find Nodes?
    Voting Booth?