in reply to Tokenizing XML

Might want to study XML::SAX::PurePerl. Actually, it might just be what you want entirely. {grin}

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^2: Tokenizing XML
by Skeeve (Parson) on Dec 26, 2005 at 19:51 UTC

    Not quite...

    As I need it inside a macro and I just want to locate elements etc. a pure perl parser is helpfule for analysing the source and maybe taking parts of it, but from a first glance at it, I think it's way too much.

    As a matter of fact, my "parser" need not choke on invalid xml. The macro will be used when editing XML and so the XML might well be invalid. I rely on other plugins of the editor to report invalidity. Unfortunately I have no idea (yet) how to utilize these other plugins (which already parse the xml) so I came up with my regex in order to find whatever the macro searches for.

    Nevertheless: Thanks for pointing me at the modul.


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e