Author |
Message
|
uliss |
Posted: Wed Jan 10, 2007 12:57 am Post subject: I'm trying to get <?xml version="1.0" encoding= |
|
|
Apprentice
Joined: 10 Jan 2007 Posts: 27
|
Hi everybody,
I'm trying to get this in the output
<?xml version="1.0" encoding="ISO-8859-2">
<Mensaje>
........
.......
.......
........
</Mensaje>
I don't know how to get the first line (in red)
Can you help me, please? |
|
Back to top |
|
 |
Michael Dag |
Posted: Wed Jan 10, 2007 1:09 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
help yourself, the search button is on the top right hand corner,
search for xml encoding declaration and press the search all radio button...
it will save you a lot of time in the future  _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jan 10, 2007 1:18 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
uliss |
Posted: Wed Jan 10, 2007 1:41 am Post subject: |
|
|
Apprentice
Joined: 10 Jan 2007 Posts: 27
|
Hi,
I have done the following:
SET OutputRoot.XML.(XML.XmlDecl)='';
SET OutputRoot.XML.(XML.XmlDecl).(XML.Version)='1.0';
SET OutputRoot.XML.(XML.XmlDecl).(XML."Encoding")='ISO-8859-2';
And I did it!
Thank you very much!!! |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jan 10, 2007 2:42 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You should use the XMLNSC domain! _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jsware |
Posted: Wed Jan 10, 2007 5:06 am Post subject: |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
jefflowrey wrote: |
You should use the XMLNSC domain! |
Why? This processing instruction has nothing to do with XML namespaces. We were doing this in WMQI 2.1 which did not understand namespaces. _________________ Regards
John
The pain of low quaility far outlasts the joy of low price. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jan 10, 2007 5:13 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Oh, well. If you're using 2.1, then yes you should be using XML domain because you have no other choice.
But you shouldn't be using 2.1.
Regardless, AFTER 2.1, you should NOT use the XML domain, whether or not your data has namespaces in it. The XML domain uses an internal parser that is deprecated. In version 5, you should use XMLNS for everything, and in version 6 you should use XMLNSC for everything. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jsware |
Posted: Fri Jan 12, 2007 1:39 am Post subject: |
|
|
 Chevalier
Joined: 17 May 2001 Posts: 455
|
jefflowrey wrote: |
Oh, well. If you're using 2.1, then yes you should be using XML domain because you have no other choice.
But you shouldn't be using 2.1. |
We're not using 2.1 any more, but have not changed to the new XMLNS parser because I saw no need.
jefflowrey wrote: |
Regardless, AFTER 2.1, you should NOT use the XML domain, whether or not your data has namespaces in it. The XML domain uses an internal parser that is deprecated. In version 5, you should use XMLNS for everything, and in version 6 you should use XMLNSC for everything. |
I searched the mb6 docs for XML parser deprecated and find a reference:
mb6 docs wrote: |
If you were using the XML domain, change this to either the XMLNS or XMLNSC domain in input nodes and ESQL statements. These domains are namespace aware; the original XML domain is not and is effectively deprecated. |
Don't you just hate it when IBM hide these kind of statements deep inside the documentation
According to the documentation XMLNS and XMLNSC are for slightly different things. XMLNSC will strip out whitespace and my understanding from reading between the lines in the docs is that it is fast and efficient for "well structured" XML by eliminating the "messy" aspects of XML such as insignificant whitespace, comments, processing instructions etc. _________________ Regards
John
The pain of low quaility far outlasts the joy of low price. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 12, 2007 2:57 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I agree this position is not laid out as clearly in the documentation as it should be.
The XML domain is deprecated as of 5.0.
The XMLNSC domain is the preferred domain for non-modelled XML data in v6. It is more efficient and etc. than XMLNS. I guess I'm not quite clear myself if XMLNS is deprecated as of v6 - but every indication I've got is that it *will* be. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Jan 12, 2007 3:54 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I agree this position is not laid out as clearly in the documentation as it should be. |
So do I. We're fixing that. |
|
Back to top |
|
 |
