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 » Message broker issue

Post new topic  Reply to topic
 Message broker issue « View previous topic :: View next topic » 
Author Message
Neelamegam
PostPosted: Mon Jun 23, 2008 12:37 am    Post subject: Message broker issue Reply with quote

Newbie

Joined: 22 Jun 2008
Posts: 1

I am trying to insert a Dom Object inside a MB element and i have written this method below.I am passing the DOM object and reference of MBElement as a parameter to this method.I am iterating the DOM object and trying to create the same structure but unfortunately all the tags are are coming in root node of the reference. Moreover some empty tags are showing up as well. <></>.The intent of the for loop at the end of this method is to recusively call this method till all the tags are read and similar MBelement structre has to be created.
Can someone suggest me where iam going wrong?.



private void addDOMtoMbElement(Node n, MbElement mbApplMsg) throws MbException {


String nodeName;
String nodeValue;
Hashtable htAttributes = null;


int type = n.getNodeType();

switch (type) {
case Node.ATTRIBUTE_NODE:
break;
case Node.CDATA_SECTION_NODE:
break;
case Node.COMMENT_NODE:
break;
case Node.DOCUMENT_FRAGMENT_NODE:
break;
case Node.DOCUMENT_NODE:
break;
case Node.DOCUMENT_TYPE_NODE:
break;
case Node.ELEMENT_NODE:
nodeName = n.getNodeName();
nodeValue = n.getTextContent();
mhLogger.writeLog ("[JavaTest::addDOMtoMbElement] nodeName "+nodeName+ "Node value ="+nodeValue);
htAttributes = returnAttrib(n);
mbApplMsg.createElementAsLastChild(com.ibm.broker.plugin.MbXML.ELEMENT, nodeName, nodeValue);

/*if(ht!=null)
{
for(Enumeration e = ht.keys(); e.hasMoreElements() {
mb.createElementAsLastChild(MbXMLNSC.ATTRIBUTE, (String)e.nextElement(), ht.get(e.nextElement()));
}
}*/

break;
case Node.ENTITY_NODE:
break;
case Node.ENTITY_REFERENCE_NODE:
break;
case Node.NOTATION_NODE:
break;
case Node.PROCESSING_INSTRUCTION_NODE:
break;
case Node.TEXT_NODE:
break;
default:
break;
}


MbElement mbApplMsgChild =mbApplMsg.createElementAsLastChild(com.ibm.broker.plugin.MbXML.ELEMENT);
// Print children if any


for (Node child = n.getFirstChild(); child != null; child = child.getNextSibling()) {

if(child.getNodeType()==Node.ELEMENT_NODE){
mbApplMsgChild = mbApplMsgChild.createElementAsLastChild(com.ibm.broker.plugin.MbXML.ELEMENT);

}


addDOMtoMbElement(child,mbApplMsgChild);
}

}
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Message broker issue
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.