Re: No match or what...

Subject: Re: No match or what...
From: "Dave Pawson" <dave.pawson@xxxxxxxxxx>
Date: Sun, 7 May 2000 19:57:48 +0100
David C explained what was happening, 
so to try it out I generated the following
to 'demonstrate' it.

xml:

<?xml version="1.0" ?>
<RDF>
 <channel>first block of text
  <title>(Contained block of text)</title>Second block of text</channel>
 </RDF>
    
xsl:
<?xml version="1.0" ?> 

 <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform";

>
     
     <xsl:output method="xml" indent="yes"/>
     
     
     <xsl:template match="/RDF">
    		 <xsl:apply-templates  />
         </xsl:template>
 
     <xsl:template match="channel">
===================================
Output from normalize-space(text()[1])
<xsl:value-of select="normalize-space(text()[1])"/>

Output from normalize-space(text()[2])
<xsl:value-of select="normalize-space(text()[2])"/>

====================================
Now output from value-of select= .
       <xsl:value-of select="."/>
===================================
Output from normalize-space(text())
<xsl:value-of select="normalize-space(text())"/>
===================================
Output from for-each select=text()
 <xsl:for-each select="text()">
  <xsl:value-of select="."/>
 </xsl:for-each>
</xsl:template>
 
</xsl:stylesheet>
      

Result:

<?xml version="1.0" encoding="utf-8"?>

 
===================================
Output from normalize-space(text()[1])
first block of text

Output from normalize-space(text()[2])
Second block of text

====================================
Now output from value-of select= .
       first block of text
  (Contained block of text)Second block of text
===================================
Output from normalize-space(text())
first block of text
===================================
Output from for-each select=text()
first block of text
  Second block of text
 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread