Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I need to write a perl script that will extract details of a series
of items from a XML file, which is no problem, except, each item has
an attribute that references another element, using the ID and IDREF
datatypes of XML. I would like to extract details from the
referenced element as well.

I could do this just fine with XPath, however, the server the
scripts need to run on don't have support for it, and XML::DOM is my
only option.

My question is: Is there any functions to deal with ID/IDREF in
XML::DOM? I can't seem to find any provided function to do this.

I figure I'd ask here to be positive, before I go do it manually.


--------------------------------- --- -- -
Posted with NewsLeecher v4.0 Unofficial Forum Release #1
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -


mat wrote:

Quoted text here. Click to load it

Why can't you install XML::XPath on your server? XML::XPath is pure Perl, so you
don't need a compiler, and you can install it in your own directory (perldoc -q
module has an explanation on how to do this). XML::XPath depends on XML::Parser
which needs a compiler to install, but If you have XML::DOM then you already
have XML::Parser.

That said XML::XPath is not actively maintained, so instead you could also use
XML::DOM::XPath (but XML::DOM is not actively maintained either), XML::LibXML
(needs libxml2 to be installed) or XML::Twig (shameless plug), or a number or
better maintained modules.


Site Timeline