I have an XML Schema element like this:
<xs:element type="xs:string" name="IsActive" minOccurs="0"> </xs:element>
I'm using dom4j XPath to evaluate the element.
It seems impossible to determine whether element is present in the XML document or if its value is simply "".
I want <IsActive> to be either, 1) "" 2) "anyvalue1" 3) "anyva...
sI have an XML file that looks like the following...
<a>
<b>
<version>1.0</version>
<c>
<Module>foo.EXE</Module>
</c>
<c>
<Module>bar.DLL</Module>
</c>
</b>
</a>
I have a COM DLL that uses MSXML2:IXMLDOMNode objects that call "selectNodes" something like...
CComPtr<MSXML2::IXMLDOMNodeList> oR...
Hey, I'd like to scrape some data from my blog using YQL:
SELECT * FROM html WHERE url="http://site.com/blog" AND xpath="//div[@class='post']"
How can I use different bits of xpath in my query? E.g. can I do something like:
SELECT * FROM html WHERE url="http://site.com/blog" AND xpath="//div[@class='post']" AND xpath ="//div[@class='...
I'm getting the following error, seemingly randomly when trying to extract a href links from a nokogiri doc.
Related code:
nokohtml = page.doc
nokohtml.xpath('//a/@href').each do |node|
...
Hi,
I am getting different results from the same xpath expression in nokogiri when using ruby and jruby,
In ruby the following xpath expression returns a node while in jruby it returns a nodeset:
parent = node.xpath("./ancestor::node()[name(.) = 'div' or name(.) = 'p'][1]")
Has anybody else noticed similar behaviour?
Thanks
Paul
...
Hi folks,
I am in a ANDROID project that use XPATH a lot. I followed the way in The Force Unleashed: XML+XPath On Android Using Dom4j And Jaxen. Everything's fine beside the performance. The XML file's big and read intensively. Following code consume 6 mins.
org.dom4j.Document MatrixXML = (new org.dom4j.io.SAXReader()).read(this.getRe...
I need to extract some data from malformed XML stored in an Oracle database. The XPath expressions would look like this: //image/type/text(). One take at a regular expression which would work in a similar fashion would be <image>.*?<type>(.+?)<\/type> (with appropriate flags for multiline matching).
Since Oracle does not support match g...
I'm trying to write a function that will get me the attribute of a set of XML nodes in a document using XPath with the TinyXPath library, but I cannot seem to figure it out. I find the documentation on TinyXPath is not very enlightening either. Can someone assist me?
std::string XMLDocument::GetXPathAttribute(const std::string& attrib...
Hi
I understand from various googling that it makes more sense to try to extract your data from XML using XPath than using DOM looping.
At the moment I have implemented my solution to use DOM, but the code is verbose, it feels untidy and unmaintainable, so I would like to switch to a cleaner XPath solution.
Lets say I have this structu...
Hello,
I am working on gather sports statistics for a personal hobby project. I found this site with all the info I need:file:///Users/JohnJNichols4/Desktop/view-source%20cluster.leaguestat.com%20download.php%20client_code=ahl&file_path=daily-report%20daily-report.html
Am I able to parse this site with xpath? I only have experience (...
I'm trying to access the methodName element of an XML document using XPATH in Cocoa via the NSXMLElement object.
This is the XML representation of element
<iq type='set'
from='[email protected]/jrpc-client'
to='[email protected]/jrpc-server'
id='rpc1'>
<query xmlns='jabber:iq:rpc'>
<methodCall>
<m...
Hi,
I want to parse an xml file using libxml2 and XPath
I have tried to look this up on the internet
but I can't find much about it.
Can anyone give me a sample code for parsing this xml:
<WebServiceResponse>
<status>OK</status>
<result>
<type>sample</type>
<name>Sample XML</name>
<locati...
I have a real simple question that I can't seem to find an answer to.
I want to compress two XPath statements (that are getting attribute values). I learned about the | operator, hearing how it returns node sets.
var getdata = xmldoc.evaluate
(
'/foo/bar[@world=\''+hello+'\']/child::*/attribute::name
|/foo/bar[@world=\''hello+'...
i.e. - i want to return a string "yellow" using something like xpath expression "//banana/@color" and the following example xml...
<fruits>
<kiwi color="green" texture="hairy"/>
<banana color="yellow" texture="waxy"/>
</fruits>
$fruits = simplexml_load_string(
'<fruits>
<kiwi color="green" texture="hairy"/>
<banana color="yellow" ...
I have some large XML files to load via SSIS, and need to get an ID value from the first line of files, in order to get a key value to append to the imported rows:
After this root element, there are many children (inidividual elements) which load fine. But when using an XML Task with an XPath query /sessions[1]/@accountId[1], it app...
Hello everybody,
Im using libxml2 on the iPhone with the nice Method: PerformXMLXPathQuery from Cocoa with Love. The problem is how to find out witch xml got sent without first parsing the whole document... I tried to use the @"/" query to retrieve the first element as written on the introduction of Cocoa with Love but unfortunately, th...