Do you have a question? Post it now! No Registration Necessary. Now with pictures!
May 13, 2009, 10:57 am
rate this thread
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
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
------------------- ----- ---- -- -
Re: XML::DOM and ID/IDREF?
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
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.