Author |
Message
|
Yanghui |
Posted: Mon May 10, 2004 1:00 am Post subject: xml attr becomes element after using environment tree |
|
|
Disciple
Joined: 08 May 2002 Posts: 151 Location: Dublin, Ireland
|
Hi, there,
I am using environment tree to store incoming xml because I need to keep most of xml structure for output and there are several times domain change in msgflow. The problem I am having now is that all attributes in the incoming xml have been changed to normal tags of their parent elements. The ESQL I am using is
SET OutputRoot.Properties.MessageDomain = 'XML';
SET OutputRoot.XML = NULL;
CREATE Field OutputRoot.XML.MYMESSAGE;
SET OutputRoot.XML.MYMESSAGE = Environment.Variables.OriginInputMsg.MYMESSAGE;
Am I missing something here? How can I keep atrributes as where they are?
Many thanks for your input in advance.
Regards
-Yanghui |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon May 10, 2004 2:48 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The Environment tree doesn't support XML attributes by default. It doesn't have any parsers associated with it, so it can't tell how to handle different types of logical elements.
You might be able to get around this by creating a field in Environment that has an XML parser associated (CREATE FIELD ... PARSE ...). _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Yanghui |
Posted: Mon May 10, 2004 3:53 am Post subject: |
|
|
Disciple
Joined: 08 May 2002 Posts: 151 Location: Dublin, Ireland
|
Hi,
Thanks for your reply but I don't understand your get-around. Should I use different XML parser? Is the parser available with the product? Do you mind to make it clearer? Do you have ESQL for this?
Many thanks again
Regards
-Yanghui |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon May 10, 2004 4:17 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'm saying that rather than just copying stuff into Environment using set, you should first use the Create Field statement and include the Parse option to create for instance your root XMl tag in the Environment tree.
Then, maybe, you will be able to store your attributes and retrieve them again as attributes.
But generally, the Environment tree doesn't support attributes. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JLRowe |
Posted: Mon May 10, 2004 6:46 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
You can create the environment tree with an owning parser, using the CREATE FIELD with DOMAIN clause.
(e.g.)
CREATE LASTCHILD OF Environment DOMAIN 'XML' NAME 'TempTree';
SET Environment.TempTree = <<Saved Message Tree>>;
(later on...)
SET OutputRoot.XML = Environment.TempTree.*[>];
This should preserve all the XML parser specific types. |
|
Back to top |
|
 |
|