Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
accessing an item without knowing its name
consultant1
I have a DCT in which the item's name is dynamically built by a perl script based on the occurence of DCRs of a different datatype. Now my problem is the number of items and their name is not known. How do i access them in my presentation template?I have to access the name of the item also any suggestions please...?
Find more posts tagged with
Comments
Bowker
You can do a number of things.
You can read the whole DCR into a perl variable and parse out each element's name one at a time using an XML tokenizer. Then use the iw_perl function iwpt_dcr_value (see below)
If you know what the possible names could be you could either put a bunch of "<iw_if ...value exists>" or if the names flow along a date type syntax you could dynamically retrieve the information using perl to build the names for you. For example:
<iw_perl><[!CDATA[
$dcrvaluename = "pressrelease_$mm$dd$yy";
iwpt_output(iwpt_dcr_value($dcrvaluename));
]]>
</iw_perl>
Dan
Bowker
Another option would be to have a known element name's value hold the unknown elements name:
<item name="getthisvalue"><value>pressrelease_081602</value></item>
<item name="pressrelease_081602"><value>lkjsdflkj slj fljkd fljks dfls</value></item>