Re: [xsl] Automatically generate xpath

Subject: Re: [xsl] Automatically generate xpath
From: "Liron" <magilam@xxxxxxxxxxxxxxxx>
Date: Tue, 31 Jan 2006 00:41:23 +0100
Thank you for your replies (Jay and David so far)

You showed me how to use union for two xpaths but how would I remove a node from a xpath? If you look at my previous example lets say I want to select all text nodes besides the last one. But lets say that I already have a xpath that looks like this: /html/body/table/tr/td/font/a/b/text() which is something that my project generates according to a user selection (visually selects a range of nodes) and I want to use it with the exclusion of /html/body/table[2]/tr[2]/td/font/a[3]/b/text()
because the user later on decided he doesn't want that node in the output.
I don't want to create more complex expressions like /html/body/table/tr/td/font/a["exclude if parent table's count is 1 and tr's count is 1 and self's count is 2"]/b/text() because I might want later on to exclude more nodes or insert more nodes or even insert again the ones I already excluded, and lets assume that I even want to write a function that handles all this it would probably be inefficient.
How would I remove a node from the list with something simple like "not |"? "not" is boolean so that won't work but I need something simple that doesn't manipulate my original xpath.



Thank you Liron


----- Original Message ----- From: "David Carlisle" <davidc@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, January 30, 2006 11:44 PM
Subject: Re: [xsl] Automatically generate xpath




and get an output that looks something like:
But what rules do you want to apply?
If you just wanted to get an xpath that returned Text1 and Text2 you
could just take the union of your input paths, ie

(
/html/body/table[1]/tr[1]/td/font/a[1]/b/text()
|
/html/body/table[2]/tr[2]/td/font/a[3]/b/text()
)

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread