http://www.perlmonks.org?node_id=407326


in reply to Re^2: Convert backslash to slash using XML parsing
in thread Convert backslash to slash using XML parsing

yea ok, that may be. but why XML?!?
if i wanted to be clean i would use HTML::Parser.
  • Comment on Re^3: Convert backslash to slash using XML parsing

Replies are listed 'Best First'.
Re^4: Convert backslash to slash using XML parsing
by j.goor (Acolyte) on Nov 12, 2004 at 10:34 UTC
    I proposed XML parsing because it would solve my problem on one hand and it is a nice way to solve a 'real world problem' on the other hand.
    Indeed using 'tr' would convert *all* '\', but I only want to convert *links*.
    HTML::Parser sounds usable. I'll take a look at it. In the mean time, don't hesitate to reply furthermore since I hope someone will give me a snippet of XML parsing.. :-) This would make a great start for me to get along

      Since the books are published in what would be valid HTML 4 if it had a document type declaration for each document, an XML parser unfortunately won't get you anywhere. XML parsers by definition function only on XML, not on tag soup.

      If you still want to go that way, maybe upgrading the documents to XHTML with tidy works.