>
> Since GetLatestSchedulesExResponse' namespace doesn't have a numer
> (since its the default namespace), you have tell libxml what to call it.
>   You can also register the namespace with libxml, but the above
> approach is probably easiest.
>

Hi Charlie. I tried it but it doesn't work. Here is an irb session

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'libxml'
=> true
irb(main):003:0> doc = LibXML::XML::Document.file
("latest_schedule.xml")
=> <?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
        <soap:Body>
                <GetLatestSchedulesExResponse xmlns="http://www.ezitracker.com/
eziTrackerData/">
                        <GetLatestSchedulesExResult>&lt;ResultExDataset 
xmlns="http://
www.ezitracker.net/eziTrackerData/ResultExDataset.xsd"&gt;
  &lt;ResultSummary&gt;
    &lt;result&gt;OK&lt;/result&gt;
    &lt;lasterrtype&gt;None&lt;/lasterrtype&gt;
    &lt;lasterrtypevalue&gt;0&lt;/lasterrtypevalue&gt;
    &lt;errordesc /&gt;
    &lt;totalrows&gt;0&lt;/totalrows&gt;
    &lt;morerowsavailable&gt;False&lt;/morerowsavailable&gt;
  &lt;/ResultSummary&gt;
&lt;/ResultExDataset&gt;&lt;SchedulesDataset xmlns="http://
www.ezitracker.net/eziTrackerData/SchedulesDataset.xsd" /&gt;</
GetLatestSchedulesExResult>
                </GetLatestSchedulesExResponse>
        </soap:Body>
</soap:Envelope>

irb(main):004:0> nodes = doc.find('//ez:GetLatestSchedulesExResponse',
'ez' => 'http://www.ezitracker.com/eziTrackerData/')
=> #<LibXML::XML::XPath::Object:0xb7c3c17c>
irb(main):005:0> nodes.debug
Object is a Node Set :
Set contains 1 nodes:
1  ELEMENT GetLatestSchedulesExResponse
    default namespace href=http://www.ezitracker.com/eziTrackerData...
=> nil


As you can see it gives one node which is null.

I tried it in Hpricot like this at it worked.

doc = Hpricot::XML(xml)
p (doc/'GetLatestSchedulesExResponse').first.innerHTML

Obviously it's a namespace issue and hpricot doesn't care so much
about the namespace.

_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to