jeorg
11-22-2002, 04:40 PM
I have a xml file
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml:stylesheet type="text/xsl" href="faqs.xsl" ?>
<faqs>
<faq>
<question>why 1 ?</question>
<answer>because 1</answer>
<answer>because 2</answer>
</faq>
<faq>
<question>why 1 ?</question>
<answer>because 3</answer>
<answer>because 4</answer>
</faq>
</faqs>
a xsl file
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<xsl:for-each select="faqs/faq">
<h2 class='title'>
<xsl:value-of select="question"/>
</h2>
<p class='Para'>
<xsl:value-of select="answer"/>
</p>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
but I get only
the first answer
in that case :
why 1 ?
because 1
why 2 ?
because 3
how can I get all the answer ?
thank you
(Edited by mod to clarify separate files)
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml:stylesheet type="text/xsl" href="faqs.xsl" ?>
<faqs>
<faq>
<question>why 1 ?</question>
<answer>because 1</answer>
<answer>because 2</answer>
</faq>
<faq>
<question>why 1 ?</question>
<answer>because 3</answer>
<answer>because 4</answer>
</faq>
</faqs>
a xsl file
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<xsl:for-each select="faqs/faq">
<h2 class='title'>
<xsl:value-of select="question"/>
</h2>
<p class='Para'>
<xsl:value-of select="answer"/>
</p>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
but I get only
the first answer
in that case :
why 1 ?
because 1
why 2 ?
because 3
how can I get all the answer ?
thank you
(Edited by mod to clarify separate files)