Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML typetrees - Problem with CDATA wrapper

Status
Not open for further replies.

jasminemerc

IS-IT--Management
Jun 14, 2004
9
US
Hi Guys,
I have problem with mapping XML data. I have created this typetree by importing a DTD and tried to use it. I works fine if I don't have CDATA wrappers in the data but fails if the data has CDATA wrapper. For example, if I run this data through the xml typetree, its failing.
PART OF DATA which has CDATA wrapper
<PICKHEADER>
<DOCTYPE>0</DOCTYPE>
<DOCUMENTID><![CDATA[abc]]></DOCUMENTID>
<DOCKID><![CDATA[]]></DOCKID>
<SHIPPOINT><![CDATA[]]></SHIPPOINT>


For the same document, if I remove the CDATA wrapper then it works fine. I am not sure how to add CDATA wrapper to the typetree.
Also I have used different tools(XMLSPY, EDITX, STYLUS..) to create the DTD from the XML Data( which has CDATAs) but no use.
Please suggest me how to do this.
 
What version of DataStage, and does the release notes or documentation say CDATA is supported?



BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Version : 6.7(306).
It looks to me that it supports CDATA wrapper.
I know that the typetree can handle what the CDATA wrapper does using the restriction list. But the client wants to send the data with CDATA wrappers so I am not sure how to do it.
 
After you generate a type tree with the XML DTD importer, if your XML data that you are mapping with this type tree contains CDATA, this input data may fail to validate correctly. Resolve this by opening the item within the
type tree, and append the initiator delimiter for item type with "<![CDATA[" and prepend the terminator with "]]>". The type tree should analyze successfully.




BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Thanks for such quick response. I really wish to do so but If they decide to remove the CDATA wrapper all of sudden one day. Is they a way to declare these CDATA wrapper as optional. That is, the data passes through succussfully with or without CDATA wrapper.
 
Sure, many ways. You could have a partitioned group, with & without, Modify tree so wrapper is optional, add component rules with PRESENT function. If your mappers can't do this, see Ascential about virtual consulting option.



BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top