Try this XSLT stylesheet:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:output
method="xml"
indent="yes"
/>
<!-- copy comments -->
<xsl:template match="comment()">
<xsl:copy />
</xsl:template>
<!-- suppress copying text -->
<xsl:template match="text()" />
</xsl:stylesheet>
Regards,
Sergey
----- Original Message -----
From: [EMAIL PROTECTED]
To: [email protected]
Cc: [email protected]
Sent: Monday, April 25, 2005 8:01 AM
Subject: extracting comments from XML
<PML>
<EC>
<TN>100-111-99<!-- UPDATE FROM "100-112-0039" --></TN>
<LVL1><!-- DELETE LVL1 -->
<AS>aaa</AS>
</LVL1>
<LV1>
<NU>AB/10<!-- UPDATE FROM "AB/11" --></NU>
</LV1>
<LV1><!-- DELETE LV1 -->
<EMP>101</EMP>
<DT>10012005</DT>
</LV1>
</EC>
</PML>
Considering the above XML file , I have to get only the comments such as
"<!-- UPDATE FROM "100-112-0039" -->" is this possible in Xalan or Xerces.
If yes do send me the code or atleast an algorithm.
Thanks in advance
-Praveen
Confidentiality Notice
The information contained in this electronic message and any attachments to
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or
[EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.