in reply to Parse with XML::Simple: how to keep some tags "unparsed"?

if i understand you correctly you don't want to parse the <content>-tags because you want to save time.
then it would probably be better to use XML::Parser.
also have a look at http://perl-xml.sourceforge.net/ for FAQ and examples.
  • Comment on Re: Parse with XML::Simple: how to keep some tags "unparsed"?

Replies are listed 'Best First'.
Re^2: Parse with XML::Simple: how to keep some tags "unparsed"?
by dda (Friar) on Jul 01, 2004 at 10:34 UTC
    No, it is not a matter of time. I need to keep all XHTML contents of <content> tags in a single place, and do not parse it into perl data structures.

    --dda

      If you are embedding data that has >'s and <'s, then you prolly wanna use the CDATA directive/option/thing within your xml to denote, "this is data of the XML document, not part of the XML structure".

      If that's beyond your control, you can always create a SAX parser that does just what you want.

      Or you can write some XSLT that transforms the content nested data into what I described above.

      Bart: God, Schmod. I want my monkey-man.

        Or you can write some XSLT that transforms the content nested data into what I described above.

        Show the XSLT - you know what happens if you don't ;-):

        <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> <xsl:output cdata-section-elements="content"/> <xsl:template match="/"> <page> <xsl:attribute name="id"><xsl:value-of select="page/@id" / +> </xsl:attribute> <content> <xsl:apply-templates /> </content> </page> </xsl:template> </xsl:stylesheet>

        /J\