Monday 15 September 2014

xpath accessing information in nodes -


I need to scrape the information in a website contains details of property

  , & lt; Span class = "location" & gt; Candy & lt; / Span & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "etr polar" & gt; & Lt; Span class = "data" & gt; Rupee. 3,600,000 & lt; / Span & gt; & Lt; / Div & gt;   

What is xpath notation for "candy" and "Rs.3,600,000"?

to find text nodes directly using text The specifics of an XML document are not intelligent.

Instead, addressing an element node directly connects all valuable text nodes as element values, which is what people generally want (and think they receive when receiving the text Are nodes).

A pilot example I use in class: XML of OCRAD content:

   cost , but the value of the XPE address in XSLT 1.0 is  cost / text (  

) is "39" which is not complete. In XSLT 2.0 (which is how the question is tagged), you get two text nodes "39" and ".22", if you add them, then it looks correct. But, if you need them to have a singleton argument, you will get a run-time error when you address an element, the returned text is added to a string, which is suitable for the singleton argument is.

I tell the students that in my professional work only a lot (too!) Some

then // span [@ class = 'location' or @ class = '' To use the 'data'] I have to use text () any time. will find two fields if they were such elements in the entire document. You may need to use ".//span" from a location inside the document tree.

No comments:

Post a Comment