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

Simple Letter - Trying to drop children after element

Subject: Simple Letter - Trying to drop children after element
From: Arthur Maloney <ArthurM@xxxxxxxxxx>
Date: Thu, 18 Aug 2005 13:46:37 +0100
simple paragraph for children
Hello xsl-list,

I can't figure out how to drop the child bullets after
a para. Other than that code works fine

I'm using
<xsl:template match="para">
<p><xsl:value-of select="."/>
? how to drop child bullets here ?
e.g. using <xsl:apply-templates select="//bullet"/>
drops all bullets for all paras after each para.
</p>
</xsl:template>

<xsl:template match="bullet">
<ul>
   <li><xsl:value-of select="."/></li>
</ul>
</xsl:template>

       --oooOooo--

  xml fragment

  <stdLetter>
     <para>paragraph one</para>
     <para>paragraph two</para>
        <bullet>p2 bullet one</bullet>
        <bullet>p2 bullet two</bullet>
     <para>paragraph three</para>
         <bullet>p3 bullet 1</bullet>
     <para>paragraph four</para>
     ...
  </stdLetter>



       --oooOooo--
       
Stylesheet in full as is, some bits in the artifacts library

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
   <!-- stdInstruction.xsl created 2005-07-26T14:41 -->
   <!--  Top level declarations -->
   <xsl:import href="libArtifacts.xsl"/>
   <xsl:output method="xml" indent="yes"/>
   
   <xsl:param  name="plainNameOne" select="''"/> 
   <xsl:param  name="formalNameOne" select="''"/>    
   <xsl:param  name="formalLastNameOne" select="''"/> 
   <xsl:param  name="addressLabelOne" select="''"/>       
   <xsl:param  name="plainNameTwo" select="''"/> 
   <xsl:param  name="formalNameTwo" select="''"/>    
   <xsl:param  name="formalLastNameTwo" select="''"/> 
   <xsl:param  name="addressLabelTwo" select="''"/>       
   <xsl:param  name="date" select ="'not dated'"/>
   <xsl:param  name="title" select ="''"/>   

   <xsl:template match="/">
      <xsl:element name="html">
         <xsl:element name="head">
            <title><xsl:value-of select="$title"/></title>
         </xsl:element>
         <xsl:element name="style">
         <xsl:text>@import url(../css/stdLetter.css);</xsl:text>
                </xsl:element>
         <body>
         <xsl:call-template name="logoAddress"/>
         <xsl:call-template name="addressee"/>
            <xsl:apply-templates select="/stdLetter/title"/>         
            <xsl:apply-templates select="/stdLetter/para"/>
            <xsl:apply-templates select="/stdLetter/signature"/>
         </body>
      </xsl:element>
   </xsl:template>
   
   <xsl:template name="addressee">
      <p><xsl:value-of select="$formalNameOne"/></p>
      <p><xsl:value-of select="$addressLabelOne"/></p>
        <p><xsl:value-of select="$date"/></p>
        <p><xsl:text>Dear </xsl:text><xsl:value-of select="$formalLastNameOne"/></p>
   </xsl:template>
   
  
   <xsl:template match="title">
        <h3><xsl:value-of select="."/></h3>
   </xsl:template>   
   
   <xsl:template match="para">
        <p><xsl:value-of select="."/></p>
   </xsl:template>   
 
   <xsl:template match="signature">
      <p><xsl:value-of select="."/></p>
   </xsl:template>
   
   <xsl:template match="bullet">
      <ul>
         <li><xsl:value-of select="."/></li>
      </ul>
    </xsl:template>
</xsl:stylesheet>


-- 
Best regards,
 Arthur                          mailto:ArthurM@xxxxxxxxxx

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.