0% found this document useful (0 votes)
109 views

Berkeley DB XML Reference Card

This document provides reference information for the Berkeley DB XML API, including descriptions of classes, methods, and supported data types. It lists the core functionality for working with XML documents, containers, indexes, queries, transactions, and more through the Berkeley DB XML API.

Uploaded by

markrosso
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views

Berkeley DB XML Reference Card

This document provides reference information for the Berkeley DB XML API, including descriptions of classes, methods, and supported data types. It lists the core functionality for working with XML documents, containers, indexes, queries, transactions, and more through the Berkeley DB XML API.

Uploaded by

markrosso
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Berkeley DB XML Reference Card

DbEnv
Constructor flags:
DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_RECOVER

BDB XML version 2.2.13.


Methods (cont. for XmlManager):
removeContainer([txn,] name) renameContainer([txn,] oldname, newname) setDefaultContainerFlags(flags) setDefaultContainerType(type) setDefaultPageSize(pagesize) upgradeContainer(name, ucontext) verifyContainer(name, outfile, flags)
flags: DB_SALVAGE, DB_SALVAGE|DB_AGGRESSIVE

Index string format:


unique-{path type}-{node type}-{key type}-{syntax}
path types: node types: key types: syntaxes: node, edge element, attribute, metadata presence, equality, substring none, anyURI, base64Binary, boolean, date, dateTime, dayTimeDuration, decimal, double, duration, float, gDay, gMonth, gMonthDay, gYear, gYearMonth, hexBinary, NOTATION, QName, string, time,

Methods:
open($dir [,flags] [,mode]) close($flags)

DbXml
Class methods:
setLogCategory(category, bool)
categories: CATEGORY_MANAGER, CATEGORY_CONTAINER, CATEGORY_INDEXER, CATEGORY_QUERY, CATEGORY_OPTIMIZER, CATEGORY_DICTIONARY, CATEGORY_NODESTORE, CATEGORY_ALL LEVEL_DEBUG, LEVEL_INFO, LEVEL_WARNING, LEVEL_ERROR, LEVEL_ALL

XmlContainer
Methods:
addAlias(alias) addIndex([txn,] uri, name, index, ucontext) addDefaultIndex([txn,] index, ucontext) deleteDocument([txn,] name (or document), ucontext) deleteIndex([txn,] uri, name, index, ucontext) deleteDefaultIndex([txn,] index, ucontext) getAllDocuments([txn,] flags)
flags: DBXML_LAZY_DOCS, DB_RMW, DBXML_REVERSE_ORDER, DB_DEGREE_2, DB_DIRTY_READ

XmlIndexSpecification
Methods:
addIndex(uri, name, index) addDefaultIndex(index) deleteIndex(uri, name, index) deleteDefaultIndex(index) find(uri, name, index*) getDefaultIndex() next() replaceIndex(uri, name, index) replaceDefaultIndex(index) reset()

setLogLevel(level, bool)
levels:

dbxml_version(major, minor, patch)

XmlManager
Constructor args:
[dbenv] [,flags]

Constructor flags:
DBXML_ALLOW_EXTERNAL_ACCESS, DBXML_ALLOW_AUTO_OPEN, DBXML_ADOPT_DBENV

getContainerType() getDocument([txn,] name, flags)


flags: DBXML_LAZY_DOCS, DB_RMW, DB_DEGREE_2, DB_DIRTY_READ

Methods:
createContainer([txn,] name, [,flags] [,type] [,mode])
flags: DB_CREATE, DB_EXCL, DB_RDONLY, DB_DIRTY_READ, DB_NOMMAP, DB_THREAD, DB_XA_CREATE, DB_TXN_NOT_DURABLE, DBXML_CHKSUM, DBXML_ENCRYPT, DBXML_INDEX_NODES, DBXML_TRANSACTIONAL, DBXML_ALLOW_VALIDATION XmlContainer::NodeContainer, XmlContainer::WholedocContainer

types:

createDocument() createIndexLookup(container, uri, name, index, value, op)


ops: XmlIndexLookup::NONE, ::EQ, ::LT, ::LTE, ::GT, ::GTE

