Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Need help to extract node using JAVA Xpath

From: brahatha <BrahathaVenkat@-----.--->
To: NULL
Date: 6/5/2007 8:09:00 AM

I am trying to come up with a Java code where I can read a xml file
and extract particular element/attribute. This is the structure of xml
I have

<RootElement>
  <colAttempt>
     <Attempt1 a="1" b="abc>
             <ResultElement Result = "123" Msg="success">
                    <nodeList>
                           <NodeIwant nodeName="conf" noFail="1">
                                <Data ProgId="294"/>
                           </NodeIwant>
                           <NodeIwant nodeName="nconf" noFail="0">
                                 <Data ProgId="3"/>
                           </NodeIwant>
                      </nodeList>
             </ResultElement>

    </Attempt1>
     <Attempt2 c="2" d="abc>
            <ResultElement Result = "123" Msg="success">
                    <nodeList>
                           <NodeIwant nodeName="xyz" noFail="0">
                                   <Data ProgId="4"/>
                           </NodeIwant>
                       </nodeList>
             </ResultElement>

    </Attempt2>

</colAttempt>
</RootElement>

I need to extract <NodeIwant nodeName="" noFail =""> for each
iteration of Attempt.In the above example, I have two Attempts ( 1 and
2 ). So my output should show, for attempt 1 following result
 <NodeIwant nodeName="conf" noFail="1">
<NodeIwant nodeName="nconf" noFail="0">

For attempt 2 following
<NodeIwant nodeName="xyz" noFail="0">

So final result should be like this,

Attempt 1:
<NodeIwant nodeName="conf" noFail="1">
<NodeIwant nodeName="nconf" noFail="0">
Attempt 2:
<NodeIwant nodeName="xyz" noFail="0">

NEED HELP!



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent