ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Accessing the XML Field Type

Post new topic  Reply to topic
 Accessing the XML Field Type « View previous topic :: View next topic » 
Author Message
kytem
PostPosted: Sun Dec 06, 2009 5:54 pm    Post subject: Accessing the XML Field Type Reply with quote

Newbie

Joined: 06 Dec 2009
Posts: 7

Hi,

I have a situation where we have a number of XML messages coming into the broker. Whilst each message is different they all have a number of fields that are common in each message.

They are complex field types.

What I would like to do is to be able to scan through each message and identify the occurances of the complex types. Ideally I'd like to create a single sub flow that can scan the message(s) and perform specific actions based upon the occurances of the complex types it finds in each message.

I have scanned thru forums (like this one) and I have not yet found a way to do this in the Broker.

Is it possible? If so, how?

Thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Sun Dec 06, 2009 6:09 pm    Post subject: Re: Accessing the XML Field Type Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kytem wrote:
Is it possible? If so, how?


It's certainly possible to reference common fields in the body of a message irrespective of the parent fields. Equally it's possible to identify a message based on the name / type of the parent fields.

Not sure if that's what you're looking for, but this technique is described in the WMB InfoCentre. Start here, then look up references.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kytem
PostPosted: Sun Dec 06, 2009 8:15 pm    Post subject: Reply with quote

Newbie

Joined: 06 Dec 2009
Posts: 7

Ideally I want to avoid being dependent upon searching for the "base elements" (if I can...)

The situation I've got is I have a Complex type def'n of DocAttach, which contains two fields FileName and FileReference.

In the example below we PisFile and UploadFile are defined with the complex type of DocAttach.

What I would like to do is scan the message when it arrives into the Broker and identify the occurence(s) of complex type DocAttach.


<Msg1>
...
...
<PisFile>
<FileName>
<FileURL>
</PisFile>
</Msg1>


<Msg2>
...
...
<UploadFile>
<FileName>
<FileURL>
</UploadFile>
</Msg2>
Back to top
View user's profile Send private message
Vitor
PostPosted: Sun Dec 06, 2009 8:21 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kytem wrote:
Ideally I want to avoid being dependent upon searching for the "base elements" (if I can...)


You can. It's the very definition of anonymous references.

kytem wrote:
What I would like to do is scan the message when it arrives into the Broker and identify the occurence(s) of complex type DocAttach.


Perfectly doable. You'll have to produce some ESQL to do it; WMB doesn't have a "IF InputBody CONTAINS <XML type>" function but it's fairly straightforward if you're doing what I think you're doing. It's not that complex even if you're not.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Dec 07, 2009 2:28 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
What I would like to do is scan the message when it arrives into the Broker and identify the occurence(s) of complex type DocAttach
Not possible - the message tree does not contain the name of ( or any other properties of ) the simple types/complex types in the original schemas.

You can't do it using an XSLTransform node either - XPath 1.0 does not provide access to the schema types.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Dec 07, 2009 7:57 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kimbert wrote:
Not possible - the message tree does not contain the name of ( or any other properties of ) the simple types/complex types in the original schemas.


Really? I am enlightened!

I suppose, on reflection, FIELDTYPE returns the message tree type rather than the underlying type.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Dec 08, 2009 2:06 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
I suppose, on reflection, FIELDTYPE returns the message tree type rather than the underlying type.
Correct. FIELDTYPE consists of two parts. The top 8 bits identify the generic type of the element. Generic types are Name / Value / NameValue.
The lower 24 bits are the parser-specific field type. These are used differently by each parser. XML parsers use these bits to identify which XML construct the element represents. These bits get cleared automatically when an element is copied into the tree owned by a different parser.
From v61 FP04, the parser-specific field type is decoded by the Trace node and displayed along with the other info about the element. That's where the (PCDataField) and (NamespaceDecl) strings come from.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Accessing the XML Field Type
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.