xsl-list
[Top] [All Lists]

Re: [xsl] numbering questions and answers entries

2007-04-17 05:34:00
 Hi Marvi,

On 4/16/07, marvi vokopola <vmarvi(_at_)hotmail(_dot_)com> 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::*[(_at_)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 Bréchemier

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