Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] Use of xsl:number, ignoring some elements

From: "Marina Cuello" <cuello@-------------->
To:
Date: 8/3/2004 9:01:00 PM
Hi to all

I'm new to this list and I'm starting with a question, as it couldn't be any
other way ;)

I want to make the xsl:number to "ignore" some elements while counting, but
I don't have the way to know which the elements are so I can't put any
selection on the "count" attribute.

I've being looking for an answer to this problem but the only thing I've
found are empty threads on forums and ignored or "no can't do" answers on
lists. If you know a better way to achieve this, without xsl:number, I will
be glad if you tell me, even if it's just a little hint.

This is what I have. I'm working over the Tamino XML Server . The data in
the base is a real "monster" collection; I can't change the data structure
and I have to use the query-retrieving servlets that are available. The main
I have is one that retrieves a HUGE XML document with a section like this
one:

<family>
    <siblings>
        <channelId>ch1</channelId>
        <channelId>ch2</channelId>
    </siblings>
    <children>
        <channelId>ch3</channelId>
        <channelId>ch4</channelId>
        <channelId>ch5</channelId>
    </children>
</family>

The templates that handle this piece go like this:

<xsl:template match="family">
<!--    Some HTML formatting (blah blah)-->
     <xsl:apply-templates select=".//channelId"/>
<!--    Some HTML formatting (blah blah)-->
</xsl:template>

<xsl:template match="channelId">
     <xsl:variable name="myId" select="."/>
     <xsl:variable name="isA" select="name($canal/..)"/>
  <!-- take the entire "channel" from database -->
     <xsl:variable name="createQuery"
select="concat('retrieveCompleteChannel','?',channel=',$myId)"/>
  <xsl:variable name="show" select="document($createQuery)"/>

 <xsl:call-template name="listing">
  <!-- some formating params -->
  <xsl:with-param name="toList" select="$show//completeChannel"/>
  <xsl:with-param name="isA" select="$isA"/>
 </xsl:call-template>

</xsl:template>

<xsl:template name="listing">
 <!-- some formating params -->
 <xsl:param name="toList" select="$default//completeChannel"/>
 <xsl:param name="isA" select="string('none')"/>
 <xsl:if test='count($toList/published)>0'>
<!--    Some HTML formatting using isA -->
  <xsl:value-of select="$toList/desc"/> - <xsl:number/> <!-- show the
number -->
<!--    Some HTML formatting using isA -->
 </xsl:if>
</xsl:template>

The "listing" template is part of a library that's used everywhere on the
system. I can change it only if it can be used in the rest of the templates
(i.e. adding a param to indicate it's my template the one that's calling
it).
As an example output, let's say "ch1" and "ch3" complete channels has no
elements inside, I would like to see on my output the following:

  Channel 2 - 1
  Channel 4 - 2
  Channel 5 - 3

There is any way to achieve this, no matter it is with xsl:number or not?

Thanks in advance,

Marina Cuello

ps: If my Grammar makes the question difficult to understand, I will try to
clarify.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent