>
> 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><ResultExDataset
xmlns="http://
www.ezitracker.net/eziTrackerData/ResultExDataset.xsd">
<ResultSummary>
<result>OK</result>
<lasterrtype>None</lasterrtype>
<lasterrtypevalue>0</lasterrtypevalue>
<errordesc />
<totalrows>0</totalrows>
<morerowsavailable>False</morerowsavailable>
</ResultSummary>
</ResultExDataset><SchedulesDataset xmlns="http://
www.ezitracker.net/eziTrackerData/SchedulesDataset.xsd" /></
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
[email protected]
http://rubyforge.org/mailman/listinfo/libxml-devel