Re: [xml] XPath from a specific node instead of document root



I'd like to execute three statements here. The first one would get me
spans' who's class is s1:

        /xhtml:html/xhtml:body/xhtml:div/xhtml:span[ class='s1']

That works as expected.

After that, I start having problems. I would then like to get the text
values for as' who's classes are l1 and l2:

        /xhtml:span/xhtml:a[ class='l1']/text()
        /xhtml:span/xhtml:a[ class='l2']/text()

Just wanted to post a follow up. I figured out what I was doing wrong.
For the additional queries I was already in the /xhtml:span nodes, so
all I needed to do was omit the /xhtml:span/

         xhtml:a[ class='l1']/text()
         xhtml:a[ class='l2']/text()

now works like a charm.

Now to figure out why I can't get xmlSaveToFilename() to indent...

-- Jason



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]