Subject: [xsl] how to differentiate between same nodes with diferent structure From: "Ana Yndurain" <yndu@xxxxxxxxxxxx> Date: Fri, 22 Jul 2005 11:35:07 +0200 |
Hi! In the same XML I have nodes of two different kinds: 1) The structure is Metric/Values/Value <Metric id = "NSM" description ="Number of Static Methods"> <Values per = "type" total = "20" avg = "0,278" stddev = "0,961" max = "7"> <Value name="aa" source ="a.java" package ="es.m.p.bu.dao" value ="0"/> <Value name="bb" source ="b.java" package ="es.m.p.ma.psp" value ="0"/> <Value name="cc" source ="c.java" package ="es.m.p.ma.tr" value ="0"/> <Value name="dd" source ="d.java" package ="es.m.p.ma.tr" value ="0"/> </Values> </Metric> 2) The structure is Metric/Value <Metric id = "TLOC" description ="Total Lines of Code" max ="-1"> <Value value="5039"/> </Metric> And I want to do different things with them (in case one I want to show a list, and in case two only the value). I try to use a <xsl:choose> <xsl:when test="">show my list</xsl:when> <xsl:otherwise>show de value</xsl:otherwise> </xsl:choose> Statement, but I don't know how can I test if my node is of kind one or two. I've read that you can test if a group of nodes is empty, but I don't know how. Consider that I'm using the namespace m to accede to the nodes <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://metrics.sourceforge.net/2003/Metrics-First-Flat"> Thanks a lot! Ana
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: RE: [xsl] how don't show the co, Ana Yndurain | Thread | RE: [xsl] how to differentiate betw, Angel Gavin |
[xsl] how don't show the content of, Ana Yndurain | Date | RE: [xsl] how to differentiate betw, Angel Gavin |
Month |