 |
 |
 |
> 1) how to embed html tags in a XML which will be processed by XSL?
XSLT deals with elements (a parsed node tree) rather than tags, but you
just generate those nodes by putting the tags as literal result elements
in your stylesheet, they have to be well formed xml though, so <br>/>
not <br>
<xsl:template match="title">
<h1>....</h1>
...
will make an h1 element.
> 2) Counter inside of xsl:for-each
>
> With the xsl:choose tag inside of xsl:for-each tag, I need to count the number of nodes met the condition. How to set up the counter?
>
The number of nodes in the node set that xsl:for-each is iterating over
is available as the function last().
> 3) Flag inside of xsl:for-each
>
> With the xsl:if tag inside of xsl:for-each tag, I need to know whether
> a node met the condition by the end of the loop. How to set up the
> flag variable?
You don't need a variable just select the nodes that meet the condition
select="...[condition]"
if there are no nodes that meet the condition then the node set will be
empty and so test as false.
You seem to be thinking procedurally an thinking that the for-each will
be executed in a certain order, that isn't the case the code is executed
for each item selected but may be in any order, or in particular in
parallel. The results of each iteration are merged in a specified order
but that does not imply an execution order, so you can't make the
processing of one item in the sequence depend on the result of
processing a different one.
David
________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
|
 | 

|  |
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.
|  |
| |
 |
 |
 |