W3C home > Mailing lists > Public > www-style@w3.org > January 1999

Filtering: help

From: Bovone Stefano <Stefano.Bovone@elsag.it>
Date: Fri, 8 Jan 1999 09:04:21 +0100
Message-ID: <D3D861161851D1118F8C0000F8D036306C9BB8@gspsvr.elsag.it>
To: "'XSL-List@mulberrytech.com'" <XSL-List@mulberrytech.com>, "'www-style@w3.org'" <www-style@w3.org>
Cc: "'XML-IT@ananas.usr.dsi.unimi.it'" <XML-IT@ananas.usr.dsi.unimi.it>
I have the following XML document:
 
<?xml version="1.0" encoding="UTF-8"?>
 
<document>
 
     <common>
       <text>First Line</text>
       <insert pl="1"/>
       <text>Second Line</text>
       <insert pl="2"/>
     </common>
 
     <particular>
        <insert_text num="1">First Insert</insert_text>
        <insert_text num="2">Second Insert</insert_text>
     </particular>
 
 </document>
 
and the following XSL:
 
 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
 
 <xsl:template match="/">
    <HTML>
    <BODY>
    <xsl:apply-templates select="/document/common/*"/>
    </BODY>
    </HTML>
 </xsl:template>
 
 <xsl:template match="text">
    <P>
    <xsl:apply-templates/>
    </P>
 </xsl:template>
 
 <xsl:template match="insert">
    <P>
    <xsl:value-of
         select="/document/particular/insert_text[@num='{./@pl}']"/>
    </P>
 </xsl:template>
 
 </xsl:stylesheet>
 
 The output isn't:
 
 <HTML>
 <BODY>
 <P>
 First Line
 </P>
 <P>
 First Insert
 </P>
 <P>
 Second Line
 </P>
 <P>
 Second Insert
 </P>
 </BODY>
 </HTML>
 
 but:
 
 <HTML>
 <BODY>
 <P>
 First Line
 </P>
 <P/>
 <P>
 Second Line
 </P>
 <P/>
 </BODY>
 </HTML>
 
 Is there a method to obtian the wanted HTML document ?

 Greetings, bye.
Received on Friday, 8 January 1999 03:05:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:58 GMT