IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  HREF in XSL

    Posted Mon April 15, 2002 04:27 PM

    Hello!

    I can’t properly get result into my Nokia emulator version 3.0 browser from my xsl stylesheet by using tag name: <xsl:attribute name=“href”>. Data from TAMINO are correct display in pretty table but I can’t make href attribute in my XSL file in order to ASP page displayed in NOKIA will good transform.

    Please help me!

    Regards
    Dariusz Baumann
    POLAND


    #API-Management
    #Tamino
    #webMethods


  • 2.  RE: HREF in XSL

    Posted Tue April 16, 2002 11:24 AM

    Hi

    How and where are you using the xsl:attribute tag ? You should have it immediately after the
    tag you are trying to add the attribute to.

    e.g.


    <xsl:attribute name=“href”> … etc.

    Regards,
    Muiris.


    #webMethods
    #API-Management
    #Tamino


  • 3.  RE: HREF in XSL

    Posted Tue April 16, 2002 12:31 PM

    Hello!

    Thanks Muiris for reply. Before you answered I got a idea. I used

    tag instead of tag, so that is why it was not worked.

    NOW, it worked! :slight_smile:

    Regards
    Dariusz Baumann
    POLAND


    #Tamino
    #webMethods
    #API-Management


  • 4.  RE: HREF in XSL

    Posted Wed April 17, 2002 12:05 PM

    To find out what you’re doing wrong, I’ll need to see your code, and to know a little bit more about the input and desired output of your transformation.

    Michael Kay


    #API-Management
    #Tamino
    #webMethods


  • 5.  RE: HREF in XSL

    Posted Wed April 17, 2002 12:24 PM

    Hello!

    My previous XSL was:
    --------------------------------
    <?xml version="1.0" ?>

    <xsl:stylesheet xmlns:xsl=“XSLT Namespace” version=“1.0”>
    <xsl:output omit-xml-declaration=“yes”/>

    <xsl:template match=“/”>









    <xsl:for-each select=“//mydatabase”>





    </xsl:for-each>
    Nr Name Address
    <xsl:value-of select=“nr”/> <xsl:value-of select=“name”/>


    <xsl:attribute name=“href”>find.asp?nr=<xsl:value-of select=“nr” />&address=<xsl:value-of select=“address” />
    </xsl:attribute>
    <xsl:value-of select=“address” />






    </xsl:template>

    </xsl:stylesheet>
    --------------------------------


    My corrected XSL is:

    --------------------------------
    <?xml version="1.0" ?>

    <xsl:stylesheet xmlns:xsl=“XSLT Namespace” version=“1.0”>
    <xsl:output omit-xml-declaration=“yes”/>

    <xsl:template match=“/”>









    <xsl:for-each select=“//mydatabase”>





    </xsl:for-each>
    Nr Name Address
    <xsl:value-of select=“nr”/> <xsl:value-of select=“name”/>

    <xsl:attribute name=“href”>find.asp?nr=<xsl:value-of select=“nr” />&address=<xsl:value-of select=“address” />
    </xsl:attribute>
    <xsl:value-of select=“address” />





    </xsl:template>

    </xsl:stylesheet>
    --------------------------------

    The one difference is tag instead of tag



    Regards
    Dariusz Baumann
    POLAND


    #webMethods
    #API-Management
    #Tamino


  • 6.  RE: HREF in XSL

    Posted Thu April 18, 2002 11:54 AM

    Thanks, it’s nice when a problem turns out to be that easy.

    I’m surprised your XSLT processor a(or rather, your XML parser) allows you to write


    <xsl:attribute name=“href”>find.asp?nr=<xsl:value-of select=“nr” />&address=<xsl:value-of select=“address” />
    </xsl:attribute>
    <xsl:value-of select=“address” />


    - the “&” should be escaped as “& a m p ;” (perhaps it was, but has been corrupted by the forum software?)

    I personally tend to write this kind of thing using attribute value templates:



    It’s just a bit shorter and easier to read (and therefore easier to spot mistakes).

    Michael Kay


    #webMethods
    #Tamino
    #API-Management


  • 7.  RE: HREF in XSL

    Posted Thu April 18, 2002 11:55 AM

    Yes, it appears that when you type “& a m p ;” into a forum message (without the spaces), it comes out as “&”.

    Michael Kay


    #Tamino
    #webMethods
    #API-Management


  • 8.  RE: HREF in XSL

    Posted Thu April 18, 2002 02:46 PM

    I personally tend to write this kind of thing using attribute value templates:



    It’s just a bit shorter and easier to read (and therefore easier to spot mistakes).

    Maybe … but it doesn’t work for me. I’ve changed my XSL like this (There are three letters: amp after character ampersand):


    <xsl:attribute name=“href”>find.asp?nr={<xsl:value-of select=“nr” />}&address=<xsl:value-of select=“address” />
    </xsl:attribute>
    <xsl:value-of select=“address” />


    It displayed error in NOKIA TOOLKIT 3.

    ----
    Ampersands

    Yes, it appears that when you type “& a m p ;” into a forum message (without the spaces), it comes out as “&”.


    You are right! :slight_smile:

    Regards
    Dariusz Baumann
    POLAND


    #Tamino
    #API-Management
    #webMethods