Copied to clipboard

Flag this post as spam?

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


  • Justin Grimm 56 posts 138 karma points
    Jan 07, 2011 @ 00:49
    Justin Grimm
    0

    Pulling back value from custom data picker

    Hoping this can be handled in XSLT.  I have a custom data picker which I'm populating from a database table for US States.  I store a guid, state name, state abbreviation.  

    This works great for building drop-downs and such.  But now I need to bring back the state name and not the selected value in my XSLT.  I.E. I'm only getting back the guid to display to the end user.  How do I refer back to state name instead of the guid?

    <xsl:value-of select="eventLocationState" /> = b8f2e615-b45f-4747-be34-a4878293846293675

    But I need it to bring back "Illinois"

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 07, 2011 @ 08:13
    Jan Skovgaard
    0

    Have you wrapped the values in your custom datatype picker in some XML, which you can fetch? (I'm asuming that you by custom mean you have written it in C# or VB.NET for instance)

    If so you should be able to see the XML by using <xsl:copy-of select="eventLocationState" />, which gives you an idea about the structure and how to fetch the correct value.

    /Jan

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 07, 2011 @ 09:03
    Dirk De Grave
    0

    I think you've got two options: 

    - Either have your datatype store both key/value for the dropdown selection, ie store both guid  b8f2e615-b45f-4747-be34-a4878293846293675 and 'Ilinois' in some way (most preferred xml as it's easily queried in xslt)

    - Have an xslt extension that'll get the value 'Illinois' from the db based on guid b8f2e615-b45f-4747-be34-a4878293846293675

     

    First approach is best imo

     

    Cheers,

    /Dirk

  • Justin Grimm 56 posts 138 karma points
    Jan 07, 2011 @ 21:59
    Justin Grimm
    0

    Thanks for the help, gents.  I ended up using an XSLT extension because of the crunch for time.

  • 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