xsl-list
[Top] [All Lists]

RE: output node-set

2005-04-01 11:59:02
Oh, I forgot to mention why it isn't working.

 <xsl:when test="'self::dig'">
 <xsl:copy-of select="dig[node()]"/>
 </xsl:when>

This converts the string 'self::dig' to a boolean, which is always true
because the string isn't empty. You meant test="self::dig". It then looks
for a child of the dig element called dig, and doesn't find one, so outputs
nothing.

Michael Kay
http://www.saxonica.com/
 

-----Original Message-----
From: 04083259(_at_)brookes(_dot_)ac(_dot_)uk 
[mailto:04083259(_at_)brookes(_dot_)ac(_dot_)uk] 
Sent: 01 April 2005 19:49
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] output node-set 

hi

i got the following xml database result from a privious transformation
which contains some  empty nodes :


<top>
   <dig></dig>
   <MTo><MTo>
   <dig></dig>
   <dig>06767</dig>
   <dig>3712</dig>
   <CCTo><CCTo>
   <dig></dig>
   <dig>40</dig>
   <dig>48</dig>
   <dig>120</dig>
   <nondig>-000</nondig>
   <nondig>87</nondig>
   <nondig>8768</nondig>
 </top>


and i am trying from the following template to transform the above
database to a form where we get red of all the empty <dig> 
elements only
but it has a problem which  i can not figure what was it




 <xsl:template match="path">
 <xsl:for-each select="*">
<xsl:choose>

 <xsl:when test="'self::dig'">
 <xsl:copy-of select="dig[node()]"/>
 </xsl:when>

<xsl:when test="'self::nondig'">
 <xsl:copy-of select="nondig[node()]""/>
 </xsl:when>

<xsl:when test="'self::CCTo'">
<CCTo />
  </xsl:when>


<xsl:when test="'self::MoTo'">
<MoToTo />
  </xsl:when>

</xsl:choose>

</xsl:for-each>

 </xsl:template>
 </xsl:stylesheet>



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>