logo       

[libxml]: Can't find nodes using XPath, namespaces mess: msg#02408

ruby-talk

Subject: [libxml]: Can't find nodes using XPath, namespaces mess

Hi,

I am having problems accessing elements in the XML documents using
XPath. My xml document looks like that:

<?xml version="1.0" encoding="UTF-8"?>
<configuration-data
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";;
xsi:schemaLocation="urn:company:platform:foundation:configuration:defn:v1"
xmlns="urn:company:platform:foundation:configuration:defn:v1">
<attributeList>
<attribute name="siteid" validationRuleName="String" description="Site
id">
<tree name="siteid_hierarchy">
<treenode name="Root">
<treenode name="1" />
</treenode>
</tree>
</attribute>
</attributeList>
</configuration-data>


My XPath only works when I remove all the namespaces from the root node
but I do need to access it without modifying the xml.

I am using:
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-mswin32]
libxml-ruby (1.1.3)
--
Posted via http://www.ruby-forum.com/.

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise