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

Re: numbering questions and answers entries

Subject: Re: numbering questions and answers entries
From: "Eric Bréchemier" <eric.brechemier@xxxxxxxxx>
Date: Tue, 17 Apr 2007 14:33:39 +0200
Re:  numbering questions and answers entries
Hi Marvi,

On 4/16/07, marvi vokopola <vmarvi@xxxxxxxxxxx> wrote:
Hello,
I am trying to transform a question and answer xml to html. My xml file
looks like this:
(....)

I am trying to write a xslt stylesheet where i would label the questions
and
answers according to "defaultlabel" attribute, which values van be "qanda |
number | none". I am having a problem when trying to display  a number
label. I am using xslt 1.0, My xsl stylesheet looks like this:
(...)

<xsl:template match="question" name="question">
(...)
<xsl:choose>
(...)
<xsl:when test="ancestor::*[@defaultlabel='number']">

<!--<xsl:number value="position()" format="1."/>
<xsl:value-of select="par"/>-->

</xsl:when>
(...)
</xsl:choose>
(...)
</xsl:template>

(...)
<xsl:template match="qandaset">
(...)
<xsl:for-each select=".//qandaentry">
<xsl:for-each select="question">
<xsl:call-template name="question"/>
</xsl:for-each>
(...)
</xsl:for-each>

I did try several options but obviously i am doing something wrong.If
somebody could give a solution,it would be a great help.


I think that you may find the following FAQ item useful:


"position() shows wrong value"
http://www.dpawson.co.uk/xsl/sect2/N6099.html#d9172e70

However, in order to receive more relevant comments, you should
describe your expected output, your current results, and where lies
your difficulties. You could also find useful to try to reproduce the
issue with the smallest possible stylesheet, and posting this smaller
stylesheet instead would help people to understand your problem more
quickly.

Kind Regards,

Eric Brichemier

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.