Copied to clipboard

Flag this post as spam?

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


  • Jes Stautz 3 posts 23 karma points
    Aug 15, 2012 @ 11:28
    Jes Stautz
    0

    Macro with Chinese nodename

    The following macro works with non-chinese nodenames.

    Is it possible to get it work with a Chinese nodename?

    <!-- The fun starts here -->
    <ul>
    <xsl:for-each select="$currentPage/ancestor-or-self::node[@level = '1']/node[@nodeName='News']/descendant::node[@nodeTypeAlias='Nyhed']">
     <li>
      <a title="Read news {@nodeName}" href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a>
            <p class="date"><xsl:value-of select="umbraco.library:LongDate(data [@alias = 'dato'])"/></p> </li>
    </xsl:for-each>
    </ul>

     

     

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Aug 15, 2012 @ 11:36
    Chriztian Steinmeier
    0

    Hi Jes - welcome to the forum!

    It really shouldn't be a problem - XML & XSLT supports many character sets but maybe UTF-8 (or UTF-16) is enough?.

    I don't know how all the encoding stuff is handled in .NET, but first: Have you tried it? And if you have and it didn't "work" - what did you get instead?

    /Chriztian

  • Jes Stautz 3 posts 23 karma points
    Aug 15, 2012 @ 11:47
    Jes Stautz
    0

    Hi Chriztian

    Tried it and the macro is ignored. Maybe it is because the ANSI encoding does not preserve the chinese nodename.

    Saving in unicode makes the macro unreadable 'error reading XSLT file'

    So I'm a bit stuck.

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Aug 15, 2012 @ 12:02
    Chriztian Steinmeier
    0

    Okay - I'm curious to what the actual error is - could you add ?umbDebugShowTrace=True to the URL - there should be some debug output - if you can find the XSLT error there should be a better description of what goes wrong.

    If you open the XSLT file in an editor that can show you the encoding, what does it say?

    Now for the actual XML: Find the /App_Data/Umbraco.config file and open it in a texteditor - it's an XML file and you should be able to see how the chinese nodeNames are encoded in here. Furthermore, you should be able to rename it to data.xml and open it in a browser - if you get any "character set" or "encoding" related errors let us know...

    /Chriztian

  • Jes Stautz 3 posts 23 karma points
    Aug 20, 2012 @ 13:31
    Jes Stautz
    0

    Solved so far. Saving the xslt file in UTF-8 preserved the chinese node name and it stated working.

Please Sign in or register to post replies

Write your reply to:

Draft