XSLT: Problem with WML the card title

Discussion in 'XML' started by Flyzone, Jan 23, 2005.

  1. Flyzone

    Flyzone Guest

    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>
     
    Flyzone, Jan 23, 2005
    #1
    1. Advertising

  2. Flyzone

    Flyzone Guest

    On Sun, 23 Jan 2005 13:11:17 +0100, Flyzone <>
    wrote:

    >How can i solve this?


    I found the solution by myself... it was a simple {title}
    :-/
     
    Flyzone, Jan 23, 2005
    #2
    1. Advertising

  3. 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.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jan 23, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Klemt
    Replies:
    1
    Views:
    482
    Steve C. Orr, MCSD
    Aug 10, 2003
  2. Replies:
    0
    Views:
    562
  3. Replies:
    1
    Views:
    579
    David
    Apr 24, 2007
  4. soonic
    Replies:
    11
    Views:
    1,828
    soonic
    Jul 27, 2011
  5. milkyway

    DHTML simulating wml card

    milkyway, Feb 7, 2005, in forum: Javascript
    Replies:
    1
    Views:
    80
    Matthew Lock
    Feb 8, 2005
Loading...

Share This Page