this is my xml file.
<customer>
<Field Number = '1' Value = '3'>
<Name>customer1</Name>
<Length>2</Length>
<Type>regular</Type>
<Method Number = '1'>pay through cash</Method>
<Method Number = '2'>pay through card</Method>
</Field>
<Field Number = '2'>
<Name>customer2</Name>
<Length>2</Length>
<Type>rare</Type>
</Field>
<Field Number = '3'>
<Name>customer3</Name>
<Length>4</Length>
<Type>regular</Type>
</Field>
</customer>
I should parse this file using any parser in java language. But my java source code should not contain any component of xml file ,for example node.getAttributes().getNamedItem("Name").getNodeValue(); in the above instruction i've used "Name" but I'm not supposed to use it. Which parser is efficient for this scenario.even code snippets are welcomed. I must be able to parse this file on the fly and use the tag contents as class members and setter and getter methods.So i,ve used reflection api.
Aucun commentaire:
Enregistrer un commentaire