<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Andrew Welch schrieb:
<blockquote
 cite="mid74a894af0708150643v5284a62bn9fcbafc44f544ba4@mail.gmail.com"
 type="cite">
  <pre wrap="">On 8/15/07, Uwe K&uuml;ssner <a class="moz-txt-link-rfc2396E" href="mailto:uwekuessner@web.de">&lt;uwekuessner@web.de&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">hello,

a short question, i hope somebody can help.

Let's say we have a XML documents like this:

&lt;ele xmlns:a="aa"  xmlns:b="bb"  name="foo" a:name="bar"
b:name="foobar"  b:x="y" /&gt;

The namespace names and attributes are not known before runtime, during
runtime of a xquery script we have two variables of type string, for
example:
$namespace := "bb"
$attribute :="name"

here is the question: how can we extract the value of the attribute
named $attribute with namespace name $namespace?
In the example the value of  "b:name", i.e. "foobar".
    </pre>
  </blockquote>
  <pre wrap=""><!---->
How about:

@*[name() eq concat($namespace,':',$attribute)]/data(.)


  </pre>
</blockquote>
<br>
almost,&nbsp; the problem with your solution&nbsp; is that $namespace is not&nbsp;
prefix&nbsp; "b" itself , but the&nbsp; namespace name (uri) ("bb"). Is it
possible to get the prefix for a given namespace name ?<br>
</body>
</html>