Re: [xsl] Extracting a comment block

Subject: Re: [xsl] Extracting a comment block
From: Dimtre Novatchev <dnovatchev@xxxxxxxxx>
Date: Sat, 18 Sep 2004 20:54:32 +1000
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output omit-xml-declaration="yes" indent="yes"/>
  <xsl:template match="/">
      <xsl:copy-of select="Alias_Records/comment()"/>
  </xsl:template>
</xsl:stylesheet>

The result is:

<!-- ********************************************************* -->
<!-- Local SITE ID        : xxx                               -->
<!-- Local Release Version: lny0211i                          -->
<!-- NASD/NADR Version    : 31n0211r                          -->
<!-- Date                 : 09-02-2004 12:10:39               -->
<!-- *********************************************************- -->

Cheers,

Dimitre Novatchev


On Fri, 17 Sep 2004 13:45:22 -0700, Mila P. Mitra
<pmitra@xxxxxxxxxxxxxxxxx> wrote:
> 
> Hello,
>  First of all let me thank all the people who run this list and answer
> questions frequently for a great job.
> 
> Here is my question. Is there a way to use a stylesheet to extract a comment
> block as is and take it across to a new xml file?
> 
> The example below shows the 4 lines of comments within the ***** lines,
> which I want also printed in the new XML file exactly the way it is:
> 
> <?xml version="1.0"?>
> <Alias_Records xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:noNamespaceSchemaLocation="Alias.xsd">
> <!-- ********************************************************* -->
> <!-- Local SITE ID        : xxx                               -->
> <!-- Local Release Version: lny0211i                          -->
> <!-- NASD/NADR Version    : 31n0211r                          -->
> <!-- Date                 : 09-02-2004 12:10:39               -->
> <!-- *********************************************************- -->
>     <FixAlias>
>       <AliasAlphanumerics>SCB</AliasAlphanumerics>
>       <FixName>KSCB</FixName>
>     </FixAlias>
>     <AirportAlias>
>       <AliasAlphanumerics>YYZ</AliasAlphanumerics>
>       <AirportID>VYZX</AirportID>
>     </AirportAlias>
> </Alias_Records>
> 
> Thanks in advance,
> Mila Mitra
> 
> ---------------------------------------------
> Mila (Patralekha) Mitra
> pmitra@xxxxxxxxxxxxxxxxx
> NASA Ames, CA
> 
> --+------------------------------------------------------------------
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> --+--

Current Thread