gpt4 book ai didi

javax.xml.xquery.XQItemAccessor.getAtomicValue()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 04:34:40 25 4
gpt4 key购买 nike

本文整理了Java中javax.xml.xquery.XQItemAccessor.getAtomicValue()方法的一些代码示例,展示了XQItemAccessor.getAtomicValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XQItemAccessor.getAtomicValue()方法的具体详情如下:
包路径:javax.xml.xquery.XQItemAccessor
类名称:XQItemAccessor
方法名:getAtomicValue

XQItemAccessor.getAtomicValue介绍

[英]Gets the current item as a Java String. The current item must be an atomic value. This function casts the current item to an xs:string value according to the casting rules defined in 17.1.2 Casting to xs:string and xs:untypedAtomic, XQuery 1.0 and XPath 2.0 Functions and Operators, and then returns the value as a Java String.
[中]以Java[$0$]的形式获取当前项。当前项必须是原子值。此函数根据17.1.2 Casting to xs:string and xs:untypedAtomic, XQuery 1.0 and XPath 2.0 Functions and Operators中定义的强制转换规则,将当前项强制转换为xs:string值,然后以Java[$2$]的形式返回该值。

代码示例

代码示例来源:origin: dsukhoroslov/bagri

protected Collection<String> fetchQueryResults(String query, Map<String, Object> params, Properties props) throws Exception {
  List<String> result = new ArrayList<>();
  try (ResultCursor<XQItemAccessor> cursor = query(query, params, props)) {
    for (XQItemAccessor item: cursor) {
      result.add(item.getAtomicValue());
    }
  }
  return result;
}

代码示例来源:origin: dsukhoroslov/bagri

private Collection<String> toCollection(ResultCursor<XQItemAccessor> cursor) throws BagriException {
  if (cursor == null) {
    return null;
  }
  
  try {
    List<String> result = new ArrayList<>();
    for (XQItemAccessor item: cursor) {
      result.add(item.getAtomicValue());
    }
    return result;
  } catch (XQException ex) {
    throw new BagriException(ex, BagriException.ecQuery);
  }
}

代码示例来源:origin: dsukhoroslov/bagri

if (command.equals(cmd_store_document)) {
  XQItemAccessor item = getBoundItem(params, "uri");
  String uri = item.getAtomicValue();
  item = getBoundItem(params, "doc");
  String xml = item.getItemAsString(null);
} else if (command.equals(cmd_remove_document)) {
  XQItemAccessor item = getBoundItem(params, "uri");
  String uri = item.getAtomicValue();
  dMgr.removeDocument(uri, null);
  return Collections.emptyIterator();

代码示例来源:origin: dsukhoroslov/bagri

DocumentKey fraKey = factory.newDocumentKey(uri, revision, version);
try {
  String fragment = item.getAtomicValue();
  String fUri = baseUri + ".r" + revision + ".v" + version + ext;
  Document doc = loadDocument(fraKey, fUri, fragment, srcFormat, createdAt, createdBy, txStart, collections, props);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com