in reply to Re: Parsing XML output from `qstat`
in thread Parsing XML output from `qstat`

I've fixed the problem, and it didn't have to do with XML::Smart. After running your code and it working for the entire output of qstat, I investigated further as to why. LibXML requires the user to have the XML in a file before it can parse it, so I switched the $qstat variable in my original example to reading the output from a file. Once I did that, XML::Smart worked perfectly. Thanks for the code, though; I may have to switch to LibXML! It does get a bit messy compared to XML::Smart, though.

Replies are listed 'Best First'.
Re^3: Parsing XML output from `qstat`
by Anonymous Monk on May 05, 2014 at 23:29 UTC

    so I switched the $qstat variable in my original example to reading the output from a file. Once I did that, XML::Smart worked perfectly

    Now that is a sign of quality :) like kcott I cannot reproduce that ... string or filename XML::Smart spits out 1

    It does get a bit messy compared to XML::Smart, though.

    What does that mean?

    DOM is the standard , used across all programming languages everywhere...

    If I'm chosing nonstandard I'm going with XML::Twig or XML::Rules

      Okay, I'll check out XML::Twig; looks cool! I did find the actual root of the problem, though: on the line where I get the output from qstat, I do:  $qstat = `qstat -u \* -ext -xml -s r -F`; That backslash in the command is getting escaped and not being sent to the operating system, so the command wasn't even outputting anything. *doh*