[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

how to differentiate between same nodes with diferent

Subject: how to differentiate between same nodes with diferent structure
From: "Ana Yndurain" <yndu@xxxxxxxxxxxx>
Date: Fri, 22 Jul 2005 11:35:07 +0200
nodes in a structure
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.