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

Re: trying to create surrounding element

Subject: Re: trying to create surrounding element
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sun, 8 Jun 2008 22:38:31 +0100
Re:  trying to create surrounding element
<xsl:stylesheet  version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
<xsl:output indent="yes"/>

<xsl:template match="aaa">
 <xsl:for-each-group select="bbb" group-starting-with="bbb[ccc/ddd/@attribute='boxtype_start']">
  <box>
   <xsl:apply-templates select="current-group()"/>
  </box>
 </xsl:for-each-group>
</xsl:template>

<xsl:template match="bbb[ccc/ddd/@attribute='boxtype_start']">
   <xsl:comment select="eee"/>
</xsl:template>

<xsl:template match="bbb[ccc/ddd/@attribute='boxh1']">
   <title><xsl:value-of select="eee"/></title>
</xsl:template>

<xsl:template match="bbb[ccc/ddd/@attribute='boxh2']">
   <subtitle><xsl:value-of select="eee"/></subtitle>
</xsl:template>


<xsl:template match="bbb[ccc/ddd/@attribute='boxpara']">
   <para><xsl:value-of select="eee"/></para>
</xsl:template>

<xsl:template match="bbb[ccc/ddd/@attribute='boxtype_end']"/>

</xsl:stylesheet>




$ saxon9 box.xml box.xsl
<?xml version="1.0" encoding="UTF-8"?>
<box><!--box1_start--><title>1_boxtitle_h1</title>
   <subtitle>1_boxtitle_h2</subtitle>
   <para>boxpara</para>
</box>
<box><!--box2_start--><title>2_boxtitle_h1</title>
   <subtitle>2_boxtitle_h2</subtitle>
   <para>boxpara</para>
</box>

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

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.