Altova Mailing List Archives

Re: [xsl] Automatically generate xpath

From: "Liron" <magilam@---------------->
Date: 1/30/2006 11:52:00 PM
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 

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

----- 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



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:


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.