Copied to clipboard

Flag this post as spam?

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


  • psiho 101 posts 96 karma points
    Dec 07, 2011 @ 02:06
    psiho
    0

    dictionary datatype razor example

    anybody can help with razor example of this? After adding field named "price" and of type "dictionary datataype" XML looks like this:

     

    <price>
      <ArrayOfValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <value xml:lang="en-US" id="1">english</value>
        <value xml:lang="de-DE" id="2">Deutsche</value>
      </ArrayOfValue>
    </price>

     

    in XSLT it is easy to get correct value, in example:

    <xsl:copy-of select="$currentPage/price/ArrayOfValue/value[@xml:lang = 'en-US']"/>

    ... but in Razor I cannot find a solution.

  • psiho 101 posts 96 karma points
    Dec 07, 2011 @ 14:38
    psiho
    0

    I also downloaded Cultiv razor Examples and found nothing that can help me. I did few steps like this:

    @foreach(var item in Model.price)
    {
        <li>@item.id</li>
    }

    And this works, doing @item.lang does not. Also @item.xml:lang does not. What I was trying is to loop through items and check lang attribute, but I don't know how to reach "xml:lang" attribute here.

Please Sign in or register to post replies

Write your reply to:

Draft