count - XSLT counting child nodes with a set of filter -


i want remove spaces normalize space() while counting nodes , use filter on those.

what want this:

<{namespace}:text>   <{namespace}:info>this text info node</{namespace}:info>   here text want find </{namespace}:text> 

i want count children {namespace}:text , want ignore {namespace}:info , [namespace}:otherelement , content of should ignored too. want result count 1 know there nodes have process, can call templates workwithcontent or workwithempty.

but of course want find other nodes don't fit filter.

it sounds want like

<xsl:template match="{namespace}:text">   <xsl:variable name="count"           select="count(child::node()[not(self::{namespace}:info)])" />   ... 

this count child nodes of <{namespace}:text>, including both text , element nodes, except <{namespace}:info> elements.

if that's not need, please clarify.

the child:: axis optional, makes more obvious xpath expression select.


Comments