Yes, element namespace
default element namespace="zzz"
....
<m-ps-group >
    {...

return this as expected
<m-ps-cd _1:ps-rk-1="8888" xmlns:_1="zzz">8888

--- On Mon, 2/1/10, [email protected] 
<[email protected]> wrote:

From: [email protected] 
<[email protected]>
Subject: General Digest, Vol 68, Issue 1
To: [email protected]
Date: Monday, February 1, 2010, 12:00 PM

Send General mailing list submissions to
    [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
    http://xqzone.com/mailman/listinfo/general
or, via email, send a message with subject or body 'help' to
    [email protected]

You can reach the person managing the list at
    [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of General digest..."


Today's Topics:

   1. Re: 4.1 vs 3.2 attribute namespace (Michael    Blakeley) (Paul M)
   2. RE: Multiple Security Databases (Hartwig, Brent (CL Tech Sv))
   3. Re: Re: 4.1 vs 3.2 attribute namespace    (Michael Blakeley)
      (Michael Blakeley)


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

Message: 1
Date: Mon, 1 Feb 2010 06:38:05 -0800 (PST)
From: Paul M <[email protected]>
Subject: [MarkLogic Dev General] Re: 4.1 vs 3.2 attribute namespace
    (Michael    Blakeley)
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

When you state (in-scope)...

xmlns="msearch" is the in-scope namespace declaration?

If this declaration were not to exist, would a declared default attribute  
namespace be utilized?

Date: Fri, 29 Jan 2010 13:29:34 -0800
From: Michael Blakeley <[email protected]>
Subject: Re: [MarkLogic Dev General] 4.1 vs 3.2 attribute namespace
To: General Mark Logic Developer Discussion
    <[email protected]>
Cc: Paul M <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed

Paul,

If $pr-qname didn't have a namespace in 3.2, that may have been a bug in 
3.2. Per 
http://www.w3.org/TR/xquery-operators/#constructor-qname-notation the 
xs:QName() constructor is affected by in-scope namespace declarations.

In this situation I would use the fn:QName() function, which takes a 
separate namespace parameter. That can be the empty string.

.....
    let $pr-qname := QName('', fn:concat("ps-rk-",$pos))
.....

Alternatively, you could leave $pr-qname as a string.

.....
    let $pr-qname := fn:concat("ps-rk-",$pos)
.....

Either way, the result is the same: the constructed attribute is in the 
empty namespace.

<m-ps-group xmlns="msearch"><m-ps-rk-1>8888</m-ps-rk-1><m-ps-cd 
ps-rk-1="8888">8888</m-ps-cd><m-ps-text 
ps-cd="8888">alleights</m-ps-text></m-ps-group>

-- Mike

On 2010-01-29 10:49, Paul M wrote:
> xquery version "0.9-ml"
>
> define function processm-p() as node()*
> {
>      <m-ps-group xmlns="msearch">
>      {
>     let $pos := "1"
>     let $new-value := "8888"
>     let $ps-text := "alleights"
>     let $pr-qname := xs:QName(fn:concat("ps-rk-",$pos))
>     let $epr-qname := xs:QName(fn:concat("m-ps-rk-",$pos))
>     return (element  {$epr-qname} {$new-value}, element m-ps-cd  
>{attribute   {$pr-qname} {$new-value}, $new-value},<m-ps-text 
>ps-cd="{$new-value}">{$ps-text}</m-ps-text>)
>        }
>     </m-ps-group>
> }
> let $s := processm-p()
> return $s
>
>
> <m-ps-group xmlns="msearch">
> <m-ps-rk-1>8888</m-ps-rk-1>
> <m-ps-cd _1:ps-rk-1="8888" xmlns:_1="msearch">8888</m-ps-cd><m-ps-text 
> ps-cd="8888">alleights</m-ps-text>
> </m-ps-group>
>
>
> When run under 3.2, the attribute ps-rk-1 does not contain a namespace...
>
> So what would be the best method to make certain ps-rk-1 does not have a 
> namespace, if possible?
>     let $pr-qname := xs:QName(fn:concat("ps-rk-",$pos))
> No namespace was specified.
>
>
>
>
>







      




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

Reply via email to