i've a condition where the section element should be having both a num attribute and level can be any apart from level 2. like below.
<section level="sect2" num="1.">
<title>Flowchart—HKIAC Mediation</title>
</section>
<section level="sect3">
<title>Flowchart—HKIAC Mediation</title>
</section>
<section level="sect2">
<title>Flowchart—HKIAC Mediation</title>
</section>
and when i use the below xslt it is counting only the first xml with number attribute and leaving second and third. but i want to count both first and third leaving second.
i've used the below statement
<xsl:number count='section[@num]'/>
but i want something similar to below
<xsl:number count='section[@num] and section[@level!='sect2']'/>
Thanks
In my understanding its more:
Because: but i want to count both first and third leaving second. EDIT: Seems it should be fist and second What seems to be all section with "@level != 'sect2'" and all section with "@num".
Try this -
For your issue in the comment try this which means num attribute not present -
You mean you do not care if the level=sect2 then just remove that like this -
This will give you count where num attribute is not present and value of level is not sect2.