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)
Custom DTD - Modifying generated DCT
satpal
Hello,
I am using iwdtd2sym CLT to generate datacapture.cfg for my custom DTD.
It generates fine and the form is displayed.
But there is one problem. For all PCDATA elements, an item with name "#PCDATA" is created
and displayed in the form, which is not a good idea.
If I change this item name, the xml generated is not in expected format and doesn't validate.
Consider the following example given in the Templating Developer's Guide :
Custom DTD :
<!ELEMENT simple-example (message)>
<!ATTLIST simple-example
color (red|blue|green) #IMPLIED
>
<!ELEMENT message (#PCDATA)>
For 'message' element, following is generated after running iwdtd2sym :
<symbol name="message">
<container combination="and" hide-name="f" name="message">
<container combination="and" hide-name="t"
name="{iw_sub_elements}[0]">
<label>XML sub-elements</label>
<item name="#PCDATA">
<textarea cols="0" required="f" rows="0" rtf="f"
wrap="off"/>
</item>
</container>
</container>
</symbol>
If I create a DCR for above template, the form shows 'PCDATA' before textarea and a valid DCR is generated which looks like this :
<simple-example color="red"><message>This is Red color.</message></simple-example>
Now, if I change the item name from "#PCDATA" to "Message Text", the form shows 'Message Text' but the following invalid DCR is generated :
<simple-example color="red"><message><Message Text>This is Red color.</Message Text></message></simple-example>
How can I handle above situation ?
I also require that form displays field names which can be different from the tag specified in the custom DTD.
In above example, element in custom DTD is 'simple-example' but the form should show 'Select Color' and not 'simple-example'.
Kindly let me know if thera are any alternative solutions to these problems.
Thanx,
Satish.
Find more posts tagged with
Comments
satpal
Hello,
I was able to achieve this by simply adding label tag for each element in the generated DCT.
Sometimes, mind goes to sleep ;-)
Satish.
Migrateduser
Yes, the best way to address this issue is to use the <label> tags to specify user-friendly labels.
As a note, in TST5.x, the #PCDATA and {iw_sub_element} names assigned by the iwdtd2sym CLT have special meaning, and should not be changed.
--Daniel