Rank: Newbie
Joined: 1/17/2008 Posts: 6
|
hi All, I want to made a loop from root node but don;t take comment node...how can i check whether particular node is comment or else.. suppose i have a xml .. <?xml version="1.0" encoding="UTF-8"?> <!-- <?xml-stylesheet type="text/xsl" href="MetricConfig.xslt"?> --> <!-- This source code (including its associated software) is owned by Altiris and is protected by United States and international intellectual property law, including copyright laws, patent laws, and treaty provisions. --> <config> <metrics> <metric type="COMMAND" name="Processor User Time% AIX" guid="{aeddddb7-43fb-49a1-8842-752eaf0d1f5d}"> <query> <Command> <CommandLine>LC_ALL=C /usr/bin/vmstat 1 2 | /usr/bin/awk '{if(!/^$|^System|^.*-/){print $0;}}'</CommandLine> </Command> <ParsingRules> <LineNumbersToParse>1,3</LineNumbersToParse> <Return> <Column name="us" type="float"></Column> </Return> </ParsingRules> </query> <datatype>Numeric</datatype> <interval>30000</interval> <timeout>5000</timeout> </metric> </metrics> </config>
i want to make a loop only from config but node() function takes comment also.. Please help me out..
|
Rank: Newbie
Joined: 1/17/2008 Posts: 6
|
Hi All, I have done this by some R&D. for checking whether a particular node is comment or having inner node i have used self::* key.As for exampl:--
<xsl:template match="@*|node()"> <xsl:if test="self::*"> code for processing </xsl:if> </xsl:template>
Thanx
|
Rank: Newbie
Joined: 1/23/2008 Posts: 1
|
Dhiraj Kumar wrote: <xsl:if test="self::*"> code for processing
other possible solution, which excludes comments, but processes al other nodes: <xsl:if test="not(self::comment())">
|