Hello People,
I tried a few things but I have a problem that i can not solve... maybe
someone can advice me?
The problem is that I want to change the look of the text inside the P
element wich is contained in the Special element. The attribute should
say what way it has to be changed.
Ok.. what I can get to work is test file in xsl, for e..g I can change
the color of the text in the normal P element, also in the list.
Changing the Special/P element is something a cannot get working... :(
so in Pseudocode it would look like
IF Content-type= Italic THEN
make text Italic
ENDIF
IF Content-type= Bold Then
make text Bold
ENDIF
etc.....
ELSE
Just normal text
ENDIF
I have an XML file looking like this ( small part only)
<List Ordered="Yes">
<Li>
<Special Content-type="Italic">
<P>Introduction</P>
</Special>
<P> (this lesson). We consider the tools that we are going to
use in this course, write a small Java program and make it run. </P>
</Li>
and the following xsl file:
<xsl:for-each select="Li">
<xsl:if test="position()=1">
<xsl:text disable-output-escaping="yes"><ol
type="1"></xsl:text>
</xsl:if>
<li>
<xsl:value-of select="P"/>
</li>
<xsl:if test="position()=last()">
<xsl:text disable-output-escaping="yes"></ol></xsl:text>
</xsl:if>
<br/>
<br/>
</xsl:for-each>
</xsl:template>
<xsl:template match="P">
<xsl:if test="parent::Special">
<em><xsl:value-of select="."/></em>
</xsl:if>
</xsl:if>
<xsl:if test="not(parent::Special)">
<xsl:value-of select="."/>
</xsl:if>
</xsl:template>
Thanks,
Thomas,
Exchange Student (from Holland) in Thessalonniki, Greece :)
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!