XQuery Problem

Hello,

Could anyone help with this?:

I have been trying to execute the following query:

declare namespace dia = “urn:mpeg:mpeg21:2003:01-DIA-NS”
declare namespace xsi = “http://www.w3.org/2001/XMLSchema-instance
declare namespace tf = “http://namespaces.softwareag.com/tamino/TaminoFunction
for $q in input()/dia:DIA
let $y:=$q/dia:Description/@xsi:type
where $y = “AdaptationQoSType”
return $q

where it queries the following line from my .xml file:
dia:Description xsi:type=“dia:AdaptationQoSType”

and I get the error:
“Invalid comparison;Types:QName,string”

I understand that the types are not compatible with each other but is there any other way to run the query and verify the content of the xsi:type attribute?

Thanks

Normally you

does fn:get-local-name-from-QName return what you need here?

Hi,

with Tamino 4.4.1, the following works fine:


declare namespace dia = "urn:mpeg:mpeg21:2003:01-DIA-NS"
declare namespace xsi = "http://www.w3.org/2001/XMLSchema-instance"

for $q in input()/dia:DIA
let $y:=$q/dia:Description/@xsi:type
where $y = "dia:AdaptationQoSType"
return $q 

regards

Harald

Hello,

thank you all for your replies. The version of my Tamino Server is 4.4.1.3, the following code didnt work in my system and generated the same error as stated in my first post:


declare namespace dia = "urn:mpeg:mpeg21:2003:01-DIA-NS"
declare namespace xsi = "http://www.w3.org/2001/XMLSchema-instance"

for $q in input()/dia:DIA
let $y:=$q/dia:Description/@xsi:type
where $y = "dia:AdaptationQoSType"
return $q 

finally, the solution was given using fn:get-local-name-from-QName (thanks Douglas Kelly) with the following code:


declare namespace dia = "urn:mpeg:mpeg21:2003:01-DIA-NS"
declare namespace xsi = "http://www.w3.org/2001/XMLSchema-instance"
declare namespace fn = "http://www.w3.org/2002/08/xquery-functions"
for $q in input()/dia:DIA
let $y:=$q/dia:Description/@xsi:type
where fn:get-local-name-from-QName($y)="AdaptationQoSType"
return $q