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

Method parse

basex-core/src/main/java/org/basex/query/func/fn/ParseFn.java:76–88  ·  view source on GitHub ↗

Reads the specified value and invokes #parse(TextInput, Options, QueryContext). Returns an XQuery value for the parsed data. @param qc query context @return resulting item @throws QueryException query exception

(final QueryContext qc)

Source from the content-addressed store, hash-verified

74 * @throws QueryException query exception
75 */
76 protected Value parse(final QueryContext qc) throws QueryException {
77 final Item value = arg(0).atomItem(qc, info);
78 if(value.isEmpty()) return Empty.VALUE;
79
80 final IO io = new IOContent(toBytes(value));
81 try(TextInput ti = nl() ? new NewlineInput(io) : new TextInput(io)) {
82 return parse(ti.fallback(false), options(qc), qc);
83 } catch(final DecodingException ex) {
84 throw RECDECODING_X.get(info, ex);
85 } catch(final IOException ex) {
86 throw exception(ex);
87 }
88 }
89
90 /**
91 * Reads the source and invokes {@link #parse(TextInput, Options, QueryContext)}.

Callers 15

docMethod · 0.95
toDOMNodeMethod · 0.45
valueMethod · 0.45
itemMethod · 0.45
valueMethod · 0.45
valueMethod · 0.45
valueMethod · 0.45
itemMethod · 0.45
valueMethod · 0.45
valueMethod · 0.45
itemMethod · 0.45
testMethod · 0.45

Calls 9

nlMethod · 0.95
optionsMethod · 0.95
exceptionMethod · 0.95
toBytesMethod · 0.80
getMethod · 0.65
atomItemMethod · 0.45
argMethod · 0.45
isEmptyMethod · 0.45
fallbackMethod · 0.45

Tested by

no test coverage detected