shanson |
Posted: Fri Jan 12, 2007 5:00 am Post subject: |
|
|
 Partisan
Joined: 17 Oct 2003 Posts: 344 Location: IBM Hursley
|
There is a help topic intended to make clear which XML processing domain should be used under different circumstances. Except that it's got a bit out of date . By a coincidence I have just finished updating it for the next refresh of the 6.0 help . I've reproduced it in full below.
In response to some of the comments in earlier appends to this thread:
- XMLNSC is not always recommended - read the topic for guidance
- XMLNS is not deprecated
Beyond 6.0, the plan is that enhancements will be targetted at XMLNSC - better performance, true schema validation, etc. (Usual 'futures' caveats apply, of course ).
Here's the topic:
XML messages in the MRM and XML domains
If your messages are in XML, you can use either the XML Wire Format in the MRM domain, or one of the dedicated XML domains, XMLNSC or XMLNS; there is also an XML domain, but this domain does not support XML namespaces and is provided only for compatibility with WebSphere Message Broker Version 2.
Whether you choose the MRM domain or one of the dedicated XML domains (XMLNSC or XMLNS) depends on the nature of your XML messages and the transformation logic that you want to use. The differentiating features of each domain are described below.
The parser for the MRM domain is model-driven, using a message dictionary that is generated from a message set. This enables the MRM parser to interpret the data in an XML message in an advanced manner.
For example:
The MRM parser can validate XML messages against the model when parsing and serializing.
The model indicates the real data type of a field in the message instead of always treating it as a character string.
Base64 binary data can be automatically decoded.
Date and time information can be extracted from a data value using a specified format string.
When creating output messages, the MRM parser can generate the XML declaration and other XML constructs automatically based on options in the model; this results in simplified transformation logic.
The parsers for the XMLNSC and XMLNS domains are programmatic and do not use a model when parsing.
For example:
All data in an XML message is treated as character strings.
Validation is not possible when parsing and serializing.
Transformation logic must create explicitly all constructs in an output message.
Both parsing and serializing are quicker than with the MRM domain.
The MRM parser discards some parts of an XML message when parsing; for example, the XML declaration, namespace declarations, white space formatting, XML comments, XML processing instructions and inline DTDs. Furthermore, it is not possible to create these constructs when constructing an output message.
The XMLNSC parser, by default, discards white space formatting, XML comments, XML processing instructions and inline DTDs. However, options are provided to preserve all except inline DTDs. It is possible to create all, except inline DTDs, when constructing an output message.
The XMLNS parser preserves all parts of an XML document, including white space formatting. It is possible to create all XML constructs when constructing an output message.
The MRM and XMLNSC parsers build 'compact' message trees that use fewer syntax elements than the XMLNS parser for attributes and simple elements, thus making these parsers more suitable for parsing very large XML messages.
The XMLNS parser builds a message tree that conforms more closely to the XML data model. This is useful if you are accessing the message tree using XPath, and are sensitive to the relative position of parent and child nodes, or are accessing text nodes directly.
Tip: If you need to validate the content and values in XML messages, use the MRM domain.
Tip: If performance is critical, and you do not need to validate XML messages, use the XMLNSC domain.
Tip: If you need to preserve formatting in XML messages on output, use the XMLNSC domain with the option to retain mixed content.
Tip: If you are using XPath to access the message tree, and you require the message tree to conform as closely as possible to the XML data model, use the XMLNS domain.
Tip: If you are taking non-XML data that has been parsed by the CWF or TDS formats of the MRM domain, and simply transforming the data to the equivalent XML, use the MRM domain. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jan 12, 2007 5:14 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
shanson - thanks for this! Very clear and informative.
Now perhaps, the Parser Wars will finally come to an end....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|