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)
| 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)}. |
no test coverage detected