How to write a xpath to match all elements except a particular element

Posted by Unmesh Kondolikar on Stack Overflow See other posts from Stack Overflow or by Unmesh Kondolikar
Published on 2011-02-01T07:02:41Z Indexed on 2011/02/01 7:26 UTC
Read the original article Hit count: 131

Filed under:
|
|

I am writing an XSL transformation. I want to write a template which matches all the child elements of the document except one particular node. My xml looks like this -

<Document>
    <NodeA><\NodeA>

    <NodeB><\NodeB>

    <ServiceNode><\ServiceNode>

    <NodeX><\NodeX>
</Document>

I want to write a template that matches all nodes except ServiceNode i.e. NodeA to NodeX. How to write this Xpath to get -

<xsl:template match="ALL Nodex Except ServiceNode">

© Stack Overflow or respective owner

Related posts about Xml

Related posts about xslt