XSLT: Problem with WML the card title

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Flyzone

    XSLT: Problem with WML the card title

    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:app ly-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>

  • Flyzone

    #2
    Re: XSLT: Problem with WML the card title

    On Sun, 23 Jan 2005 13:11:17 +0100, Flyzone <flyzone@techno logist.com>
    wrote:
    [color=blue]
    >How can i solve this?[/color]

    I found the solution by myself... it was a simple {title}
    :-/


    Comment

    • Martin Honnen

      #3
      Re: XSLT: Problem with WML the card title



      Flyzone wrote:

      [color=blue]
      > 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:app ly-templates select="//title"/>">
      > cause the tag will be bad-formed.[/color]

      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.

      --

      Martin Honnen

      Comment

      Working...