xsl-list
[Top] [All Lists]

RE: how to get rid of tag names

2003-05-01 08:04:51
USe this xsl

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="/">
<ROWSET>
<xsl:for-each select="html/body/h">
<ROW>
   <HEADER>
     <xsl:value-of select="."/>
   </HEADER>
   <BODY>
   <xsl:value-of select="
       following-sibling::*[generate-id(following-sibling::html/body/h[1])=
        generate-id(current()/following-sibling::html/body/h[1])]"/>
   </BODY>
 </ROW>
</xsl:for-each>
</ROWSET>
</xsl:template> 
</xsl:stylesheet>

sundar

-----Original Message-----
From: Smirnov, Anatoliy 
[mailto:anatoliy(_dot_)smirnov(_at_)mail(_dot_)va(_dot_)gov]
Sent: Thursday, May 01, 2003 8:32 PM
To: 'XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com'
Subject: [xsl] how to get rid of tag names


Hello,
Sorry for such a dumb question but I am new here.

I need to get rid of tag names <p> and </p> in the result document.

<?xml version = '1.0'?>
<ROWSET>
  <ROW>
    <HEADER>
        header
    </HEADER>
    <BODY>
       <p>p line</p>
    </BODY>
  </ROW>
</ROWSET>

so instead of
       <p>p line</p>
I just need to have
       p line

I am getting this from this source

<html>
  <body>
    <h>header</h>
    <p>p line</p>
  </body>
</html>

running this xsl

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="/">
<ROWSET>
<xsl:for-each select="html/body/h">
<ROW>
   <HEADER>
     <xsl:value-of select="."/>
   </HEADER>
   <BODY>
   <xsl:copy-of select="
       following-sibling::*[generate-id(following-sibling::html/body/h[1])=
        generate-id(current()/following-sibling::html/body/h[1])]"/>
   </BODY>
 </ROW>
</xsl:for-each>
</ROWSET>
</xsl:template> 
</xsl:stylesheet>

Thank you.
Anatoliy Smirnov

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

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



<Prev in Thread] Current Thread [Next in Thread>