Re: [xsl] node's full content + some modifications in that

Subject: Re: [xsl] node's full content + some modifications in that
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Wed, 21 Jul 2004 10:56:59 -0700 (PDT)
Hi Thomas,
  Please try this XSL -

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:output method="html" indent="yes"/>
	
<xsl:template match="/">
  <html>
    <body>
      <table>
	<xsl:for-each select="catalog/cd">
	  <tr>
	    <td>
	      <xsl:apply-templates select="artist"/>
	    </td>
	  </tr>
	</xsl:for-each>
      </table>
    </body>
  </html>
</xsl:template>
	
<xsl:template match="artist">
  <xsl:apply-templates />
</xsl:template>
	
<xsl:template match="tab">
  <xsl:text>&#xA0;</xsl:text>
</xsl:template>
	
<xsl:template match="*[(name() != 'artist') and
(name() != 'tab')]">
   <xsl:element name="{name()}">
     <xsl:apply-templates />
   </xsl:element>
</xsl:template>	
	
</xsl:stylesheet>

Regards,
Mukul

--- Fvldinyi Tamas <ftomi@xxxxxxx> wrote:
> Hello Mukul,
> 
> Thanks for help!
> Can you help me in the case when the <tab/> is not
> the first child of
> <artist>?
> for example:
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <?xml-stylesheet type="text/xsl"
> href="cdcatalog.xsl"?>
> <catalog>
>  <cd>
>   <artist><b>Eros <tab/> </b>
> <i>Rama<strike>z<tab/>z</strike>otti</i></artist>
>  </cd>
> </catalog>
> 
> The other problem that I don't want to predefine
> what can be used beside
> <b>. I could write match="artist/node()" instead of
> match="b". But the
> bigger problem is the first, that's minor.
> 
> Thanks, Thomas
> 
> ----- Original Message ----- > Hi Thomas,
> >  This might help -
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> >
> > <xsl:template match="/">
> >   <html>
> >   <body>
> >     <table>
> >       <xsl:for-each select="catalog/cd">
> >         <tr>
> >           <td>
> >             <xsl:apply-templates select="artist"/>
> >           </td>
> >         </tr>
> >       </xsl:for-each>
> >     </table>
> >   </body>
> >   </html>
> > </xsl:template>
> >
> > <xsl:template match="artist">
> >   <xsl:apply-templates />
> > </xsl:template>
> >
> > <xsl:template match="tab">
> >   <xsl:text> </xsl:text>
> > </xsl:template>
> >
> > <xsl:template match="b">
> >   <xsl:copy-of select="." />
> > </xsl:template>
> >
> > </xsl:stylesheet>



	
		
__________________________________
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/

Current Thread