Subject: Re: [xsl] numbering questions and answers entries From: "Eric Bréchemier" <eric.brechemier@xxxxxxxxx> Date: Tue, 17 Apr 2007 14:33:39 +0200 |
(....)Hello, I am trying to transform a question and answer xml to html. My xml file looks like this:
and
I am trying to write a xslt stylesheet where i would label the questions
(...)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.
"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.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] numbering questions and answe, marvi vokopola | Thread | [xsl] Putting a line feed into XML , Yves Forkl |
RE: [xsl] Most meaningful design do, Michael Kay | Date | Re: [xsl] XSLT Dead?, Rashmi Rubdi |
Month |