Author |
Message
|
Mensch |
Posted: Thu Oct 26, 2006 1:53 am Post subject: Problems With XML message Set |
|
|
Disciple
Joined: 17 Jul 2005 Posts: 166
|
Hi
I am facing problems while trying to create XML message set for following part of input message
<details><name>abc</name><Amt type = "XXX" curr = "INR" > 123</Amt></details>
I created local complex type as details then added one local element as name.
after that I created one more complex type inside details as <Amt> then added two attributes namely type and curr.
But i am not able to fetch Amt value(which is 123).Please help
i think i have to add one more local element inside Amt as > and access value as details.Amt.> ... Correct me if I am wrong
P.S : WMB 6 ,WIN XP _________________ Thanks and Regards ,
Mensch |
|
Back to top |
|
 |
kimbert |
Posted: Thu Oct 26, 2006 2:49 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
- Which parser are you using ( MRM / XML / XMLNS / XMLNSC )?
- How are you trying to access the value of Amt?
- If MRM, have you added an XML physical format to your message set?
- If MRM, have you specified MessageSet, MessageType and MessageFormat on the input node ( or using an MQRFH2 header ).
Quote: |
i think i have to add one more local element inside Amt as > and access value as details.Amt.> ... Correct me if I am wrong |
You're wrong.
The '>' is XML markup, and you certainly do not need markup in your message model. |
|
Back to top |
|
 |
Mensch |
Posted: Thu Oct 26, 2006 7:58 pm Post subject: |
|
|
Disciple
Joined: 17 Jul 2005 Posts: 166
|
hi
I am using MRM parsed ..I have added the message set, message format.
I am able to access alll other elements only facing problem for an element having attributes and value.
FYI ..
part of input message is like this..
<details><name>abc</name><Amt type = "XXX" curr = "INR" > 123</Amt></details>
I am accessing attributes as InputBody.details.Amt.(Xml.attr)type.
But not sure of how to access AMt value(which is 123 here)
Please help.
Also tell me how do I model my XMl message for this particular input. _________________ Thanks and Regards ,
Mensch |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 27, 2006 1:42 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You don't use (XML.Attr) with anything other than the XML domain - not even XMLNS or XMLNSC - and especially not with MRM! _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Oct 27, 2006 3:00 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
The type of element 'Amt' is a 'complex type with simple content'. See
1. Define a simple type 'AmtValueType' which is a restriction of xs:string or xs:integer or whatever.
2. Define a complex type 'AmtType' which is an extension of AmtValueType
3. Add the attributes to 'AmtType'. |
|
Back to top |
|
 |
madi |
Posted: Fri Oct 27, 2006 7:08 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
jefflowrey wrote: |
You don't use (XML.Attr) with anything other than the XML domain - not even XMLNS or XMLNSC - and especially not with MRM! |
so what can we use for XMLNS and XMLNSC to access attributes??
--madi |
|
Back to top |
|
 |
kimbert |
Posted: Fri Oct 27, 2006 7:17 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Here's how to access attributes in the various XML domains:
XML - put (XML.Attribute) in front of the name ( or (XML.Attr) )
XMLNS - put (XML.Attribute) in front of the name ( or (XML.Attr) )
XMLNSC - put (XMLNSC.Attribute) in front of the name ( NOT (XML.Attribute) or (XML.Attr))
MRM - do not put anything in front of the name. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 27, 2006 7:25 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
|