Hello,
I am also not sure whether you want to use Tamino XQuery 4 or X-Query.
If you want to access objectref Mapping in Tamino XQuery 4 you have to formulate the join your self in the query. To get the same effect as the objectref mapping you can use such a query:
for $a in input()/collaboration
return {
$a/node() [local-name(.) != “jazzMusician”],
$a/@,
for $c in input()/jazzMusician
where $a/jazzMusician/@ID = $c/@ID
return {
$a/jazzMusician/text(),
$c/node(),
$c/@
}
}
Depending on whether you have mixed content or you know your elements in the query, the query can be simpler.
The query is for the attached example schema in a documentation chapter.
Best regards
Walter
<xs:element name = “collaboration”>
xs:complexType
xs:sequence
<xs:element name = “name” type = “xs:string”>
xs:annotation
xs:appinfo
tsd:elementInfo
tsd:physical
tsd:native
tsd:index
tsd:standard</tsd:standard>
</tsd:index>
</tsd:native>
</tsd:physical>
</tsd:elementInfo>
</xs:appinfo>
</xs:annotation>
</xs:element>
xs:choice
<xs:element name = “performedAt”>
xs:complexType
xs:all
<xs:element name = “location” type = “xs:string”></xs:element>
<xs:element name = “time” type = “xs:dateTime”></xs:element>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name = “period”>
xs:complexType
xs:sequence
<xs:element name = “from” type = “xs:date”></xs:element>
<xs:element name = “to” type = “xs:date” minOccurs = “0”></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
<xs:element name = “jazzMusician” minOccurs = “2” maxOccurs = “unbounded”>
xs:complexType
<xs:attribute name = “ID” type = “xs:NMTOKEN” use = “required”>
xs:annotation
xs:appinfo
tsd:attributeInfo
tsd:physical
tsd:native
tsd:index
tsd:standard</tsd:standard>
</tsd:index>
tsd:objectRef
tsd:collectionRefencyclopedia1</tsd:collectionRef>
<tsd:accessPredicate operator = “=”>
tsd:nodeRefjazzMusician/@ID</tsd:nodeRef>
</tsd:accessPredicate>
</tsd:objectRef>
</tsd:native>
</tsd:physical>
</tsd:attributeInfo>
</xs:appinfo>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name = “result” minOccurs = “0” maxOccurs = “unbounded”>
xs:complexType
<xs:attribute name = “albumNo” type = “xs:NMTOKEN” use = “required”></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name = “type” use = “required”>
xs:simpleType
<xs:restriction base = “xs:NMTOKEN”>
<xs:enumeration value = “jamSession”></xs:enumeration>
<xs:enumeration value = “project”></xs:enumeration>
<xs:enumeration value = “band”></xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name = “ID” type = “xs:NMTOKEN” use = “required”></xs:attribute>
</xs:complexType>
</xs:element>
#API-Management#Tamino#webMethods