Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by dHarry (Abbot)
on Apr 28, 2011 at 11:14 UTC ( [id://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.)

Cheers

Harry

  • 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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://901781]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-26 01:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found