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 » Obtaining references as strings

Post new topic  Reply to topic
 Obtaining references as strings « View previous topic :: View next topic » 
Author Message
Vitor
PostPosted: Fri Jul 30, 2010 5:13 am    Post subject: Obtaining references as strings Reply with quote

Grand High Poobah

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

WMB 6.1.0.5

A flow reads an XML document from a queue and processes it in the traditional manner, transforming it and passing it forward. An existing downstream application has a similar XML document that doesn't pass through WMB but as part of their processing they need to know what parts of the document we've processed. Rather than taking our processed XML like any sane application they want XPath references to the relevant sections.

So what I need to do is take a REFERENCE variable that points to InputRoot.XMLNSC.Something.Somewhere.ThisBit.WillBeChanged and get a CHARACTER varable "InputRoot.XMLNSC.Something.Somewhere.ThisBit.WillBeChanged". After that some substringing and replacing gets me where I need to be but what's the best way to get a reference in string form? Is there a way? Do I (glup) need a JCN?

I accept what I actually need is a really big trout and 5 minutes with the downstream application people but that's a work in progress.

Suggestions welcomed, especially suggestions that include the phrase "just use the ... ESQL function you idiot".
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Jul 30, 2010 5:18 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447



I think you need to recursively walk up PARENT using FIELDNAME and FIELDNAMESPACE. I don't think you can otherwise cast a reference to a meaningful string value... ?

I've not played with it though.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jul 30, 2010 5:24 am    Post subject: Reply with quote

Grand High Poobah

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

mqjeff wrote:
:I think you need to recursively walk up PARENT using FIELDNAME and FIELDNAMESPACE. I don't think you can otherwise cast a reference to a meaningful string value... ?


I was afraid you'd say that. Though more afraid you'd suggest a JCN
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Jul 30, 2010 6:42 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Vitor wrote:
mqjeff wrote:
:I think you need to recursively walk up PARENT using FIELDNAME and FIELDNAMESPACE. I don't think you can otherwise cast a reference to a meaningful string value... ?


I was afraid you'd say that. Though more afraid you'd suggest a JCN


Oh, I was tempted.

But there isn't a specific reason I can think of that requires a JCN here - OTOMH there isn't a method that produces an XPath expression from an MbElement object.

You could review the specs on MbElement yourself..
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jul 30, 2010 7:26 am    Post subject: Reply with quote

Grand High Poobah

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

mqjeff wrote:
You could review the specs on MbElement yourself..


I could. It's not likely.


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Jul 30, 2010 10:36 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

XPaths use prefixes, not namespace URIs. PRefix->URI mappings must be provided separately. So...does the XML document use namespaces, or will it ever do so in the future? If so, your message flow will need one of two things:
- knowledge of the namespace prefixes used by the downstream app
or
- the ability to allocate a namespace prefix for each element in the XPath, and the ability to communicate those prefix->URI mappings to the downstream app.

I'm guessing that the answer is 'no', but you might be able to use this question as a 'trout'.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jul 30, 2010 10:49 am    Post subject: Reply with quote

Grand High Poobah

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

At the moment we are namespace free. A cynical, twisted person might claim that's because it a concept outside the grasp of those involved but what are the odds of a cynical, twisted person posting here?

Grrr.....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jul 30, 2010 1:33 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

mqjeff wrote:


I think you need to recursively walk up PARENT using FIELDNAME and FIELDNAMESPACE. I don't think you can otherwise cast a reference to a meaningful string value... ?

I've not played with it though.


Walk up the tree like Jeff said and append the character variable to whatever you found at each step... At the end the character variable will give you the reference... It is a little bit ugly but why would they just reference something and not have it copied? Are their documents so huge? And how do they reference the particular instance of the document that the reference is pointing to?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Fri Jul 30, 2010 2:50 pm    Post subject: Reply with quote

Grand High Poobah

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

fjb_saper wrote:
why would they just reference something and not have it copied?


That's a good & relevant question.

fjb_saper wrote:
Are their documents so huge?


Average at 24Mb a document.

fjb_saper wrote:
And how do they reference the particular instance of the document that the reference is pointing to?


Another very relevant question.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » Obtaining references as strings
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.