Search in sources :

Example 1 with TreeElementParser

use of org.javarosa.xml.TreeElementParser in project javarosa by opendatakit.

the class ExternalDataInstance method buildFromPath.

public static ExternalDataInstance buildFromPath(String path, String instanceId) throws IOException, UnfullfilledRequirementsException, XmlPullParserException, InvalidStructureException {
    String absolutePath = getPathPrefix() + path;
    KXmlParser xmlParser = ElementParser.instantiateParser(new FileInputStream(absolutePath));
    TreeElementParser treeElementParser = new TreeElementParser(xmlParser, 0, instanceId);
    TreeElement root = treeElementParser.parse();
    return new ExternalDataInstance(path, instanceId, root);
}
Also used : KXmlParser(org.kxml2.io.KXmlParser) TreeElementParser(org.javarosa.xml.TreeElementParser) FileInputStream(java.io.FileInputStream)

Aggregations

FileInputStream (java.io.FileInputStream)1 TreeElementParser (org.javarosa.xml.TreeElementParser)1 KXmlParser (org.kxml2.io.KXmlParser)1