I am relatively new to xml parsing and I just started using the commons-digester tools and it seems like it might fit my needs.
First let me apologize to all you seasoned pros in the field of XML in the event that my question seems too simple or if I am just not using the right terminology.
My question is as follows.
The particular XML that I am working with and in need to parse is composed as follows:
<?xml version="1.0"?> <IDTDebitInterface> <UserInfo> <username>Juan</username> <password>Alvarado</password> </UserInfo> <DebitRequests ReportSuccesses="true"> <DebitRequest id="1" type="misctrans"> <account>123</account> <amount>10</amount> <transtype>vendordebit</transtype> <note>Test</note> <balancetozero>n</balancetozero> </DebitRequest> </DebitRequests> </IDTDebitInterface>
As you can see, the node <DebitRequests ReportSuccesses="true"> contains an attribute ReportSuccesses="true". I need to be able to grab that value so that it can be populated into my corresponding bean. Additionally there might be times when there is more than one attribute in a given node and obviously I would need to get those values also. Could someone please tell me if this is possible and if so, how to accomplish this.
NEXT QUESTION:
My application not only has to parse this XML stream, but we also have to create this XML from in certain situations. We might for example receive a request through the web with the necessary parameters and values needed to construct the XML and then pass on to the next layer. Can anyone tell me if the digester framework can handle this and if so, I'd appreciate some sample code.
Thanks in advance.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
