Mindie,

I'd avoid setting the default element namespace in a prolog, like that. Instead, try something like this (porting to xquery 0.9-ml is left as an exercise):

xquery version "1.0-ml";

declare variable $METADATA as element() :=
   <meta><title>this is the title</title></meta>
;

declare function local:get-title($m as element(meta))
  as xs:string
{
   $m/title
};

<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<title>{ local:get-title($METADATA) }</title>
</head>
<body>
<p>this is a test</p>
</body>
</html>

Since local:get-title is outside the scope of the html xmlns decl, it uses the default element namespace, which is still the empty namespace.

-- Mike

Mindie Sorenson wrote:
I have a .xqy file that calls the getTeasers function in the common module:

default element namespace="http://www.w3.org/1999/xhtml";
import module namespace common = "commonFunctions" at 
"../modules/commonFunctions.xqy"

let $featureTeasers := common:getTeasers( $locale, "Feature", $pageName )


I then try to iterate over the results, but I get nothing back except xml.  I'm 
pretty sure it is because the results are in a different namespace, but I can't 
find out how to access them in the correct namespace in my for loop.

<div id="labs-featured">
                        <div id="labs-welcome">
                              <h1>{ common:getString($locale, $pageName, "welcome") 
}</h1>
                              <p>{ common:getString($locale, $pageName, 
"description") }</p>
                </div>
                        {
                    for $teaser in $featureTeasers/teaser
                    let $title as xs:string? := $teaser/title
                        let $teaserText as xs:string? := $teaser/text
                        let $imageName as xs:string? := $teaser/image
                        let $url as xs:string? := $teaser/url
                        order by xs:integer($teaser/@sequence) ascending
                      return $title
                }

                  </div>

Can anyone help?

Thanks
Mindie

----------------------------------------------------------------------
NOTICE: This email message is for the sole use of the intended recipient(s) and 
may contain confidential and privileged information. Any unauthorized review, 
use, disclosure or distribution is prohibited. If you are not the intended 
recipient, please contact the sender by reply email and destroy all copies of 
the original message.



------------------------------------------------------------------------

_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to