xsl-list
[Top] [All Lists]

Re: [xsl] Condition Based Count of Sections

2007-04-18 00:55:18
Hi,

You have not explicitly stated your required output (only given an
example), but it seems to me that you do not want count and level
attributes on the first sect1 child elements of a given chapter (nor
their subsequent children).

So it seems that you have two conditions (besides the one about have
paragraphs as child elements [p]), and you need to distinguish between
these two.
For all sect1[p] elements you will have to check to see if it is the
first sect1 element under that given paragraph <xsl:if
test="preceding-sibling::sect1">..</
If true, then you add the element and attributes as you already do.
If false, then the attributes must not be added (if I understand
correctly), and you should just do a deep copy: <xsl:copy-of
select="."/>

I hope I understand your requirements correctly, and would add that
explicitly stating your requirements, as well as giving an example,
makes it easier for people to help you.

Regards,
Ragulf Pickaxe :-)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--