データエレメントの double 値を取得します。
getDoubleValue() : double
getDoubleValue(xpath:string) : double
getDoubleValue(xpath:string, selectionNS:NamespaceContext) : double
パラメータ | 説明 |
---|---|
xpath | 文書に関連付けられたエレメントの XPath です。 |
selectionNS | namespace コンテキストです。 |
戻り値 | 説明 |
---|---|
double | エレメントの double 値。 |
スキーマでは、 このデータエレメントを double と定義する必要があります。データプロパティでは、 関連あるフィールドの表示タイプが Number でなければなりません。
XPath が名前空間プレフィックスを含む場合は、 第 2 パラメータで名前空間を定義し、 最初に新規の NamespaceContextImpl オブジェクトを 作成してから addNamespace で 名前空間を追加してください。
var dc = database.getAllDocuments();
if(dc.getDocumentCount() > 0) {
if(requestScope.i != null &&
requestScope.i >= 0 &&
requestScope.i < dc.getDocumentCount()) {
var ar = dc.getDocumentArray(requestScope.i + 1);
var doc = ar[i];
var schema = doc.getDocumentElement();
var elem = schema.getFirstChild();
requestScope.y = elem.getDoubleValue();
} else {
requestScope.msg = "No such document";
}
} else {
requestScope.msg = "No documents in database";
}
<schema0>
<element2>33.9</element2>
</schema0>
var dc = database.getAllDocuments();
if(dc.getDocumentCount() > 0) {
if(requestScope.i != null &&
requestScope.i >= 0 &&
requestScope.i < dc.getDocumentCount()) {
var ar = dc.getDocumentArray(requestScope.i + 1);
var doc = ar[i];
var elem = doc.getDocumentElement();
requestScope.y = elem.getDoubleValue("/schema0/element2");
} else {
requestScope.msg = "No such document";
}
} else {
requestScope.msg = "No documents in database";
}
var dc = database.getAllDocuments();
if(dc.getDocumentCount() > 0) {
if(requestScope.i != null &&
requestScope.i >= 0 &&
requestScope.i < dc.getDocumentCount()) {
var ns = new NamespaceContextImpl();
ns.addNamespace("p", "http://mynamespace.com");
var ar = dc.getDocumentArray(requestScope.i + 1);
var doc = ar[i];
var elem = doc.getDocumentElement();
requestScope.y = elem.getDoubleValue("/p:schema0/p:element2", ns);
} else {
requestScope.msg = "No such document";
}
} else {
requestScope.msg = "No documents in database";
}