getIndexNodes() getIndexSpecification([txn,] flags) getManager() getName() getNumDocuments([txn]) getPageSize() lookupStatistics([txn,] uri, name, parent_uri, parent_name, index [,val]) putDocument([txn,] name, stream (or content), ucontext [,flags]) putDocument([txn,] name, document, ucontext [,flags])
flags: DBXML_GEN_NAME

XmlQueryContext
Methods:
clearNamespaces() removeNamespace(prefix) setDefaultCollection(uri) setNamespace(prefix, uri) setBaseURI(uri) setEvaluationType(type)
types: XmlQueryContext::Eager, XmlQueryContext::Lazy

createLocalFileInputStream(filename) createMemBufInputStream(bytes, count, buffer) createModify() createQueryContext(rt, et)


et: XmlQueryContext::LiveValues, XmlQueryContext::DeadValues rt: XmlQueryContext::Eager, XmlQueryContext::Lazy

createResults() createStdInInputStream() createTransaction([txn,] flags)


flags: DB_DEGREE_2, DB_DIRTY_READ, DB_TXN_NOSYNC, DB_TXN_NOWAIT, DB_TXN_SYNC

removeAlias(alias) replaceIndex([txn,] uri, name, index, ucontext) replaceDefaultIndex([txn,] index, ucontext) setIndexSpecification([txn,] indexspec, ucontext) sync() updateDocument([txn,] document, ucontext)

setReturnType(type)
types: XmlQueryContext::LiveValues, XmlQueryContext::DeadValues

setVariableValue(name, value)

XmlQueryExpression
Methods:
execute([txn,] [contextitem,] qcontext, flags)
flags: DBXML_LAZY_DOCS, DB_DIRTY_READ, DB_DEGREE_2. DB_RMW

XmlDocument
Methods:
fetchAllData() getContent() getContentAsDOM() getContentAsXmlInputStream() getMetaData(uri, name, value) getMetaDataIterator() getName() removeMetaData(uri, name) setContent(content (or xmldata or stream)) setContentAsDOM(xercesdom) setContentAsXmlInputStream(stream) setMetaData(uri, name, string (or xmlvalue)) setName(name)

createURLInputStream(baseid, systemid [,publicid]) createUpdateContext() dumpContainer(name, outfile) existsContainer(name) getDbEnv() getHome() loadContainer(name, inputstream, lineno, ucontext) openContainer([txn,] name [,flags] [,type] [,mode]) prepare([txn,] query, qcontext) query(txn,] query, qcontext, flags)
flags: DBXML_LAZY_DOCS, DB_DEGREE_2, DB_DIRTY_READ, DB_RMW

getQuery() getQueryPlan()

XmlResults
Methods:
add(xmlvalue) hasNext() hasPrevious() next(xmlvalue (or document)*) peek(xmlvalue (or document)*) previous(xmlvalue (or document)*) reset() size() Copyright 2006 by Danny Brian

reindexContainer([txn,] name, ucontext, flags)

Berkeley DB XML Reference Card


XmlTransaction
Methods:
abort() commit([flags])
flags: DB_TXN_NOSYNC, DB_TXN_SYNC

BDB XML version 2.2.13. XmlValue


Constructor args:
[value (or document)] [type,] [value (or document)]
types: XmlValue::NONE, XmlValue::NODE, XmlValue::ANY_SIMPLE_TYPE, XmlValue::ANY_URI, XmlValue::BASE_64_BINARY, XmlValue::BINARY, XmlValue::BOOLEAN, XmlValue::DATE, XmlValue::DATE_TIME, XmlValue::DAY_TIME_DURATION, XmlValue::DECIMAL, XmlValue::DOUBLE, XmlValue::DURATION, XmlValue::FLOAT, XmlValue::G_DAY, XmlValue::G_MONTH, XmlValue::G_MONTH_YEAR, XmlValue::G_YEAR, XmlValue::G_YEAR_MONTH, XmlValue::HEX_BINARY, XmlValue::NOTATION, XmlValue::QNAME, XmlValue::STRING, XmlValue::TIME, XmlValue::YEAR_MONTH_DURATION, XmlValue::UNTYPED_ATOMIC

XmlException
Methods:
what() getExceptionCode() getDbError()

createChild() getDbTxn()

XML Schema Data Types:


