You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by pr...@wipro.com on 2005/04/25 06:01:08 UTC

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 Mailadmin@wipro.com immediately
and destroy all copies of this message and any attachments.

Re: extracting comments from XML

Posted by "Ushakov, Sergey N" <us...@int.com.ru>.
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: praveen.maruvekere@wipro.com
To: xalan-c-users@xml.apache.org
Cc: xalan-dev@xml.apache.org
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
Mailadmin@wipro.com immediately
and destroy all copies of this message and any attachments.


Re: extracting comments from XML

Posted by "Ushakov, Sergey N" <us...@int.com.ru>.
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: praveen.maruvekere@wipro.com
To: xalan-c-users@xml.apache.org
Cc: xalan-dev@xml.apache.org
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
Mailadmin@wipro.com immediately
and destroy all copies of this message and any attachments.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org