Copied to clipboard

Flag this post as spam?

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


  • raghavendran 30 posts 50 karma points
    Jul 27, 2010 @ 11:24
    raghavendran
    0

    this is my code in xslt

    <xsl:value-of select="$currentPage/data[@alias=string(mediaAcceleration)]" disable-output-escaping="yes"/>

     

    Here if i give $currentPage/mediaAcceleration its working but if i give $currentPage/data[@alias='mediaAcceleration'] ..its not working..

     

    i need to use @alias because i will be using language translation where we need to concatenate the alias sometimes with the query string...

    PPlease help..im fed up with this!! :(

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Jul 27, 2010 @ 11:38
    Warren Buckley
    0

    Hello Raghavendran.
    Sorry to hear you are having problems. But this is due to the XML schema changing in the new version of Umbraco in version 4.5 and newer.

    Here is a WIKI post about the new schema
    http://our.umbraco.org/wiki/reference/xslt/45-xml-schema
    http://our.umbraco.org/wiki/reference/xslt/45-xml-schema/xslt-examples-updated-to-new-schema

    Also it's possible to have your site running 4.5.X of Umbraco to use the old XML schema by doing the following:
    You need to update the UseLegacyXmlSchema setting in the config/UmbracoSettings.config file

    Warren :)

  • raghavendran 30 posts 50 karma points
    Jul 27, 2010 @ 11:48
    raghavendran
    0

    hi warren,

    once i change the useLegacyXmlSchema Value to True...The xslt file is not getting saved...

     

    [xsltErrorNoNodesPublished]

     

     

    This error is coming....What to do?

  • raghavendran 30 posts 50 karma points
    Jul 27, 2010 @ 11:51
    raghavendran
    0

    And Also i wanna use the new Xml Schema itself.....so may i know how i need to manipulate my code to make it work according to the new schema

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Jul 27, 2010 @ 12:02
    Warren Buckley
    0

    Hello Raghavendran.

    OK if you wish to use the OLD XML schema and have changed the setting. You will need to publish all nodes again.
    So right click on your first node and select publish and select the option to include all child nodes as well.
    After doing that then right click on the very top node called "Content" and select republish entire site.
    This will fix your problem with saving XSLT files.

    Well if you want to use the new XML schema and adapt your code to do this, then I will need to see a copy of it in order to help you.

    Warren :)

  • raghavendran 30 posts 50 karma points
    Jul 27, 2010 @ 12:20
    raghavendran
    0

    hi warren i did change it to true and published....xslt got saved but i didnt get any output in the page......... im planning to use the new schema only for my project....so if some one knows about it please help me...

     

    @warren:thanks a lot for ur quick replies...

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Jul 27, 2010 @ 12:25
    Warren Buckley
    0

    Hello Raghavendran.
    I did post some WIKI links about the new XML Schema further up, so please read those first and then post more specific questions to get help, as opposed to more generic questions.

    OK so if you saved and published and are using the OLD XML schema and did not get any output on the page, it may be that your XSLT is wrong.

    Please show me the actual code from the file, as it's impossible to help you.

    Warren :)

  • raghavendran 30 posts 50 karma points
    Jul 27, 2010 @ 12:31
    raghavendran
    0

    <?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:umbraco.contour="urn:umbraco.contour" 
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour ">


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

    <xsl:param name="currentPage"/>

     <xsl:include href="../xslt/lang_lib.xslt" />    

    <xsl:template match="/">

    <!-- The fun starts here -->

    <table align="center" border="0">
    <tr><td style="width:850px">   <xsl:value-of select="$currentPage/technologyListPageBanner" disable-output-escaping="yes"/>
    </td></tr>
    </table>


    <table  width="850px" border="0" align="center" style="background:WHITESMOKE">
    <tr>
    <td style="width:850px"
      <xsl:value-of select="$currentPage/technologyListPageHeader" disable-output-escaping="yes"/>
     
    </td></tr>
    </table>


      <!-- table technologies -->
      <table align="center" style="width:850px; background:WHITESMOKE">
    <tr>
    <td class="border1">
      <xsl:value-of select="$currentPage/Multi-coreTechnology" disable-output-escaping="yes"/>
      </td>

      <td class="border1"
     <xsl:value-of select="$currentPage/GraphicsTechnology" disable-output-escaping="yes"/>

    </td>
    </tr>

    <tr>
    <td class="border1">
      <xsl:value-of select="$currentPage/manageability"  disable-output-escaping="yes"/>
      </td>
      

    <td class="border1">
      <xsl:value-of select="$currentPage/mediaAcceleration" disable-output-escaping="yes"/>
      </td>
    </tr>
    <tr>
    <td class="border1">
     <xsl:value-of select="$currentPage/powerEfficiency" disable-output-escaping="yes"/>
      </td>
    <td>
      &nbsp;
      </td>
    </tr>
    </table>

    </xsl:template>

    </xsl:stylesheet>

    hi warren,for this code i have another document tab for mediaAcceleration_zh,powerEfficiency_zh etc.....so i need to fetch according to query string...that is possible if i get the node based on alias....( i would be albe to concatenate my alias name with query ) and view data...


  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Jul 27, 2010 @ 12:41
    Warren Buckley
    0

    Hello Raghavendran.
    OK so your XSLT file is using the NEW XML Schema and not the OLD schema so you will need to switch the config setting back and publish/re-publish again to make sure the XML cache file is using the new schema.

    I am not 100% sure I follow what you want to do, but here is my example code of what I understand you want to do.

    <xsl:variable name="documentTypeAlias" select="umbraco.library:RequestQuerystring('documentTypeAliasQuerystring')" />

    <!-- Do different stuff depending on querystring -->
    <xsl:choose>
    <xsl:when test="$documentTypeAlias = 'mediaAcceleration_zh'>
    <!-- Do stuff when mediaAcceleration_zh -->
    </xsl:when>
    <xsl:when test="$documentTypeAlias = 'powerEfficiency_zh'>
    <!-- Do stuff when powerEfficiency_zh -->
    </xsl:when>
    <xsl:otherwise>
    <!-- When we dont meet the previous two tests, do this -->
    <xsl:otherwise>
    </xsl:choose>

     

    Warren :)

  • raghavendran 30 posts 50 karma points
    Jul 27, 2010 @ 12:47
    raghavendran
    0

    • i have 2 parts...media acceleration and media accleration_zh in tabs in one document type...
    • Similarly for power efficiency i have 2(normal and _zh)
    • Similarly for Graphics technology i have 2...
    • i dont want to test every time if the query is _zh or no query...i directly try to concat the _zh or nothing from the query string to the alias name and get the doccumenttypeAlias....
    Do u understand my problem warren ??

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Jul 27, 2010 @ 13:03
    Warren Buckley
    0

    OK I think I understand a bit better now.

    <xsl:choose>
     
    <xsl:when test="$documentTypeAlias = 'mediaAcceleration'>
       
    <!-- Do stuff when mediaAcceleration -->

    <!-- Value of
    mediaAcceleration -->
    <xsl:value-of select="$currentPage/mediaAcceleration" disable-output-escaping="yes"/>

    <!-- Value of mediaAcceleration_zh -->
    <xsl:value-of select="$currentPage/* [name() = concat('mediaAcceleration',$documentTypeAlias) and not(@isDoc)]" />

      </xsl:when>
    </xsl:choose>

  • raghavendran 30 posts 50 karma points
    Jul 27, 2010 @ 14:05
    raghavendran
    0

    Awesome Warren...

    Thanks a lot :)..it worked :)....U rock :)

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Jul 27, 2010 @ 14:13
    Warren Buckley
    0

    Don't forget to mark the correct reply as the solution, in order for other people to find the answer easily.

    Warren :)

Please Sign in or register to post replies

Write your reply to:

Draft