Hi,
I don’t know how to access to any branch which uses other imported schema.
I mean, when I try to access for example to the branch of this schema “rp210Elements:FrameworkTitle” It return an error.
Can anybody help me?
A little more information might help us answer your question. What did you expect to get? What do you mean by “don’t work”—did you get a result different from what you expected, or an error? If it was an error, what was the error message?
Also, I expect this was a copy/paste error, but your “two possibilities” look identical to me.
One other thing—in general, you should avoid ‘//’ in path expressions for performance reasons.
This is my involved schemas and the xml file test.
To remember the question I want to access to any branch which uses
other imported schema.
So when I try to access for example to the branch of this schema
“rp210Elements:FrameworkTitle” to get the element=“Nijinski Production
version1” I can’t do it.
the XQuery cannot work, because you did not declare the namespace.
Hint: there is a documentation for each error code (e.g. INOXQE6354) in the manual. In this case it reads:
INOXQE6354 Namespace prefix undefined
Explanation
The namespace declaration is missing.
Action
Include a namespace declaration in the XQuery prolog.
There is also a section on XQuery Syntax in the manual.
So you should change the query to something like
declare namespace rp210Elements="urn:SMPTE:Dictionary"
for $b in input()//rp210Elements:FrameworkTitle
return $b
Thanks a lot, it really works!!!
My new problem is when I try to insert that query as Java code.
It works with the Tamino XQuery tool. But I have now a new problem, cos that line that include a namespace declaration in the XQuery prolog gives me an error.
In this case I got a result:
query = “for $b in input()/DVD/Media return $b”
TXQuery querysome = TXQuery.newInstance( query );
But in this query return the ERROR INOXQE6352:
“declare namespace rp210Elements=“urn:SMPTE:Dictionary” for $b in input()//rp210Elements:FrameworkTitle return $b”
I don’t know how could I solve it.
Can anyone help me? I will be very grateful for it.
Regards,
Diego