Author |
Message
|
martc |
Posted: Fri Dec 08, 2006 1:33 pm Post subject: Tags not exporting from xml to TDS |
|
|
Apprentice
Joined: 23 Mar 2005 Posts: 39
|
Hi, I'm hoping someone can shed some light.... Im trying to recreate the 'Fix Message Set ' in WBI 6 sample using my own schema and input.
I've created a simple 'Contact' message set with two physical formats (XML1,TDS1). There is one message definition file which I created by importing xsd (attached). My goal is a simple xformation from xml to TDS with the tags: i.e. First=John:Middle=X:Last=Doe:DateOfBirth=1/1/2006:Address=MyStreet
with input of
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSPY v2004 rel. 4 U (http://www.xmlspy.com)-->
<Contact xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\GenericWorkingFolder\mqsi\temp\SimpleSchema.xsd">
<Name>
<First>John</First>
<Middle>X</Middle>
<Last>Doe</Last>
</Name>
<Address>My Street</Address>
<DateOfBirth>1967-08-13</DateOfBirth>
</Contact>
My output is 'JohnXDoeMy Street1967-08-13' without tags
Under the properties of each element I have the tag names present. Under the TDS1 properties I have the delimiter and Tag data separator as ': & =' and Im still not getting the Tags to export. Im missing something....
Thanks in advance
Contact xsd:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by me -->
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Contact">
<xs:annotation>
<xs:documentation>Comment describing your root element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Name">
<xs:complexType>
<xs:sequence>
<xs:element name="First" type="xs:string"/>
<xs:element name="Middle" type="xs:string"/>
<xs:element name="Last" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Address" type="xs:string"/>
<xs:element name="DateOfBirth" type="xs:date"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema> |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Dec 08, 2006 1:39 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Try going the other way.
See if you can get your TDS definition to succesfully parse a correct output document.
If you get errors with that, then debug those until it succeeds. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
martc |
Posted: Fri Dec 08, 2006 2:28 pm Post subject: |
|
|
Apprentice
Joined: 23 Mar 2005 Posts: 39
|
I did, and its not working either.
I only imported one xsd representing how the xml file should look. Should I be doing anything else representing the TDS? I am missing something basic it seems. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Dec 08, 2006 5:53 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Lemme try again.
Go the other way.
Find the bugs that happen.
Fix them.
Keep looking for bugs and fixing them until there aren't any bugs.
Then go back the way you started to go. You're fairly certain the XML works - you don't know if the TDS does at all. Fix the TDS first.
Yes, you have to do more than describe the XML data if you want to also model the TDS data.
You have to describe the TDS data. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Sat Dec 09, 2006 2:28 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Hi martc,
Quote: |
My goal is a simple xformation from xml to TDS with the tags |
Sorry to bring bad news, but there is no such thing as a 'simple transformation from XML to TDS'. XML is the only universal standard for rendering data as text. TDS has been designed to cope with everything else - the entire universe of non-XML text formats. Believe me, that is a big universe. Your chosen output format is one of literally hundreds of equally good alternatives. You need to describe your format in tedious detail by setting the TDS properties of each complex type and each element in your message model.
I'm not going to attempt to teach you TDS modelling. You need to read the docs and look at the samples. A couple of pointers though:
- Set Data Element Separation to 'Tagged Delimited' on each complex type ( default is 'Fixed Length' ),
- Set the Delimiter to ; on each complex type
- Set a TDS Tag for each element ( it is empty by default ).
And please note : if this sounds difficult, it is not because message broker is making it so. Modelling arbitrary text formats is always difficult, whatever tool you choose to utilise. |
|
Back to top |
|
 |
martc |
Posted: Mon Dec 11, 2006 12:27 pm Post subject: |
|
|
Apprentice
Joined: 23 Mar 2005 Posts: 39
|
Thanks Kimbert and Jeff
That helped and it worked!
I was missing the setting of the complex types in data element separation to 'Tagged Filimited'. Once I set those correctly my TDS came out exactly as expected. Well almost ... the namespaces also were extracted but that is fine. I can work with that.
Thanks again. |
|
Back to top |
|
 |
|