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)
Formspublisher dtd
kajjubee
What is the advantage of writing a dct using datacapture6.0.dtd as opposed to datacapture5.0.dtd?
Secondly, is there an advantage of writing dcr type=xml over iwov if I am not using a custom dtd.
Thanks
Kiran
Find more posts tagged with
Comments
Migrateduser
If you are interested in creating "iwov" style DCRs, there is no difference between FormsPublisher and TST5.x. The main advantages in FormsPublisher are in generating XML DCRs.
FormsPublisher recognizes two types of XML files. The first type is the "unordered XML" format. In this format, XML is generated without the aid of a DTD. Because no DTD is specified, node ordering is random. For example:
<phonebook>
<entry>
<lastname>Yu</lastname>
<firstname>Daniel</firstname>
</entry>
....
<entry>
</entry>
</phonebook>
In the above example, the <lastname> tag appears before the <firstname> tag. Since no order is specified, this happens randomly (not necessarily in form order.) However, the <entry> nodes are in the order in which they appear in the form replicant.
The second XML type is the "ordered XML". In this case, there is a DTD that specifies, among other things, the order in which child nodes are to appear. Expanding on the above example, one might write the following DTD:
<!ELEMENT phonebook (entry)*>
<!ELEMENT entry (firstname,lastname)>
<!ELEMENT firstname (#PCDATA)>
<!ELEMENT lastname (#PCDATA)>
This DTD might result in the following XML:
<phonebook>
<entry>
<firstname>Daniel</firstname>
<lastname>Yu</lastname>
</entry>
....
<entry>
</entry>
</phonebook>
Notice that the resulting XML correctly reflects the node ordering. Besides this additional support for unordered XML, there are other advantages as well:
1. There is limited seperation of form presentation from the resulting XML structure (vs. no seperation in TST5.5).
In TST5.x, the XML structure was expressed in the DCT structure through the use of {iw_sub_element} and {iw_attribute} items. The order in which nodes are to appear in the XML are also hardcoded in the DTD. This prevents you from laying out the form independent of the DTD. For example, you wouldn't be able to create a form that has the lastname field appearing before the firstname in the above example. FormsPublisher solves this problem by allowing you to explicitly bind the DCT <item> nodes to specific nodes in the XML document. For example:
<container name="entry" location="entry">
<item name="lastname" pathid="lastname">
....
</item>
<item name="firstname" pathid="firstname">
....
</item>
....
</container>
the lastname item is bound to a node named <lastname> in the resulting XML through the pathid attribute. The location="entry" attribute of the container sets up the path context of "lastname". In this example, the lastname item appears before the firstname item, yet the resuting XML still conforms to the ordering specified in the DTD. (Note that because the DTD ordering is not hardcoded in the DCT, in FormsPublisher, the DTD needs to be HTTP accessible during runtime as the save module consults the DTD for this information.)
2. FormsPublisher provides a cleaner, easier way to create XML documents.
As explained earlier, FormsPublisher allows for the creation of XML documents with or without a DTD. The pathid and location attributes also provide the author a more intuitive and flexible way of binding items to XML nodes. This is especially evident when you compare the result of iwdtd2sym in TST5.x and FormsPublisher. Many have found that the special {} items with the symbol table to be confusing. The new format was designed so that a DCT author can create DCTs generating XML more easily.
--Daniel
Migrateduser
There is a recent DevNet webcast that elaborates on some of what Daniel is saying. You can check out the recording here:
http://devnet.interwoven.com/site.fcgi/webcasts/docs/webcast-recordings.html#webcast04-07
Regards,
lissa