XQuery expression problem

Hello,
I am using Tamino Schema Editor 4.1.1.1 on Windows 2000 Pro.
I have a problem with XQuery.
XQuery expression is as follows.

declare namespace user=“http://schema.icon.or.kr/user.xsd
declare namespace company=“http://schema.icon.or.kr/company.xsd
for $e in input()/user:user[@id=“20030418210319968”],
$d in input()/company:company
where $e/companyId=$d/@id
return

{$e}


{$d/company:name/text()}


{$d/ceo/company:name/text()}




I set the indexing companyId element of user:user schema and id attribute of company:company schema.
Both defined standard index.

I received the following message.

<ino:messagetext ino:code=“INOXQE6367”>Compile time type exception</ino:messagetext>


I think that error message occur in where clause.
Is there any way to solve XQuery? Thanks in advance.

:wink:
QnA.zip (3.59 KB)

sorry.
common.tsd missed.
I attached common.tsd.
common.TSD (1.76 KB)

Hello Heo, Ju-Young.

After installing your schemas and the documents, I did some experiments and found that the “Compile time type exception” only occurs when the attribute with a standard index is used on the right-hand side of a comparison.

If you change the where clause so that the attribute is on the left-hand side, it works!
(That is, change the where clause to this:
where $d/@id=$e/companyId )

You original query works if you change the schema to have either no index or a text index on the “id” attribute (in “company”).

I don’t think that this is the intended behaviour(!), so I recommend that you report this problem to your local Software AG Customer Support Center to ensure that it is solved for you.

I hope that helps,
Trevor.

[This message was edited by Trevor Ford on 23 Apr 2003 at 21:40.]

Hello, Trevor.
Thank you for your help.
And I reported this problem to Software AG Customer Support Center.