Copied to clipboard

Flag this post as spam?

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


  • Kate 267 posts 610 karma points
    Aug 01, 2013 @ 15:17
    Kate
    0

    I get an error when I write   in my xslt file

    Hi

    This is the error I get:

    System.Xml.XmlException: Reference to undeclared entity 'nbsp'. Line 83, position 39.
    
    at System.Xml.XmlTextReaderImpl.Throw(Exception e)
    at System.Xml.XmlTextReaderImpl.HandleGeneralEntityReference(String name, Boolean isInAttributeValue, Boolean pushFakeEntityIfNullResolver, Int32 entityStartLinePos)
    at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos)
    at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
    at System.Xml.XmlTextReaderImpl.ParseText()
    at System.Xml.XmlTextReaderImpl.ParseElementContent()
    at System.Xml.XmlTextReaderImpl.Read()
    at System.Xml.Xsl.Xslt.XsltInput.ReadElement()
    at System.Xml.Xsl.Xslt.XsltInput.ReadNextSibling()
    at System.Xml.Xsl.Xslt.XsltInput.MoveToNextSibling()
    at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags)
    at System.Xml.Xsl.Xslt.XsltLoader.LoadTemplate(NsDecl stylesheetNsList)
    at System.Xml.Xsl.Xslt.XsltLoader.LoadRealStylesheet()
    at System.Xml.Xsl.Xslt.XsltLoader.LoadDocument()
    at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)

    And this is part of my xslt:

    <xsl:template match="Sektion2" mode="output">
    <!-- Output for standard content --> Indhold til side 3
    <section id="{@urlName}">
    <div class="greyTransperentTop">&bsp;</div>
    <header>
    <h1><xsl:value-of select="@nodeName" /></h1>
    </header>
    <div class="text">
    <xsl:value-of select="bodyText" disable-output-escaping="yes" />
    </div>
    </section>
    </xsl:template>

    The problem is in this line:

     <div class="greyTransperentTop">&bsp;</div>

    Can anybody help me with that?

    /Kate

     

     

  • Gary 40 posts 129 karma points
    Aug 01, 2013 @ 16:23
    Gary
    0

    Hi Kate

    use   instead of &bsp;

    you were missing the n :)

    Gary

  • Gary 40 posts 129 karma points
    Aug 01, 2013 @ 16:24
    Gary
    0

    lol it didn't show in the comment put an 'n' before the 'b' :)

  • Kate 267 posts 610 karma points
    Aug 01, 2013 @ 22:00
    Kate
    0

    Sorry, it's me who has written wrong in this post.

    It does not work with &nbsp; either.

  • Dennis Aaen 4457 posts 17970 karma points admin hq c-trib
    Aug 01, 2013 @ 23:47
    Dennis Aaen
    0

    Hi Kate,

    Did you have this snippet in the top your XSLT file,

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:pdcalendar="urn:pdcalendar" xmlns:google.maps="urn:google.maps"
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets pdcalendar google.maps ">

    <xsl:output method="xml" omit-xml-declaration="yes" />

    <xsl:param name="currentPage"/>

    Alternatively, you could try this &#160; and see if it makes any difference.

    /Dennis

  • Dennis Aaen 4457 posts 17970 karma points admin hq c-trib
    Aug 02, 2013 @ 08:52
    Dennis Aaen
    0

    Some other alternatives to my post above could be:

    <div class="greyTransperentTop">
        <xsl:text disable-output-escaping="yes">&amp;</xsl:text>nbsp;
    </div>
    <div class="greyTransperentTop">
     <xsl:text disable-output-escaping="yes"><![CDATA[&nbsp;]]></xsl:text>
    </div>
    <div class="greyTransperentTop">
     <xsl:text disable-output-escaping="yes">&#160></xsl:text>
    </div>

    Hope at least one of these will work for you Kate :-).

    /Dennis

  • Kate 267 posts 610 karma points
    Aug 02, 2013 @ 09:06
    Kate
    0

    it works beautifully with &#160;

    Thanks

  • Dennis Aaen 4457 posts 17970 karma points admin hq c-trib
    Aug 02, 2013 @ 09:12
    Dennis Aaen
    0

    Okay Kate glad that I could helping you finding a solution. Remember to mark the post as solved so others can go straight to the solution if they come across the same problem.

    /Dennis

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies