|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Referencing by position problem... ?? |
« View previous topic :: View next topic » |
Author |
Message
|
LH33 |
Posted: Tue Mar 25, 2003 8:23 am Post subject: Referencing by position problem... ?? |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
HI! I have a message flow which will be reading errors from a queue and formatting them to be logged into a database. The first tag after InputRoot.XML will be either <ConfirmJob> or <ConfirmBOD>. Depending on the tag, I need to format the XML differently. I have tried to reference the tag by position to see which one it is, but it is not working. Is there any way to reference this tag?
Thanks for any help you can provide! LisaB
Here is an example of the XML coming into my flow:
<ConfirmJob revision="1.0.0" environment="Test" >
<ApplicationArea>
<Sender>
<Component>Identify The Application Of Origin</Component>
<Confirmation>Never</Confirmation>
<AuthorizationId>Identify The User Of Origin</AuthorizationId>
</Sender>
<CreationDateTime>CCYY-MM-DDThh:mm:ss</CreationDateTime>
<BODId>GUID - Globally Unique Identifier</BODId>
</ApplicationArea>
<DataArea>
<Confirm/>
<Job>
<Header>
<OriginalApplicationArea>
<Sender>
<Component>OriginalBOD.Component</Component>
<Confirmation>OriginalBOD.Confirmation</Confirmation>
<AuthorizationId>OriginalBOD.AuthorizationId</AuthorizationId>
</Sender>
<CreationDateTime>OriginalBOD.CreationDateTime</CreationDateTime>
<BODId>OriginalBOD.BODId</BODId>
</OriginalApplicationArea>
<ChangeFailure>
<ErrorMessage>
<Description>Testing ChangeJob Failure</Description>
<ReasonCode>Error.ReasonCode</ReasonCode>
</ErrorMessage>
<WarningMessage>
<Description>Warning.Description</Description>
<ReasonCode>Warning.ReasonCode</ReasonCode>
</WarningMessage>
</ChangeFailure>
</Header>
</Job>
</DataArea>
</ConfirmJob> |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Mar 25, 2003 8:31 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The root tag of your XML document should usually be the first child of {Input,Output,}Root.XML.
So in a filter node
FIELDNAME(Root.XML.*[1]) = 'ConfirmJob')
should be true if the root of your XML document is the ConfirmJob tag, and False if it's anything else.
If you're sure that your root tag is the ConfirmJob tag, and you are not getting the value you expect when you reference Root.XML.*[1], then you need to examine a trace file to see exactly what the direct children of your XML parser are. You could have XML decls that are confusing things, or spaces, or etc.
You can use Root.XML.*[LAST] to go to the last child of your XML parser. This will skip past anything like blank lines or XML declarations, and should point to your document root. |
|
Back to top |
|
 |
LH33 |
Posted: Tue Mar 25, 2003 8:59 am Post subject: |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
Thanks!! I am still having trouble. I used InputRoot.XML.*[1] and it returned nothing. Then I tried InputRoot.XML.*[LAST] and it still returned nothing.
If I use a filter - I need to be able to check for both tags mentioned before and in the filter (as far as I know) you can only return true for one If statement.
Is there something else I may be doing wrong?
Thanks, LisaB |
|
Back to top |
|
 |
LH33 |
Posted: Tue Mar 25, 2003 9:28 am Post subject: |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
Thanks!!!! I got it to work using yor suggestion of
FIELDNAME(Root.XML.*[1]) = 'ConfirmJob')
Thanks a lot!! LisaB |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Mar 25, 2003 9:47 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
OOps.
There's a typo - an extra parenthesis.
I'm sure you fixed it in your code, that's working.
It should be
Code: |
FIELDNAME(Root.XML.*[1]) = 'ConfirmJob' |
The filter node was just a suggestion, and so I could type 'Root' instead of 'OutputRoot' or 'InputRoot'. It shouldn't make a difference either way. Inside a compute node, 'FIELDNAME(OutputRoot.XML.*[1])' should have the same value (for the same XML) as 'FIELDNAME(Root.XML.*[1])' has inside a filter node. |
|
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
|
|
|
|