in reply to Re^3: Processing Two XML Files in Parallel
in thread Processing Two XML Files in Parallel

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Re^4: Processing Two XML Files in Parallel

Replies are listed 'Best First'.
Re^5: Processing Two XML Files in Parallel
by runrig (Abbot) on Jul 22, 2011 at 23:38 UTC
    Perl interfaces to C libraries tend to be a bit verbose, and often have higher level wrappers for them. But XML::LibXML is well worth learning, giving you the full power of XPath, and isn't really all that cryptic.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^5: Processing Two XML Files in Parallel
by ikegami (Patriarch) on Jul 23, 2011 at 01:19 UTC

    Twice as long... what??

    So prove me wrong. Give us working code not twice as long.

    The only thing that's long in my code is the function names. I realise that words longer than 4 letters are hard for you, but DOM designers decided to use clear names like textContent.

    You solution is highly cryptic and you have to consult document

    HAHA, you're so dumb. I bet the one you had to look up in the docs is parse_file.

    • parse_file parses the file.
    • $root = documentElement gets the root element.
    • $node->textContent gets the node's text content.
    • $node->findnodes('elem') finds "elem" nodes under the current node.
    • $node->appendText appends text to the node.
    • toFile puts the XML in a file.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^5: Processing Two XML Files in Parallel
by ikegami (Patriarch) on Jul 23, 2011 at 01:20 UTC