Re: Regular Expression for XML Parsing



On tushar.saxena@xxxxxxxxx wrote:
I have a set of XML files
I need to extract the DATA part of the xml structure
If I want to get both DATA1 and DATA2 I can use a simple regex like :

It's a bad idea in the first place. XML is not a regular language, why would
you use regular expressions to parse it?

Any help would be appreciated !

Use a tool that is designed to parse XML like e.g. any of the XML parser
modules on CPAN.

jue
.



Relevant Pages

  • Re: get data from xml
    ... like to get data from the following xml file by using regexp: ... XML is not a regular language, therefore using a tool that is by design ... trying got parse XML using REs is ...
    (comp.lang.perl.misc)
  • Re: Converting XML to Perl structures FAST
    ... I need to convert XML documents to Perl structures, very efficiently, ... looks like they parse XML into all kinds of strange things. ... Oh I thought your intention was to create data structures? ...
    (comp.lang.perl.misc)
  • Re: Converting XML to Perl structures FAST
    ... I need to convert XML documents to Perl structures, very efficiently, ... looks like they parse XML into all kinds of strange things. ... Oh I thought your intention was to create data structures? ...
    (comp.lang.perl.misc)
  • Re: Converting XML to Perl structures FAST
    ... I need to convert XML documents to Perl structures, very efficiently, ... looks like they parse XML into all kinds of strange things. ... Oh I thought your intention was to create data structures? ...
    (comp.lang.perl.misc)
  • Re: Parsing XML
    ... Epanda wrote: ... I would like to know if we can parse XML with regexp faster than with ... an MSXML or Xerces library? ...
    (perl.beginners)