Values for all of these elements are required and based on the value of topic element I want to select the topic to publish this message to. In this case the value of topic element in the configuration file is timecard so my topic for this message has to be timecard. Now, the elements till the body elements are all part of my header and I don't want to send the header as part of my message. Once the header information(all header elements are present) is verified (if not I want to throw an exception), I want to send the CDATA(if not empty) which is the message body as part of my JMS message.
Please help me in solving this problem. I am ok in validating the XML file before send it as a message but verifying the header information and choosing the topic on the basis of the topic element is what I need help with.
choosing the topic on the basis of the topic element is what I need help with.
Extracting the text content of an element is a basic XML processing task. You will find it covered extensively in the many XML tutorials to be found on the net. You also need to become familiar with the API that describes the structure of XML documents to be found in the org.w3c.dom package in your JavaDocs. Start with the org.w3c.dom.Node interface.
RNivas - you need to go make your name compatible with the Javaranch naming policy before a sheriff gets on your case. Bill