An ElementTest is used to match an element node by its name and/or type annotation. An ElementTest may take any of the following forms. In these forms, ElementName need not be present in the in-scope element declarations, but TypeName must be present in the in-scope schema types [err:XPST0008]. Note that substitution groups do not affect the semantics of ElementTest. ... element(*, TypeName) matches an element node regardless of its name, if derives-from(AT, TypeName) is true, where AT is the type annotation of the element node, and the nilled property of the node is false.
私はこの機能を持っている私は返しますエラー入力していながら
import schema namespace cdm-base="http://cdm.basic.upc.com" at "file:///Workspace/peal/peal40/trunk/common/schema/cdm-basic.xsd";
declare function local:matchType(
$input as element()
) as element(*,cdm-base:ProductComponent..) {
<cdm-base:product xsi:type="cdm-base:ProductComponent" />
};
:
F [Saxon-EE XQuery 9.3.0.5] Required item type of result of function local:matchType() is element(*, ProductComponent); supplied value has item type element({http://cdm.basic.upc.com}product, {http://www.w3.org/2001/XMLSchema}untyped)
を私かもしれない誤解が、タイプは実際にはcdm-base:ProductComponentであり、型なしではありません。問題がどこにある 私は...私はサクソンEEと酸素13.0を使用しています
を得ることはありません9.3.0.5
エラーが{http://www.w3.org/2001/XMLSchema}untyped、私がhttp://www.w3を持っている間に記述しているので、タイプが探しているように見えます。 org/2001/XMLSchema-instance しかし、どの属性が期待していますか? declare namespace xsi = "http://www.w3.org/2001/XMLSchema-instance"; declare namespace xs = "http://www.w3.org/2001/XMLSchema"; – AleIla