| 
 
Subject: Re: [xsl] counting with position() From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx> Date: Tue, 05 Jan 2010 23:57:05 +0100  | 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://saxon.sf.net/" version="2.0" exclude-result-prefixes="saxon">
  <xsl:output
    method="xml"
    indent="yes"
    saxon:suppress-indentation="product"
    />  <xsl:template match="@* | *" priority="-1">
    <xsl:copy>
      <xsl:apply-templates select="@* | * | text()" mode="#current" />
    </xsl:copy>
  </xsl:template>My output must look like this:
<step1> <text> <para/> </text> <product>sample prod1</product> <product>sample prod2</product>
<step2 id="idlistitem_2_30"> <text> <para>Sample</para> </text> <product>sample prod11</product> <product>sample prod12</product> <product>sample prod13</product> <step3> <text> <para>Sample</para> </text> <product>sample prod14</product> </step3> <step3> <text> <para>Sample</para> </text> </step3> </step2> <step2 id="idlistitem_2_43"> <text> <para/> </text> <product>sample prod15</product> <product>sample prod16</product> <step3> <text> <para>Sample</para> </text> </step3> </step2> </step1>
On Tue, Jan 5, 2010 at 4:18 PM, Imsieke, Gerrit, le-tex <gerrit.imsieke@xxxxxxxxx> wrote:I only want to match sample prod1 and sample prod2 after <item> at level1.Please sketch the desired output to this input (as XML, not prose).
a kusa schrieb:So my input can look like this:
<level1> <item>Sample</item> <product>sample prod1</product> <product>sample prod2</product> <level2> <item>Sample</item> <product>sample prod11</product> <product>sample prod12</product> <product>sample prod13</product> <level3> <item>Sample</item> <product>sample prod14</product>
<item>Sample</item> </level3> <item>Sample</item> <product>sample prod15</product> <product>sample prod16</product> <item>Sample</item> <level3> <item>Sample</item> </level3> <product>sample prod17</product>
</level2> <level1>
-- Gerrit Imsieke Geschdftsf|hrer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke@xxxxxxxxx, http://www.le-tex.de
Registergericht / Commercial Register: Amtsgericht Leipzig Registernummer / Registration Number: HRB 24930
Geschdftsf|hrer: Gerrit Imsieke, Svea Jelonek, Thomas Schmidt, Dr. Reinhard Vvckler
| Current Thread | 
|---|
  | 
| <- Previous | Index | Next -> | 
|---|---|---|
| Re: [xsl] counting with position(), a kusa | Thread | RE: [xsl] Number of elements with a, J L | 
| Re: [xsl] Modern web site design wi, David Carlisle | Date | Re: [xsl] Modern web site design wi, Eric J. Bowman | 
| Month |