xsl-list
[Top] [All Lists]

Re: Automatically generate xpath

2006-01-30 16:41:23
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(_at_)nag(_dot_)co(_dot_)uk>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
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
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--