Author |
Message
|
NiceGuy |
Posted: Wed Aug 18, 2010 2:43 pm Post subject: How to write <?xml ?> tag in XML1 message set? |
|
|
Apprentice
Joined: 11 Jun 2009 Posts: 37
|
Hello community,
I have created a message set that I need to write to. The
message set is an xml (XML1) message set and appears to be working
fine when creating the out document that utilizes the message set ...
However ....
My xml out document needs to start with the line ...
Quote: |
<?xml version="1.0"?> |
So I need to add an element at the start of my message set
that adds this .. but I have no clue how.
Can somebody help me with this? I am not that experienced with message broker so please bare with me.
Thank-you for your time. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Aug 18, 2010 8:19 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Look up the "XML.Declaration" and "XMLNSC.Declaration" in the broker's info center  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Aug 19, 2010 2:11 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
fjb_saper wrote: |
Look up the "XML.Declaration" and "XMLNSC.Declaration" in the broker's info center  |
Neither of those will help with the MRM-XML domain. (you need more tea...)
Presumably the "Suppress XML Declaration" property of the physical format in the message set definition has been checked. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Aug 19, 2010 7:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Although it would make sense that he is using MRM I still must be missing some of that tea boost because I did not find any mention of a parser or WMB version in the OP's message... _________________ MQ & Broker admin |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Aug 19, 2010 9:06 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
maybe here:-
Quote: |
I have created a message set that I need to write to. The
message set is an xml (XML1) message set |
 _________________ 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: Thu Aug 19, 2010 10:41 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
smdavies99 wrote: |
maybe here:-
Quote: |
I have created a message set that I need to write to. The
message set is an xml (XML1) message set |
 |
At least, that's what I used in deciding NiceGuy is using MRM-XML. |
|
Back to top |
|
 |
NiceGuy |
Posted: Thu Aug 19, 2010 11:24 am Post subject: |
|
|
Apprentice
Joined: 11 Jun 2009 Posts: 37
|
Hi community,
Thanks for the help thus far ...
For clarity, I am using the MRM domain.
mqjeff writes:
Quote: |
presumably the "Suppress XML Declaration" property of the physical format in the message set definition has been checked. |
The "Suppress XML Declaration" has not been checked off in the .mset file which is why I find this troubling.
My desired output would be of the form:
Code: |
<?xml version="1.0"?><CR><LF>
<Batch><record></record></Batch>
|
*Please note I merely placed the <CR><LF> for clarity of the presence of a new line as I obviously do not what the "<CR><LF>" characters literally written out.
However what I am currently getting is
Quote: |
<Batch xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><record></record></Batch> |
So in summary I am not getting my XML declaration in addition to getting the following junk
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
I pretty sure I am close but have exhausted all ideas given my limited experience.
Thanks again for the guidance and coaching |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Aug 19, 2010 1:01 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
What version of Broker are you using? |
|
Back to top |
|
 |
kimbert |
Posted: Mon Aug 23, 2010 3:40 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
My advice is to stop using MRM XML in a new message flow. XMLNSC offers far better control over the output XML ( as you are finding out ).
Something like this ought to do the trick:
Code: |
SET OutputRoot.XMLNSC.myRootTagName = InputRoot.MRM;
CREATE FIRSTCHILD OF OutputRoot.XMLNSC TYPE XMLNSC.XmlDeclaration;
SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Version = '1.0';
|
|
|
Back to top |
|
 |
|