XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Hans-Juergen RennauSubject: copy-namespaces mode
Author: Hans-Juergen Rennau
Date: 01 Nov 2006 07:26 PM
Hello,

does the stylus XQuery processor implement the copy-namespaces mode strictly according to the W3C recommendation? It seems to me - not quite, at least as far as document constructors are concerned. The query

declare copy-namespaces no-preserve, inherit;
document {
<a xmlns:ns1="example.ns1">
<ns1:b>bla1</ns1:b>
<ns1:b>bla2</ns1:b>
</a>
}

should produce a result in which <a> does not have any in-scope namespaces (thanks to "no-preserve"). However, I get this:

<a xmlns:ns1="example.ns1">
<ns1:b>bla1</ns1:b>
<ns1:b>bla2</ns1:b>
</a>

Or is this to be explained by a serialization process which strives to place namespace declaration attributes intelligently, though not warranted by the actual in-scope namespaces?

The example looks strained, but I want to know exactly what the processor does, rather than guess.

Thank you for information -
Hans-Juergen Rennau

Postnext
(Deleted User) Subject: Re: copy-namespaces mode
Author: (Deleted User)
Date: 02 Nov 2006 06:00 AM
Hi Hans-Juergen,
it looks you have found a bug in the XQuery processor: the
construction of document nodes ignores the copy-namespace directive.
You will get the same results of Saxon if you wrap that node in
another element, e.g.

declare copy-namespaces no-preserve, inherit;
document {
<root><a xmlns:ns1="example.ns1">
<ns1:b>bla1</ns1:b>
<ns1:b>bla2</ns1:b>
</a></root>
}

The bug will be fixed in the next update of Stylus.

Thanks for reporting this,
Alberto

Postnext
Hans-Juergen RennauSubject: copy-namespaces mode
Author: Hans-Juergen Rennau
Date: 05 Nov 2006 06:27 PM
Hello Alberto,

thank you very much for the prompt information!

Unfortunately, I did not quite understand your remark about Saxon, related to the example you gave. At any rate, trying out your example with Saxon (as well as with the built-in processor), I got the correct results, or so it seemed to me. If you wanted to point out something else, it would be kind to let me know.

Kind regards -
Hans-Juergen


Postnext
(Deleted User) Subject: copy-namespaces mode
Author: (Deleted User)
Date: 06 Nov 2006 03:14 AM
Hi Hans-Juergen,
I'm sorry my remark was not clear; I was trying to say that both processors (Stylus and Saxon) return the same result if the <a> element is a children of another element, instead of a children of a document node.
Alternatively, it means that Stylus does support the copy-namespace property, but there was a bug when document nodes were involved.

Hope this helps,
Alberto

Posttop
Hans-Juergen RennauSubject: copy-namespaces mode
Author: Hans-Juergen Rennau
Date: 10 Nov 2006 04:06 PM
Thank you, Alberto!

Hans-Juergen

 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.