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

Filtering: help

Subject: Filtering: help
From: Bovone Stefano <Stefano.Bovone@xxxxxxxx>
Date: Fri, 8 Jan 1999 09:04:21 +0100
insert.pl
Title: Filtering: help

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.

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.