Skip to content

Cotix/XMLParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

XMLParser

A very simple java XMLParser in under 100 lines and in one single class!

#EXAMPLES

String xml =
                "<import>" +
                    "<student id=1570900      course= TI test = HAI>" +
                        "<name>Noah Goldsmid</name>" +
                        "<username>s1570900</username>" +
                        "<password>awesome</password>" +
                    "</student>" +
                "</import>";
        XMLObject xmlObject;
        try {
            xmlObject = new XMLObject(xml);
            Map<String, String> attr = xmlObject.getChildNodes().get(0).getAttributes();
            for (String name : attr.keySet()) {
                System.out.println("Attribute in Student named " + name + " = " + attr.get(name));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

About

A very simple java XMLParser.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages