I am new to XPath. I have a html source of the webpage
http://london.craigslist.co.uk/com/1233708939.html
Now I want to extract the following data from the above page
Full Date
Email - just below the date
I also want to find the existence of the button "Reply to this post" on the page
http://sfbay.craigslist.org/sfc/w4w/1391399...
If I call SelectNodes on an XmlElement, and pass XPath query such as this:
XmlNodeList nodes = xmlElement.SelectNodes("//OtherNode");
The nodes list will be for all the OtherNode elements in the document not just the ones from xmlElement.
I seem to recall that this is by design, and for a good reason, but I can't remember what that g...
I read the DIY Intellisense article on code project, which was referenced from the Mimic Intellisense? question here on SO.
I wanna do something similar, DIY intellisense, but for XPath not C#.
The design approach used there makes sense to me: maintain a tree of terms, and when the "completion character" is pressed, in the case of C...
It has been years since I messed with XPath and need some guidance.
Here is the xml fragment:
<?xml version="1.0" encoding="utf-8"?>
<ConfigurationObject xmlns:i="http://www.w3.org/2001/XMLSchema-instance" z:Id="1" i:type="AlgorithmDataSourceConfiguration" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" xmlns="http://www....
I want to find a simple element (Name) in an XML :
<ZoneContentMapping>
<ZoneContent>
<ContentId>72503</ContentId>
<StorefrontZoneId>Name</StorefrontZoneId>
<Type>ContentZone</Type>
</ZoneContent>
</ZoneContentMapping>
I am doing :
XmlNodeList objNode =
objXML.SelectNodes("ZoneContentMapping/ZoneContent[Content...
I want to extract "Date: 2009-09-25, 1:54PM EDT" from this webpage
http://auburn.craigslist.org/sha/1392067187.html
But I don't understand how to write Xpath expressions for that.
Can anyone help me in that.
I am getting other fields also from this page.
...
say i have
html/body/span/div/p/h1/i/font
html/body/span/div/div/div/div/table/tr/p/h1
html/body/span/p/h1/b
html/body/span/div
how can i get the common ancestor? in this case span would be the common ancestor of "font, h1, b, div" would be "span"
...
</div>
apple
<br>
banana
<br/>
watermelon
<br>
orange
Assuming the above, how is it possible to use Xpath to grab each fruit ? Must use xpath of some sort.
should i use substring-after(following-sibling...) ?
EDIT: I am using Nokogiri parser.
...
im using nokogiri.
i need to get the common xpath ancestor of group of elements.
...
can anyone tell me if its possible to select only the divs 2a and 2b from this html fragment?
the problem is that the divs are not children of h4 element and so the xpath query should say like "get the divs that are between the h4='Two' and the h4 that is right after h4='Two'
note that i want the query to be dynamic and u tell her the st...
I need to create a cache using an XML file. Here's the method that I will be using. I want this method to return the id based on the key-product_name. So I want it to create a cache one time programmatically and then only if the key is not found then create a [new entry in the] cache. If everything looks okay the problem is getting the i...
iterate and get the values of ProductName and ProductId for each node. what is the xpath syntax. Please help
Here is the xml file:
<Products>
<Product>
<ProductName>PDPArch</ProductName>
<ProductId>57947</ProductId>
</Product>
<Product>
<ProductName>TYFTType</ProductName>
<ProductId>94384</P...
Assume that I have an Ecore-model containing a package and some classes that make reference to each other. If i create a "Dynamic Instance", Eclipse produces an XMI-file and I can instantiate some classes. Containment-relations are directly serialized to an XML-tree in the XMI (the children elements in the example). But if I instantiate ...
I have two files -- the first (data) is an XML document, and the second (queries) contains XPath queries I would like to run on the first document.
I would like to populate a combobox in WPF to the queries, so that it displays the names of the XPath queries. When the user selects an item in the combobox, it should populate a listbox wit...
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
...
I saw string-length on this website
http://www.xsltfunctions.com/xsl/fn%5Fstring-length.html
I think it's the xslt 2.0 syntax.
though, in xslt 1.0, i tried this:
<xsl:template match="/">
<xsl:value-of select="string-length(())" />
</xsl:template>
and i got an error. is there any function that i can use to convert () and pass i...
i have a bunch of xpaths
/html/body/div/a
/html/body/p
/html/body/h1/p/div/a
/html/body/div/div/div/div/a
/html/body/a
....
and so on....
i need to find the lowest common ancestor from the xpaths provided...
using nokogiri.
...
Hi there,
I have the following block of code that gets the name of the nodes down the tree, like this:
section/page/subPage
But I would like to be able to get it down to the following (just making it up):
section[@id='someId']/page/subPage[@user='UserA']/@title
I found the following code from one of these StackOverflow posts:
<xsl...
Hi all,
I have the below fragement of XML, notice that the Reference node holds a URI which links to the Id attribute of the Body node.
<Reference URI="#Body">
<SOAP-ENV:Body Id="Body" xmlns:SOAP-ENV="http://www.dingo.org">
<ns0:Add xmlns:ns0="http://www.moo.com">
<ns0:a>2</ns0:a>
<ns0:b>3</ns0:b>
</ns0:Ad...
I'm learning XSLT via "Beginning XSLT 2.0 From Novice to Professional". Following the source code from the book, I've tried to compile this in Visual Studio 2008 TS:
<xsl:template match="Program">
<div>
<p>
<xsl:if test="@flag">
<img src="{if (@flag = 'favorite') then 'favorite' else 'interest'}.gif"
al...