Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • RolandWolters 42 posts 63 karma points
    May 06, 2011 @ 15:44
    RolandWolters
    0

    XSLT code in xslt output?

    Oh god, it's friday afternoon, I've just updated some xslt scripts on some website and soemthing else suddenly fails.. figures.

    This piece of xslt:

    <img>

                <xsl:attribute name="src"><xsl:value-of select="umbraco.library:GetMedia($image, 'false')/data[@alias='umbracoFile']"/></xsl:attribute>    

                <xsl:attribute name="alt"><xsl:value-of select="$currentPage/data[@alias='flashTitleOne']" disable-output-escaping="yes"/></xsl:attribute>    

                <xsl:attribute name="title"><xsl:value-of select="$currentPage/data[@alias='flashTitleOne']" disable-output-escaping="yes"/></xsl:attribute>

                </img>

     

    Created this output:

    <img src="/media/246177/568x240 laaggeletterdheid en mediawijsheid op de kaart.jpg" alt="Educatieve programma's" title="Educatieve programma's" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" />

     

    Why are those xslt codes there?

  • RolandWolters 42 posts 63 karma points
    May 06, 2011 @ 15:45
    RolandWolters
    0

    oh it's an old Umbraco site, 4.0

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    May 06, 2011 @ 15:50
    Sebastiaan Janssen
    0

    This should fix it:L

    <img src="{umbraco.library:GetMedia($image, 'false')/data[@alias='umbracoFile']}" alt="{$currentPage/data[@alias='flashTitleOne']}" title="{$currentPage/data[@alias='flashTitleOne']}" />

    Although having xml namespaces in the img tag is not really harmful, the image still works right?

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    May 06, 2011 @ 15:51
    Sebastiaan Janssen
    0

    Ps. Maybe changing from xsl:output method="html" to method="xml" will work as well, not sure.

  • Peter Dijksterhuis 1442 posts 1722 karma points
    May 06, 2011 @ 15:52
    Peter Dijksterhuis
    1

    Roland,

    this behaviour is because you didn't include the profixes in the excluded-prefixes-list at the top of the xslt.

    Add the prefixes to the exclude-result-prefixes at the top and you should be good.

    Peter

  • Tom Fulton 2030 posts 4998 karma points c-trib
    May 06, 2011 @ 15:53
    Tom Fulton
    0

    Hi,

    I also saw a similar thread on this recently and an older one also:

    http://our.umbraco.org/forum/developers/xslt/19898-Wierd-Xslt-appending-xmlnsExsltExsltStrings=urnExsltExsltStrings?p=0
    http://our.umbraco.org/forum/developers/xslt/10900-Extra-attribute-%28xmlnsExsltExsltSets%29-inserted-in-XSLT-output

    Not sure if it's the same issue or not, perhaps those namespaces are missing from the exclude-results-prefixes attribute?

    -Tom

  • RolandWolters 42 posts 63 karma points
    May 06, 2011 @ 15:55
    RolandWolters
    0

    Ok, i'll try these things, but the strange thing is, that I didn't change the xslt script that is responsible for this. I changed another script that is active on another page, so I'm noit sure my work is the problem. Well, maybe the publiush did something.

     

    Have a look at this: http://www.probiblio.nl In the emoty area should be a flash object.... the object does exist on the server, I checked that.

  • RolandWolters 42 posts 63 karma points
    May 06, 2011 @ 16:03
    RolandWolters
    0

    oh, the exclude stuff is and was there:

     

    <?xml version="1.0" encoding="UTF-8"?>

    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>

    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

       xmlns:xs="http://www.w3.org/2001/XMLSchema"

       xmlns:fn="http://www.w3.org/2005/xpath-functions"

       xmlns:msxsl="urn:schemas-microsoft-com:xslt"

       xmlns:umbraco.library="urn:umbraco.library"

       xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath"

       exclude-result-prefixes="msxml msxsl umbraco.library Exslt.ExsltMath Exslt.ExsltSets">

  • RolandWolters 42 posts 63 karma points
    May 06, 2011 @ 16:34
    RolandWolters
    0

    Found it! There is an extra xslt script called by the flash that prepares the flash/slide data. In this script there was a call for a node but the node was.... deleted by the customer. Fixed it (well err going to do it now) by making the xslt check if the node is present before trying to read from it.

    Pfff... and they said I did it, and then someone said it's because of the xslt code in the html output....(well that should nog be there but does not cause problems)

    So, a few minutes work and then it's WEEKEND.

Please Sign in or register to post replies

Write your reply to:

Draft