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 » XML attribute creation with Java Compute Node

Post new topic  Reply to topic
 XML attribute creation with Java Compute Node « View previous topic :: View next topic » 
Author Message
crossland
PostPosted: Wed Aug 20, 2008 1:34 am    Post subject: XML attribute creation with Java Compute Node Reply with quote

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
View user's profile Send private message
crossland
PostPosted: Wed Aug 20, 2008 3:54 am    Post subject: Reply with quote

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
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 » XML attribute creation with Java Compute Node
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.