Hi
First, appologies if my question is trivial! I am not a programmer, but i need to be able to display the results of my research.
I have some marked-up texts stored in xml. The texts are marked up with sentence boundaries and wordclass, e.g.:
Code:
<sentence>
<word type="noun" string="Peter"/>
<word type="verb" string="bought"/>
<word type="determiner" string="a"/>
<word type="adjective" string="new"/>
<word type="noun" string="computer"/>
<word type="preposition" string="with"/>
<word type="determiner" string="the"/>
<word type="noun" string="money"/>
<word type="pronoun" string="he"/>
<word type="verb" string="got"/>
<word type="adverb" string="yesterday"/>
</sentence>
Now, i want to be able to display the text as running text without the wordclass info, but with the possibilty to choose to highlight all words belonging to one or more chosen wordclasses - this choice should be made by checking a checkbox.
Below is a (obviously) non-working solution. My question is: How can i achieve what i wish to do? If not, any other suggestion is more than welcome!
Code:
<form name="FormDebitor" action="#">
<input type="checkbox" name="type" value="noun"/>Noun
<input type="checkbox" name="type" value="verb"/>Verb
<input type="checkbox" name="type" value="adjective"/>Adjective
</form>
<xsl:for-each select="sentence/word">
<xsl:choose>
<xsl:when test="[her goes test to check wheter current @type is checked above]">
<SPAN style="BACKGROUND-COLOR: yellow">
<xsl:value-of select="@string"/>
</SPAN>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
Thanks in advance!
/Pete