item() node() xdt:anyAtomicType attribute() comment() document-node() element() namespace() processing-instruction() text() xs:anyURI xs:base64Binary xs:boolean xs:byte xs:date xs:dateTime xdt:dayTimeDuration xs:decimal xs:double xs:duration xs:float xs:gDay xs:gMonth xs:gMonthDay xs:gYear xs:gYearMonth xs:hexBinary xs:ID xs:IDREF xs:IDREFS xs:int xs:integer xs:language xs:long xs:Name xs:NCName xs:negativeInteger xs:nonNegativeInteger xs:nonPositiveInteger xs:normalizedString xs:NOTATION xs:positiveInteger xs:QName xs:short xs:string xs:time xs:token xs:unsignedByte xs:unsignedInt xs:unsignedLong xs:unsignedShort xdt:untypedAtomic xdt:yearMonthDuration

XmlUpdateContext
Methods:
setApplyChangesToContainers(bool) getApplyChangesToContainers()

XmlModify
Methods:
addAppendStep(expr, type, name, content [,location]) addInsertAfterStep(expr, type, name, content) addInsertBeforeStep(expr, type, name, content)
types: XmlModify::Element, ::Attribute, ::Text, ::ProcessingInstruction, ::Comment

addRemoveStep(expr) addRenameStep(expr, newname) addUpdateStep(expr, content) execute([txn,] tomodify, content, ucontext)

Methods:
getType() isType(type) isBoolean() isBinary() isNumber() isString() isNode() isNull() asBoolean() asBinary() asDocument() asNode() asNumber() asString() equals(value) getNodeName() getNodeValue() getNamespaceURI() getPrefix() getLocalName() getNodeType() getParentNode() getFirstChild() getLastChild() getPreviousSibling() getNextSibling() getAttributes() getOwnerElement()

XmlStatistics
Methods:
getNumberOfIndexedKeys() getNumberOfUniqueKeys()

XmlMetaDataIterator
Methods:
next(uri, name, value) reset()

XQuery Functions:
abs(number) adjust-dateTime-to-timezone(dateTime, time zone) adjust-date-to-timezone(date, time zone) adjust-time-to-timezone(time, time zone) avg(seq) base-uri(node) boolean(seq) ceiling(number) codepoints-to-string(sequence) collection(string) compare(string1, string2) concat(string1, ...) contains(string1, string2) count(seq) current-date() current-dateTime() current-time() data(seq) day-from-date(date) day-from-dateTime(dateTime) days-from-duration(duration) dbxml:metadata() deep-equal(seq, seq) default-collation() distinct-values(seq) doc(string) document-uri(node) empty(seq) ends-with(string1, string2) error(item) escape-uri(string, boolean) exactly-one(seq) exists(seq) false() floor(number) hours-from-dateTime(dateTime) hours-from-duration(duration) hours-from-time(time) id(string)* idref(string)* implicit-timezone() index-of(seq, item) in-scope-prefixes(element)insert-before(seq1, position, seq2) lang(string) last() local-name(node) local-name-from-QName(stringQName) lower-case(string) matches(string, pattern) max(seq) min(seq) minutes-from-dateTime(dateTime) minutes-from-duration(duration) minutes-from-time(time) month-from-date(date) month-from-dateTime(dateTime) months-from-duration(duration) name(node) namespace-uri(node) namespace-uri-for-prefix(element, string) namespace-uri-from-QName(QName) node-name(node) normalize-space(string) normalize-unicode(string)not(expr) number(expr) one-or-more(seq) position() QName(namespace, local name) remove(seq, position) replace(string, pattern1, pattern2) resolve-QName(string, element) resolve-uri(string) reverse(seq) root(node) round(number) round-half-to-even(number) seconds-from-dateTime(date) seconds-from-duration(duration) seconds-from-time(time) starts-with(string1, string2) string(item) string-join(seq, delim) string-length(string) string-to-codepoints(string) subsequence(seq, position1, position2) substring(string, position1, position2) substring-after(string1, string2) substring-before(string1, string2) sum(seq) timezone-from-date(date) timezone-from-dateTime(dateTime) timezone-from-time(time) tokenize(string1, string2) trace(seq, string) translate(string1, string2, string3) true() unordered(seq) upper-case(string) year-from-date(date) year-from-dateTime(dateTime) years-from-duration(duration) zero-or-one(seq)

Copyright 2006 by Danny Brian

You might also like