[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Help with mode

Subject: Help with mode
From: "Meenakshi Nanjundeswar" <meenananju@xxxxxxxxxxx>
Date: Thu, 19 Oct 2006 15:35:58 -0500
 Help with mode
Hi:

I can best explain my problem with an example.

XML file:

<step1>
  <note>
     <para>Some text</para>
   </note>
<text><para>Txt</para></text>
<note><para>Second note</para></note>
<step2>
   <note>
      <para>Some other text</para>
   </note>
<text>para>Txt2</para></text>
</step2>
</step1>

Now, step 1 is an element which is formatted with numbering 1. step 2 is formatted with numbering A. There can be 7 levels of steps like this.
The issue I am facing is when I have a note element directly as a child of step1 , step2 ....step7, The number and the NOTE overlap like.
So instead of:


NOTE: Some text
1.Txt
  NOTE:Second note
NOTE:Some Other text
2.Txt2

the number 1. and N of NOTE overlap. To overcome this, under template for step1,step2..step7 I checked said:

<xsl:template match="step1">
<xsl:if test="child::note><xsl:apply-templates select="note" mode="step1"/>
<code for....formatting for step1...>
</xsl:template>

<xsl:template match="step2">
<xsl:if test="child::note><xsl:apply-templates select="note" mode="step1"/>
<code for....formatting for step1...>
</xsl:template>

Under the template for "note",
<xsl:template match="note">
<xsl:choose>
<xsl:when test="parent:step1|step2|step3"></xsl:when>
<xsl:otherwise><!-- formatting for note element--></xsl:otherwise>
</xsl:choose>
</xsl:template>

So, if the parent element is step1 , step 2,...step7 then dont do anything, otherwise format it.

This code is not working for step 2 onwards. the number and letter 'N' of note are overlapping.

What is wrong with this code?
Thank you for your help.

_________________________________________________________________
Stay in touch with old friends and meet new ones with Windows Live Spaces http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.