[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Content constructors and sequences

Subject: RE: Content constructors and sequences
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Wed, 9 Jan 2002 14:43:48 -0000
RE:  Content constructors and sequences
> Mike, could you expand on this comment:
>   If a variable $v references such a node,
>   then when the node is added to a document, the value of
>   count($v/ancestor::*) is going to change.
>    .... My worries may be misplaced (the data model suggests
> that when a
>    node is added to a tree,
> ah maybe you already answered my question, but I'd still be interested
> to know what adding a node to a tree would mean (is this
> perhaps related
> to the xquery update question?

Yes, it is defined in the data model to work in terms of copying. So
conceptually, you create a sequence of child nodes, then you add these nodes
to a new parent element or document, which is done by creating copies of the
child nodes. So in principle, mutability shouldn't be a problem if you
follow this model: any variables are left pointing to the child node as it
was before you made the copy, and the value of count($v/ancestor::*) doesn't

So another way of expressing my worries is, that if you actually have to
make a physical copy, and give each node a new identity, then it's going to
be horribly expensive. Perhaps there's an implementation solution based on
reference counting - you only need to actually copy a node if there are
variables that reference it - but I'd like to be convinced.

There are other problems with rootless nodes, for example what are the
in-scope namespaces for a parentless attribute node?

I'm not saying it doesn't work - just that the complexities haven't been
fully explored yet.

Mike Kay

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.