Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Getting the parent when the child doesn't exist

From: Jeroen Mostert <jmostert@------.-->
To: NULL
Date: 3/3/2009 7:56:00 PM
Greg Collins wrote:
> I'm posting this to both the XSL and C# newsgroups because it spans both.
> 
> I have an XPath passed to me that starts at the root node and goes down 
> to a table row node. From this XPath I was grabbing the table node by 
> appending a "/.." to the end of the XPath.
> 
> While this technique works great when the row exists, if the row does 
> not exist, I can no longer identify the table node.
> 
I don't mean to be overly simplistic, but why don't you just use the XPath 
to navigate to the table node and then use the DOM (in an XPathNavigator, or 
whatever other guise) to conditionally navigate up? Do you have to stuff it 
in a single XPath expression?

Otherwise, yes, you'll probably have to get tricky actually semi-parsing the 
XPath -- whip out the standard and away you go. I'd reconsider the entire 
approach first, though.

-- 
J.


transparent
Print
Mail
Like It
Disclaimer
.

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 www.altova.com/list/index.html. 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.

.
.

transparent

transparent