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

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

Subject: Re: node's full content + some modifications in that
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Wed, 21 Jul 2004 05:35:44 -0700 (PDT)
eros ramazotti
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>&#xA0;</xsl:text>
</xsl:template>

<xsl:template match="b">
  <xsl:copy-of select="." />
</xsl:template>

</xsl:stylesheet>

Regards,
Mukul

--- Fvldinyi Tamas <ftomi@xxxxxxx> wrote:
> Hello,
> 
> I'm new in xslt.
> I have an xml such as
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <?xml-stylesheet type="text/xsl"
> href="cdcatalog.xsl"?>
> <catalog>
>  <cd>
>   <artist><b>Eros</b> <tab/> Ramazzotti</artist>
>  </cd>
> </catalog>
> 
> I want to write out the full content of the node
> artist, but also want some
> modificiation in that markup:
> I wanna write out <b>Eros</b>
>      Ramazotti. (convert
> <tab /> to some non-breaking space)
> I figured out that <xsl:copy-of> echo the full
> content of a node, but in
> this case, there is no way to do more modification
> in it, at least I don't
> know how to do it. So my current version writes out
> <b>Eros</b> <tab/>
> Ramazzotti.
> 
> Current xsl:
> <?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:copy-of select="artist"/>
>  </td>
>       </tr>
>       </xsl:for-each>
>     </table>
>   </body>
>   </html>
> </xsl:template>
> </xsl:stylesheet>
> 
> In the artist node, there could be more nodes such
> as <i> <strike>, or
> something totally differrent, and more special tags
> like <tab/> that I want
> to convert to non breaking spaces, or something
> else.
> 
> Can you point me what to do?
> 
> Thanks, Thomas



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

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.