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 » I'm trying to get <?xml version="1.0" encoding=

Post new topic  Reply to topic
 I'm trying to get <?xml version="1.0" encoding= « View previous topic :: View next topic » 
Author Message
uliss
PostPosted: Wed Jan 10, 2007 12:57 am    Post subject: I'm trying to get <?xml version="1.0" encoding= Reply with quote

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
View user's profile Send private message
Michael Dag
PostPosted: Wed Jan 10, 2007 1:09 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
kimbert
PostPosted: Wed Jan 10, 2007 1:18 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Hi uliss,

You should
- use the XMLNSC domain ( most people wrongly choose the XML domain )
- Read this page in the docs : http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac26040_.htm
- See this thread : http://www.mqseries.net/phpBB2/viewtopic.php?t=34086&highlight=xml+declaration+xmlnsc
Back to top
View user's profile Send private message
uliss
PostPosted: Wed Jan 10, 2007 1:41 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Wed Jan 10, 2007 2:42 am    Post subject: Reply with quote

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
View user's profile Send private message
jsware
PostPosted: Wed Jan 10, 2007 5:06 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Wed Jan 10, 2007 5:13 am    Post subject: Reply with quote

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
View user's profile Send private message
jsware
PostPosted: Fri Jan 12, 2007 1:39 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Jan 12, 2007 2:57 am    Post subject: Reply with quote

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
View user's profile Send private message
kimbert
PostPosted: Fri Jan 12, 2007 3:54 am    Post subject: Reply with quote

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
View user's profile Send private message
shanson
PostPosted: Fri Jan 12, 2007 5:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri Jan 12, 2007 5:14 am    Post subject: Reply with quote

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
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 » I'm trying to get <?xml version="1.0" encoding=
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.