#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    2
    Rep Power
    0

    I need help with changing hyperlink in xsl


    Can i have some guidence microsoft have amended the KB article location:

    I have a script that queries a pc / server and states the patches installed. It then creates a hyperlink to the kb article

    I just need to ammend the hyperlink location to direct from:

    support.microsoft.com\kb\kb article number

    to

    support.microsoft.com\kb\article number

    current code:

    <xsl:if test="computer/patches/patch">
    <h2 id="softwareplatform_patches">Installed Patches</h2>
    <table>
    <tr>
    <th>Patch ID</th>
    <th>Description</th>
    <th>Install Date</th>
    </tr>
    <xsl:for-each select ="/computer/patches/patch" >
    <tr>
    <td><a href="support.microsoft.com/kb/{@hotfixid}"><xsl:value-of select = "@hotfixid"/></a></td>
    <td><xsl:value-of select = "@description"/></td>
    <td><xsl:value-of select = "@installdate"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </xsl:if>

    New Code

    <xsl:if test="computer/patches/patch">
    <h2 id="softwareplatform_patches">Installed Patches</h2>
    <table>
    <tr>
    <th>Patch ID</th>
    <th>Description</th>
    <th>Install Date</th>
    </tr>
    <xsl:for-each select ="/computer/patches/patch" >
    <tr>
    <td><a href="support.microsoft.com\kb\{@hotfixid}"><xsl:value-of select = "@hotfixid"/><xsl:value-of select = "substring{@hotfixid, 3}"/></a></td>
    <td><xsl:value-of select = "@description"/></td>
    <td><xsl:value-of select = "@installdate"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </xsl:if>

    i think a substring will do it but i'm not sure where to put it or if it there is a better way.
    thanks for your help
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    2
    Rep Power
    0

    Solved


    I had a moment of insperation....

    New Code

    <xsl:if test="computer/patches/patch">
    <h2 id="softwareplatform_patches">Installed Patches</h2>
    <table>
    <tr>
    <th>Patch ID</th>
    <th>Description</th>
    <th>Install Date</th>
    </tr>
    <xsl:for-each select ="/computer/patches/patch" >
    <tr>
    <td><a href="support.microsoft.com/kb/{substring(@hotfixid, 3)}"><xsl:value-of select = "(@hotfixid)"/></a></td>
    <td><xsl:value-of select = "@description"/></td>
    <td><xsl:value-of select = "@installdate"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </xsl:if>

IMN logo majestic logo threadwatch logo seochat tools logo