|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
XML attribute creation with Java Compute Node |
« View previous topic :: View next topic » |
Author |
Message
|
crossland |
Posted: Wed Aug 20, 2008 1:34 am Post subject: XML attribute creation with Java Compute Node |
|
|
Master
Joined: 26 Jun 2001 Posts: 248
|
My Java program needs to build an output XML message with attributes based on an incoming message.
For example, the first line of input and output should be:
Code: |
<?xml version="1.0" encoding="UTF-8"> |
The problem is that there doesn't appear to be a means of creating elements with attributes in Java. Although the documentation is at best wooly, I can't see any means of doing this. Has anyone managed to use Java to create an element of the format shown above?
The best I have managed is to produce the following, which looks a little on the ugly side:
Code: |
<XmlDeclaration>
<Version>1.0</Version>
|
etc. |
|
Back to top |
|
 |
crossland |
Posted: Wed Aug 20, 2008 3:54 am Post subject: |
|
|
Master
Joined: 26 Jun 2001 Posts: 248
|
In case anyone comes across this problem in the future, the secret is to look for the answer under "Developing ESQL", not under "Developing Java".
Under "Manipulating messages under the XMLNSC parser", the following example is given:
Code: |
CreateElementAsFirstChild(MbXMLNSC.ATTRIBUTE, "Version", "1.0")
|
For a future release, can I suggest that the documentation is updated to list MbXMLNSC.ATTRIBUTE as a valid parameter for CreateElementAsFirstChild? |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|