xquery error in Oxygen 10.3
Posted: Fri Dec 18, 2009 4:12 pm
When running my xquery (see below) in Oxygen version 10.1 the results are as expected. When running the same xquery in Oxygen version 10.3 however, I get the following error:
"Required item type of value of variable $orderInput is element(*, order); supplied value has item type element({ordernamespace}order, xs:anyType)"
When I remove the vk:order in the xquery element declaration the error disappears. But of course I don’t want to remove this element type definition.
Has anyone any idea why this xquery fails in oxygen 10.3?
order.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<ord:order xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="ordernamespace order.xsd"
xmlns:ord="ordernamespace"
num="123">
<ord:item dept="WMN" number="557" quantity="1" />
</ord:order>
order.xsd file:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="ordernamespace" xmlns:tns="ordernamespace" targetNamespace="ordernamespace" elementFormDefault="qualified" version="1.0">
<xsd:element name="order" type="order"/>
<xsd:complexType name="order">
<xsd:sequence>
<xsd:element name="item" minOccurs="1">
<xsd:complexType>
<xsd:attribute name="number" type="xsd:integer"/>
<xsd:attribute name="dept" type="xsd:string"/>
<xsd:attribute name="quantity" type="xsd:integer"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="num" type="xsd:integer"/>
</xsd:complexType>
</xsd:schema>
order.xquery:
import schema namespace vk = "ordernamespace" at "./order.xsd";
declare namespace xl = "ikBenEenNamespace";
declare namespace ord = "ordernamespace";
declare variable $orderInput as element(*,vk:order) := doc("file:///C:/taco/order.xml")/vk:order;
declare function xl:CreateItem($orderInput as element(*,vk:order))
as element(vk:item) {
$orderInput
};
xl:CreateItem($orderInput)
"Required item type of value of variable $orderInput is element(*, order); supplied value has item type element({ordernamespace}order, xs:anyType)"
When I remove the vk:order in the xquery element declaration the error disappears. But of course I don’t want to remove this element type definition.
Has anyone any idea why this xquery fails in oxygen 10.3?
order.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<ord:order xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="ordernamespace order.xsd"
xmlns:ord="ordernamespace"
num="123">
<ord:item dept="WMN" number="557" quantity="1" />
</ord:order>
order.xsd file:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="ordernamespace" xmlns:tns="ordernamespace" targetNamespace="ordernamespace" elementFormDefault="qualified" version="1.0">
<xsd:element name="order" type="order"/>
<xsd:complexType name="order">
<xsd:sequence>
<xsd:element name="item" minOccurs="1">
<xsd:complexType>
<xsd:attribute name="number" type="xsd:integer"/>
<xsd:attribute name="dept" type="xsd:string"/>
<xsd:attribute name="quantity" type="xsd:integer"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="num" type="xsd:integer"/>
</xsd:complexType>
</xsd:schema>
order.xquery:
import schema namespace vk = "ordernamespace" at "./order.xsd";
declare namespace xl = "ikBenEenNamespace";
declare namespace ord = "ordernamespace";
declare variable $orderInput as element(*,vk:order) := doc("file:///C:/taco/order.xml")/vk:order;
declare function xl:CreateItem($orderInput as element(*,vk:order))
as element(vk:item) {
$orderInput
};
xl:CreateItem($orderInput)