MCPcopy Create free account
hub / github.com/BaseXdb/basex / parse

Method parse

basex-core/src/main/java/org/basex/core/parse/XMLParser.java:37–54  ·  view source on GitHub ↗
(final ArrayList<Command> cmds)

Source from the content-addressed store, hash-verified

35 }
36
37 @Override
38 protected void parse(final ArrayList<Command> cmds) throws QueryException {
39 try {
40 final DBNode node = new DBNode(IO.get(input));
41 String query = "/*";
42 if(!string(COMMANDS + " ! name()", node).isEmpty()) {
43 query = COMMANDS + query;
44 if(!string(COMMANDS + "/text()", node).isEmpty()) {
45 throw error(Text.SYNTAX + Text.COLS + '<' + COMMANDS + "><...></" + COMMANDS + '>');
46 }
47 }
48 try(QueryProcessor qp = new QueryProcessor(query, ctx).context(node)) {
49 for(final Item item : qp.value()) cmds.add(command((XNode) item).baseURI(path));
50 }
51 } catch(final IOException ex) {
52 throw error(Text.STOPPED_AT + '%', ex);
53 }
54 }
55
56 /**
57 * Returns a command.

Callers 1

runMethod · 0.45

Calls 9

getMethod · 0.95
stringMethod · 0.95
errorMethod · 0.95
commandMethod · 0.95
addMethod · 0.65
isEmptyMethod · 0.45
contextMethod · 0.45
valueMethod · 0.45
baseURIMethod · 0.45

Tested by

no test coverage detected