XSLT: Problem with WML the card title

F

Flyzone

Hi all,
i have a little problem.... in the XML i have a tag named "title",
where there is the text that i want to use for the title of the card
name in the resul WML. The problem is that i cant write
<card id="guest" title="<xsl:apply-templates select="//title"/>">
cause the tag will be bad-formed.

How can i solve this?

Thanks in advance,
Flyzone


Here the XSLT:
<xsl:template match="/guest">
<wml>
<card id="guest" title="Please Login">
<p><xsl:apply-templates select="//error"/></p>
</card>
</wml>
</xsl:template>

<xsl:template match="//title">
<xsl:value-of select="//title"/>
</xsl:template>




Here the XML:
<guest>
<title>Please Login</title>
<error>You'r not logged, please log </error>
<link>here</link>
</guest>
 
M

Martin Honnen

Flyzone wrote:

in the XML i have a tag named "title",
where there is the text that i want to use for the title of the card
name in the resul WML. The problem is that i cant write
<card id="guest" title="<xsl:apply-templates select="//title"/>">
cause the tag will be bad-formed.

You can use so called attribute value templates to create the value of
an attribute from an XPath expression e.g.
<card title="{//title}"
The curly brackets indicate that the value is taken by evaluating the
XPath expression inside of the brackets.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,235
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top