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?
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.
- 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
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"
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
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
Thanks for the help, gents. I ended up using an XSLT extension because of the crunch for time.
is working on a reply...