XQuery提供了构造器用于在查询中创建XML结构。构造器可以用来构造XML中除了文档节点之外所有其他类型节点,包括元素节点(element node),属性节点(attribute node),名称空间节点(namespace node),文本节点(text node),处理指令节点(processing-instruction node),注释节点(comment node)。XQuery中的构造器分为以下两种类型:
1,直接构造器(Direct Constructor),使用类似XML的表达形式
2,计算构造器(Computed Constructor),使用基于封闭表达式的表达形式
直接构造器的例子:
<book isbn="isbn-0060229357">
<title>Harold and the Purple Crayon</title>
<author>
<first>Crockett</first>
<last>Johnson</last>
</author>
</book>
1,直接构造器(Direct Constructor),使用类似XML的表达形式
2,计算构造器(Computed Constructor),使用基于封闭表达式的表达形式
直接构造器的例子:
<book isbn="isbn-0060229357">
<title>Harold and the Purple Crayon</title>
<author>
<first>Crockett</first>
<last>Johnson</last>
</author>
</book>
间接构造器的例子:
element book {
attribute isbn {"isbn-0060229357" },
element title { "Harold and the Purple Crayon"},
element author {
element first { "Crockett" },
element last {"Johnson" }
}
}
XQuery提供构造器用于在查询中创建XML结构,可构造除文档节点外的其他类型节点。构造器分为直接构造器和计算构造器,前者用类似XML表达形式,后者用基于封闭表达式的表达形式,文中还给出了两种构造器的示例。
2026

被折叠的 条评论
为什么被折叠?



