Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Help needed with transition

From: "Hvid Hat" <hvid.hat@--------------.--->
To: NULL
Date: 11/18/2008 11:17:00 PM
I'm getting closer but still no cigar :-(

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/">
  <xsl:apply-templates select="//heading" />
</xsl:template>
  <xsl:template match="heading">
    <fieldset>
      <legend>
        <xsl:value-of select="."/>
      </legend>
      <!-- Only text elements following above heading -->
      <xsl:apply-templates select="//text" />
    </fieldset>
  </xsl:template>
  <xsl:template match="text">
    <p>
      <xsl:value-of select="."/>
    </p>
  </xsl:template>
</xsl:stylesheet>

Where my comment is in the XSLT above I need help. I've looked at
following-sibling which could be what I need but I can't figure out how...
anyone?



On 18-11-2008 22:40:30, "Hvid Hat" wrote:
> Hi
> 
> Can anyone help me with the following transition? My problem is how to
> create a fieldset each time I run into a heading and then include the
> following text elements within the fieldset.
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <field>
> <heading>First heading</heading>
> </field>
> <field>
> <text>Lorem</text>
> </field>
> <field>
> <text>Ipsum</text>
> </field>
> <field>
> <heading>Second heading</heading>
> </field>
> <field>
> <text>Dolor</text>
> </field>
> <field>
> <text>Sit</text>
> </field>
> <field>
> <heading>Third heading</heading>
> </field>
> <field>
> <text>Amet</text>
> </field>
> 
> To
> 
> <fieldset>
> <legend>First heading</legend>
> <p>Lorem</p>
> <p>Ipsum</p>
> </fieldset>
> <fieldset>
> <legend>Second heading</legend>
> <p>Dolor</p>
> <p>Sit</p>
> </fieldset>
> <fieldset>
> <legend>Third heading</legend>
> <p>Amet</p>
> </fieldset>



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent