Skip to content
Prev 256021 / 398506 Next

Treatment of xml-stylesheet processing instructions in XML module

Hi Adam

To use XPath and getNodeSet on an XML document,
you will want to use xmlParse() and not xmlTreeParse()
to parse the XML content. So

t = xmlParse(I(a)) # or asText = TRUE
elem = getNodeSet(t, "/rss/channel/item")[[1]]

works fine.

You don't need to specify the root node, but rather the document
in getNodeSet.

Also, if you have the package loaded, you don't need the XML::
prefix before the function  names.

  HTH
    D.
On 4/6/11 11:32 AM, Adam Cooper wrote: