Author |
Message
|
w |
Posted: Mon Nov 22, 2010 3:21 am Post subject: Problem parsing TDS |
|
|
Apprentice
Joined: 08 Nov 2010 Posts: 44
|
I need to parse TDS message. The structure of the message is as follows
Record:FirstName=Mark|LastName=Campese
Record:FirstName=Mark1|LastName=Campese1
i need to parse it to XML to look something like this
<root>
<rec>
<FirstName>Mark<\FirstName>
<LastName>Campese<\LastName>
<\rec>
<rec>
<FirstName>Mark1<\FirstName>
<LastName>Campese1<\LastName>
<\rec>
<\root>
plz help  |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Nov 22, 2010 4:01 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Have you read the tutorial on TDS messages that is referenced at the top of this forum?
That should be your first port of call. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
w |
Posted: Mon Nov 22, 2010 4:28 am Post subject: |
|
|
Apprentice
Joined: 08 Nov 2010 Posts: 44
|
Sorry everyone was making a very basic mistake.Got it. its working now.The tutorial is really helpful. |
|
Back to top |
|
 |
nukalas2010 |
Posted: Mon Nov 22, 2010 8:33 pm Post subject: |
|
|
 Master
Joined: 04 Oct 2010 Posts: 220 Location: Somewhere in the World....
|
Hi W,
Can you please tell me how u got that output message plzzz...
thanks in advance |
|
Back to top |
|
 |
w |
Posted: Mon Nov 22, 2010 10:07 pm Post subject: |
|
|
Apprentice
Joined: 08 Nov 2010 Posts: 44
|
Hi nuklas,
I used the following settings
complex type element - root <tdsStructRep dataElementSeparation="TaggedDelimited" delimiter="<CR><LF>" groupIndicator="" groupTerminator="" messageSetDefaultRep="Text1" observeElementLength="false" suppressAbsentElementDelimiters="EndOfType" tagDataSeparator=":"
complex type element - rec <tdsStructRep dataElementSeparation="TaggedDelimited" delimiter="|" groupIndicator="" groupTerminator="" messageSetDefaultRep="Text1" tagDataSeparator="="/>
and the tags for elements are as follows
rec-record
FirstName-FirstName
LastName-LastName
hope this will make u understand
Plzzz do read the tutorial suggested by smdavies99. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Nov 23, 2010 2:26 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Interesting.
I might have used "Record:" as the Group Indicator, and done away with the outer type.
But that might not have worked with the rest of the message... And there's nothing wrong with your solution. |
|
Back to top |
|
 |
nukalas2010 |
Posted: Tue Nov 23, 2010 7:22 pm Post subject: |
|
|
 Master
Joined: 04 Oct 2010 Posts: 220 Location: Somewhere in the World....
|
Quote: |
Plzzz do read the tutorial suggested by smdavies99. |
Sorry I didnt find any tutorial, If u dnt mind can u please send me dat link
thanks.. |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Nov 23, 2010 10:21 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
This is one of the 'sticky' posts at the top of the forum posting list.
There are two such posts.
One announcing the patterns forum and the other a TDS Tutorial. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
nukalas2010 |
Posted: Tue Nov 23, 2010 11:08 pm Post subject: |
|
|
 Master
Joined: 04 Oct 2010 Posts: 220 Location: Somewhere in the World....
|
yeah Thankuuu Davies...
Its a very nice tutorial by marten ... |
|
Back to top |
|
 |
|