Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts

    printing empty tags into javascript with XSLT

    So I'm using XSLT to generate javascript array-building functions. here's a snippet

    <xsl:for-each select="menu_item">
    addSubmenuItem("<xsl:value-of select="url"/>","<xsl:value-of select="link"/>","<xsl:value-of select="target"/>","<xsl:value-of select="alt"/>");
    </xsl:for-each>


    .. fine. But some of the <link/> tags have <br/> tags in them:

    <link>Variables from the<br/>sniffer script</link>

    I guess what I need to do is like "dump" the contents of link, rather than value-of, which is only returning the character data.

    Any ideas what I need here?

    <edit>I'll also say that i'm using "text" as the output method - which might mean I have to bascially string-replace the <> with entitities - but how do I do that?</edit>
    Last edited by brothercake; 12-31-2002 at 05:43 AM.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    nevermind, I've realised my approach is conceptually wrong ...

    ... multiple <link> elements ...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •