Author |
Message
|
jjordan |
Posted: Tue Mar 10, 2009 11:54 am Post subject: FileOutput Node |
|
|
Novice
Joined: 14 Oct 2005 Posts: 17 Location: Portland, ME
|
I am trying to take a piece of data from an input XML message, and put it to a file, using the FileOutput node. I only want the text - not the tags - in the file. I use a compute node to build the XML output message. I've used the XPath expression ($Body/TagName) in the FileOutput - Request - Data Location property, but it includes the tag when the file is written.
Is there any way that I can just grab the text value between the tags to put into the output file? |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Mar 10, 2009 12:01 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
How about :-
create a MRM Message (CWF Physical format) set with one field, a string, put the value you want into the field and let the parser do the work for you. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Mar 10, 2009 12:33 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Or create OutputRoot.BLOB.BLOB. |
|
Back to top |
|
 |
jjordan |
Posted: Wed Mar 11, 2009 3:33 am Post subject: |
|
|
Novice
Joined: 14 Oct 2005 Posts: 17 Location: Portland, ME
|
Thanks for the suggestions!
I already tried the OutputRoot.BLOB.BLOB - it threw an exception when it reached the FileOutput node (I can't remember the exception, but I think it was something about an invalid type). I did not try ($Body).BLOB as the data location, so I'll give it a whirl.
I was trying to avoid creating an MRM, but it sounds like a good option, so I'll give that a try too!
Thanks again!
Jeff |
|
Back to top |
|
 |
nickkirk |
Posted: Thu Jul 22, 2010 6:22 am Post subject: |
|
|
Apprentice
Joined: 26 Sep 2008 Posts: 48
|
What was the solution for this please ?
I have the same issue. |
|
Back to top |
|
 |
Gaya3 |
Posted: Thu Jul 22, 2010 6:34 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
nickkirk wrote: |
What was the solution for this please ?
I have the same issue. |
read from top of this forum, you will get 2 options to resolve your issue _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jul 22, 2010 6:36 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You have to do something to construct a non-XML representation of the data yourself.
it would be illegal for any XML parser to provide an option to serialize the document to a NON XML format.
You could use XSLT, I suppose.
In general, if you have "the same" issue as an old post, you should open a new post anyway. It's likely not the same issue. |
|
Back to top |
|
 |
nickkirk |
Posted: Thu Jul 22, 2010 7:07 am Post subject: |
|
|
Apprentice
Joined: 26 Sep 2008 Posts: 48
|
Gaya3 wrote: |
nickkirk wrote: |
What was the solution for this please ?
I have the same issue. |
read from top of this forum, you will get 2 options to resolve your issue |
Thanks for the amazing input. I never thought of reading the earlier posts! |
|
Back to top |
|
 |
nickkirk |
Posted: Thu Jul 22, 2010 7:30 am Post subject: |
|
|
Apprentice
Joined: 26 Sep 2008 Posts: 48
|
I have tried MRM and get the following error:
ParserException
File:CHARACTER:/build/S700_P/src/MTI/MTIforBroker/MtiImbParser2/MtiImbSyntaxElement.cpp
Line:INTEGER:595
Function:CHARACTER:CpContext::loadWorker
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:5136
Text:CHARACTER:Invalid Wire format retreived.
Insert
Type:INTEGER:5
Text:CHARACTER:
BLOB does not work either. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jul 22, 2010 7:32 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
To use MRM you have to create a message set that represents your data.
And then you have to copy the fields from the logical tree that represents the XML document into a logical tree that is matches the MRM model.
To use BLOB, you have to manually construct the BLOB value from the input fields.
This is fairly basic stuff in Broker. Have you had any previous experience with the product or taken any training? |
|
Back to top |
|
 |
Gaya3 |
Posted: Thu Jul 22, 2010 7:58 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
the above issues are basic errors in MB, either you have to know how to model message sets or to create blob messages.
atleast search in this forum, you will get information about the above two. _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
nickkirk |
Posted: Thu Jul 22, 2010 7:58 am Post subject: |
|
|
Apprentice
Joined: 26 Sep 2008 Posts: 48
|
mqjeff wrote: |
To use MRM you have to create a message set that represents your data.
And then you have to copy the fields from the logical tree that represents the XML document into a logical tree that is matches the MRM model.
To use BLOB, you have to manually construct the BLOB value from the input fields.
This is fairly basic stuff in Broker. Have you had any previous experience with the product or taken any training? |
My question is not about how to create messages.
My question relates specifically to the File Output node. I have the same issue as what was described in the first post. |
|
Back to top |
|
 |
Gaya3 |
Posted: Thu Jul 22, 2010 7:59 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
nickkirk wrote: |
mqjeff wrote: |
To use MRM you have to create a message set that represents your data.
And then you have to copy the fields from the logical tree that represents the XML document into a logical tree that is matches the MRM model.
To use BLOB, you have to manually construct the BLOB value from the input fields.
This is fairly basic stuff in Broker. Have you had any previous experience with the product or taken any training? |
My question is not about how to create messages.
My question relates specifically to the File Output node. I have the same issue as what was described in the first post. |
thats what Jeff is explaining to you _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jul 22, 2010 8:06 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Again, there is NO WAY TO GET ANY XML PARSER, INCLUDING ANY OF THE BROKER XML PARSERS TO OUTPUT XML DATA WITHOUT TAGS.
That would be *illegal* XML. It's NOT xml data if it doesn't have tags.
If you want to output the contents of a FIELD or the aggregation of SEVERAL fields from an XML message and output them WITHOUT TAGS, you must CREATE A NEW MESSAGE that has the CONTENTS of those fields, and is NOT an XML message.
The FileOutput node does not have any concern or control over the physical format of the logical message tree that it is given. It merely uses the configured options it has been presented with to determine what portions of the logical message tree to ask the relevant parser to serialize into a bitstream which it can then write into a file. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jul 22, 2010 8:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
nickkirk wrote: |
My question is not about how to create messages.
My question relates specifically to the File Output node. |
Yes it is and no it doesn't. You're trying to create a message and output it. What node finally outputs it is irrelevant to this point.
nickkirk wrote: |
I have the same issue as what was described in the first post. |
Possibly but probably on a different version of the software (since neither you nor the original poster saw fit to share the information) - this thread is over a year old. This is why we prefer people to open new threads and refer back to related existing ones rather than reopen them. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|