Esempio n. 1
0
 /**
  * Performs the doc function.
  *
  * @param qc query context
  * @return result
  * @throws QueryException query exception
  */
 ANode doc(final QueryContext qc) throws QueryException {
   final Item it = exprs[0].item(qc, info);
   if (it == null) return null;
   final byte[] in = toToken(it);
   if (!Uri.uri(in).isValid()) throw INVDOC_X.get(info, in);
   return qc.resources.doc(new QueryInput(string(in)), sc.baseIO(), info);
 }
Esempio n. 2
0
  /**
   * Returns a collection.
   *
   * @param qc query context
   * @return collection
   * @throws QueryException query exception
   */
  Value collection(final QueryContext qc) throws QueryException {
    // return default collection
    final Item it = exprs.length == 0 ? null : exprs[0].atomItem(qc, info);
    if (it == null) return qc.resources.collection(info);

    // check if reference is valid
    final byte[] in = toToken(it);
    if (!Uri.uri(in).isValid()) throw INVCOLL_X.get(info, in);
    return qc.resources.collection(new QueryInput(string(in)), sc.baseIO(), info);
  }
Esempio n. 3
0
 /**
  * Returns the name of the geometry type in the GML namespace, or the empty sequence.
  *
  * @param node xml element containing gml object(s)
  * @return integer value of CRS of the geometry
  * @throws QueryException query exception
  */
 @Deterministic
 public Uri srid(final ANode node) throws QueryException {
   return Uri.uri(token(checkGeo(node).getSRID()));
 }