Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: xpath to select all the elements in XML with one exception only

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 2/7/2008 6:36:00 PM

khalil_mi@h... wrote:

> If the input xml is:
> <tag1>
> <tag2>
> .........  many elements here
> </tag2>
> <tag3>
> <tag4>  5</tag4>
> .........  many elements here
> </tag3>
> <tag3>
> <tag4>  >  7 </tag4>
> .........  many elements here
> </tag3>
> 
> ..... many tag3 elements here
> 
> </tag1>
> 
>  And I want to choose the tage3 whose tag4 is 7 then the desired
> output is:
> 
> <tag1>
> <tag2>
> .........  many elements here
> </tag2>
> <tag3>
> <tag4>  >  7 </tag4>
> .........  many elements here
> </tag3>
> </tag1>

XPath selects nodes in an existing documents, it does not change the 
document. Therefore if you select the root element 'tag1' in your 
example then it has all its children, you can't remove some of the 
children with XPath alone, you need XSLT for that.



-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/


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