|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Help required !!! |
« View previous topic :: View next topic » |
Author |
Message
|
elvis_gn |
Posted: Sun Nov 28, 2004 12:02 am Post subject: Help required !!! |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
How can i create an XML with same field names.
For example:
<Name>
<First> </First>
<Last> </Last>
</Name>
<Addressed>
<Address> </Address>
<Address> </Address>
<Address> </Address>
<Addressed>
How can i create this XML ????
Will "OutputRoot.XML.Addressed.Address" used thrice not create an error ??
How can i read from such an XML ????
Will "InputBody.Addressed.Address" not give me an error ?? |
|
Back to top |
|
 |
martinrydman |
Posted: Sun Nov 28, 2004 2:25 am Post subject: |
|
|
 Centurion
Joined: 30 Jan 2004 Posts: 139 Location: Gothenburg, Sweden
|
Hi,
Use
Code: |
OutputRoot.XML.Addressed.Address[1]
OutputRoot.XML.Addressed.Address[2]
OutputRoot.XML.Addressed.Address[3]
|
Good luck!
/Martin |
|
Back to top |
|
 |
javaforvivek |
Posted: Sun Nov 28, 2004 10:07 pm Post subject: |
|
|
 Master
Joined: 14 Jun 2002 Posts: 282 Location: Pune,India
|
Frist of all, your XML message should have a root element.
You can define it as :
<Person>
<Name>
<First> </First>
<Last> </Last>
</Name>
<Addressed>
<Address> </Address>
<Address> </Address>
<Address> </Address>
<Addressed>
</Person>
While defining your message, you can set Min and Max occurrences of Address element = 3 inside your Addressed Type.
Refer them as Martin has suggested. But with slightly different code as:
Quote: |
How can i read from such an XML ????
|
You can refer them as:
Code: |
InputRoot.XML.Person.Addressed.Address[1]
InputRoot.XML.Person.Addressed.Address[2]
InputRoot.XML.Person.Addressed.Address[3]
|
Quote: |
Will "InputBody.Addressed.Address" not give me an error ??
|
Again you gotta change it to "InputRoot.XML.Person.Addressed.Address"
This will not give you error, but it will refer to first occurrence of Address element inside your Addressed element, i.e, it is same as
InputRoot.XML.Person.Addressed.Address[1]. _________________ Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|