pramenjatjek
Programmer
Hi
I'm just starting with XML. I've created a file where I've placed all the paragraphs in <para> tags, but they're not all sequential. How can I refer to these paragraphs in the XSL page?
This is the xml:
<tocPage>
<moduleHeading>....</moduleHeading>
<overview>
<para>In this module .....</para>
<mainLink item="m9_01">
<name>Why undertake financial analysis?</name>
</mainLink>
<mainLink item="m9_02">
<name>Horizontal analysis of data</name>
</mainLink>
<para>To start....</para>
</overview>
</tocPage>
and this is the xsl:
...
<p class="moduleHdr"><xsl:value-of select="moduleHeading"/></p>
<p><xsl:value-of select="overview/para"/></p>
<table width="60%" border="0" background="{overview/images/tableBg/source}">
<xsl:for-each select="overview/mainLink">
<xsl:variable name="file_name">
<xsl:value-of select="@item"/>
</xsl:variable>
<tr>
<td width="2%" height="15"><img src="{$bulletS}" width="{$bulletW}" height="{$bulletH}" alt="{$bulletA}"/></td>
<td width="98%"><a href="{concat($file_name,'.htm')}" target="_top"><xsl:value-of select="name"/></a></td>
</tr>
</xsl:for-each>
</table>
<p><xsl:value-of select="overview/para"/></p>
....
How can I specify in my XSL document that the layout has to be the same, eg moduleHeading first, then the first paragraph, then the links, and only then the second paragraph? Surely I don't have to give each paragraph a unique name?
Thank you!
I'm just starting with XML. I've created a file where I've placed all the paragraphs in <para> tags, but they're not all sequential. How can I refer to these paragraphs in the XSL page?
This is the xml:
<tocPage>
<moduleHeading>....</moduleHeading>
<overview>
<para>In this module .....</para>
<mainLink item="m9_01">
<name>Why undertake financial analysis?</name>
</mainLink>
<mainLink item="m9_02">
<name>Horizontal analysis of data</name>
</mainLink>
<para>To start....</para>
</overview>
</tocPage>
and this is the xsl:
...
<p class="moduleHdr"><xsl:value-of select="moduleHeading"/></p>
<p><xsl:value-of select="overview/para"/></p>
<table width="60%" border="0" background="{overview/images/tableBg/source}">
<xsl:for-each select="overview/mainLink">
<xsl:variable name="file_name">
<xsl:value-of select="@item"/>
</xsl:variable>
<tr>
<td width="2%" height="15"><img src="{$bulletS}" width="{$bulletW}" height="{$bulletH}" alt="{$bulletA}"/></td>
<td width="98%"><a href="{concat($file_name,'.htm')}" target="_top"><xsl:value-of select="name"/></a></td>
</tr>
</xsl:for-each>
</table>
<p><xsl:value-of select="overview/para"/></p>
....
How can I specify in my XSL document that the layout has to be the same, eg moduleHeading first, then the first paragraph, then the links, and only then the second paragraph? Surely I don't have to give each paragraph a unique name?
Thank you!