Merge lp:~zorba-coders/zorba/structuralrelationships2 into lp:zorba

Proposed by Federico Cavalieri
Status: Superseded
Proposed branch: lp:~zorba-coders/zorba/structuralrelationships2
Merge into: lp:zorba
Diff against target: 7696 lines (+7054/-35)
51 files modified
ChangeLog (+2/-0)
modules/com/zorba-xquery/www/modules/CMakeLists.txt (+2/-0)
modules/com/zorba-xquery/www/modules/node-position.xq (+524/-0)
src/context/static_context.cpp (+4/-0)
src/context/static_context.h (+1/-0)
src/functions/library.cpp (+2/-0)
src/functions/pregenerated/func_node_position.cpp (+584/-0)
src/functions/pregenerated/func_node_position.h (+361/-0)
src/functions/pregenerated/function_enum.h (+24/-0)
src/runtime/nodes/node_position_impl.cpp (+756/-0)
src/runtime/nodes/pregenerated/node_position.cpp (+710/-0)
src/runtime/nodes/pregenerated/node_position.h (+858/-0)
src/runtime/spec/mappings.xml (+5/-1)
src/runtime/spec/nodes/node_position.xml (+439/-0)
src/runtime/visitors/pregenerated/planiter_visitor.h (+120/-0)
src/runtime/visitors/pregenerated/printer_visitor.cpp (+337/-0)
src/runtime/visitors/pregenerated/printer_visitor.h (+72/-0)
src/store/api/item.h (+84/-0)
src/store/api/store.h (+9/-0)
src/store/naive/atomic_items.cpp (+719/-0)
src/store/naive/atomic_items.h (+185/-0)
src/store/naive/item.cpp (+127/-0)
src/store/naive/loader_fast.cpp (+3/-5)
src/store/naive/node_items.cpp (+73/-4)
src/store/naive/node_items.h (+6/-1)
src/store/naive/ordpath.cpp (+94/-0)
src/store/naive/ordpath.h (+11/-4)
src/store/naive/pul_primitives.cpp (+21/-19)
src/store/naive/simple_item_factory.cpp (+31/-1)
src/store/naive/simple_item_factory.h (+10/-0)
src/store/naive/simple_store.cpp (+42/-0)
src/store/naive/simple_store.h (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_1.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_1_parsed.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_2.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_2_parsed.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_3.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_3_parsed.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_4.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_4_parsed.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_err.xml.res (+6/-0)
test/rbkt/Queries/zorba/nodes/position.xml (+15/-0)
test/rbkt/Queries/zorba/nodes/position_1.xq (+97/-0)
test/rbkt/Queries/zorba/nodes/position_1_parsed.xq (+98/-0)
test/rbkt/Queries/zorba/nodes/position_2.xq (+157/-0)
test/rbkt/Queries/zorba/nodes/position_2_parsed.xq (+156/-0)
test/rbkt/Queries/zorba/nodes/position_3.xq (+32/-0)
test/rbkt/Queries/zorba/nodes/position_3_parsed.xq (+34/-0)
test/rbkt/Queries/zorba/nodes/position_4.xq (+84/-0)
test/rbkt/Queries/zorba/nodes/position_4_parsed.xq (+81/-0)
test/rbkt/Queries/zorba/nodes/position_err.xq (+60/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/structuralrelationships2
Reviewer Review Type Date Requested Status
Matthias Brantner Approve
Markos Zaharioudakis Approve
Review via email: mp+78395@code.launchpad.net

This proposal has been superseded by a proposal from 2011-11-02.

Commit message

New module node-structural-information.
This module allows to retrieve an xs:anyURI representation of a
node position. This module also defines function that determine:
(1) the relationship between two nodes (e.g. if one is the ancestor
of another) and (2) properties of a node (e.g. its level in the tree)
given the corresponding nodes positions.

Description of the change

New module node-structural-information.
This module allows to retrieve an xs:anyURI representation of a
node position. This module also defines function that determine:
(1) the relationship between two nodes (e.g. if one is the ancestor
of another) and (2) properties of a node (e.g. its level in the tree)
given the corresponding nodes positions.

To post a comment you must log in.
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job structuralrelationships2-2011-10-06T12-27-03.031Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 0, Disapprove < 1. Got: 1 Pending.

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

Not mentioned in ChangeLog

function name too long? node-structural-information

difference between following-in-document-order-of following-of? Following is always in document order.

zerr:: => zerr:

creating a structural URI may raise an error. However, non of the functions of the module catches the error and adds a query location to it.

review: Needs Fixing
Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

> Not mentioned in ChangeLog

Fixed

> function name too long? node-structural-information

Any suggestions?

node-information
node-position
node-uri
structural-information

>
> difference between following-in-document-order-of following-of? Following is
> always in document order.
>

If we consider a node n in a document d:
following-of: the nodes which start tag occurs after the end tag of n and are in d. Ie. the following axis in Xpath
"From the spec ... the following axis contains all nodes that are descendants of the root of the tree in which the context node is found, are not descendants of the context node, and occur after the context node in document order"

following-in document-order-of: the nodes which start tag occurs after the start tag of n and are in d, but also nodes in other documents. Ie the << operator in Xpath

"From the spec ... The relative order of nodes in distinct trees is stable but implementation-dependent, subject to the following constraint: If any node in a given tree T1 is before any node in a different tree T2, then all nodes in tree T1 are before all nodes in tree T2."

> zerr:: => zerr:
Fixed
>
> creating a structural URI may raise an error. However, non of the functions of
> the module catches the error and adds a query location to it.
Fixed and added new test

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

> > function name too long? node-structural-information
>
> Any suggestions?
>
> node-information
> node-position
> node-uri
> structural-information
I like node-information as name for both - the module and the function.
That's at least consistent with the node-reference module and function.

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

> > > function name too long? node-structural-information
> >
> > Any suggestions?
> >
> > node-information
> > node-position
> > node-uri
> > structural-information
> I like node-information as name for both - the module and the function.
> That's at least consistent with the node-reference module and function.

Fixed

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Attempt to merge into lp:zorba failed due to conflicts:

text conflict in ChangeLog

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

> > > > function name too long? node-structural-information
> > >
> > > Any suggestions?
> > >
> > > node-information
> > > node-position
> > > node-uri
> > > structural-information
> > I like node-information as name for both - the module and the function.
> > That's at least consistent with the node-reference module and function.
>
> Fixed

I dislike the name "node-information" because it conveys no information about what the module is doing. I think "node-position", though not perfect, is the most accurate one. The comments in the .xq file speak of "node positions" as well.

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

> > > > > function name too long? node-structural-information
> > > >
> > > > Any suggestions?
> > > >
> > > > node-information
> > > > node-position
> > > > node-uri
> > > > structural-information
> > > I like node-information as name for both - the module and the function.
> > > That's at least consistent with the node-reference module and function.
> >
> > Fixed
>
> I dislike the name "node-information" because it conveys no information about
> what the module is doing. I think "node-position", though not perfect, is the
> most accurate one. The comments in the .xq file speak of "node positions" as
> well.
I'm fine with node-position.

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

Renamed the module and function to node-position.
How should I replace "structural information" in the functions comments?
"node position uri"?

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

> Renamed the module and function to node-position.
> How should I replace "structural information" in the functions comments?
> "node position uri"?

I rewrote somewhat the introductory comment in node-position.xq. Here is the new version:

(:~
 : This module provides a function (np:node-position) that, given a node,
 : returns positional information about the node in the form of an xs:anyURI
 : item. The module also defines functions that use such positional information
 : to determine: (1) positional relationships between two nodes (e.g. if one
 : is the ancestor of another) and (2) positional properties of a single node
 : (e.g. its level in the tree).
 :
 : Within this module, the term "node position" will be used to refer to an
 : xs:anyURI item that is returned by the np:node-position function.
 :
 : @author Federico Cavalieri
 :)

If everybody agrees with my rewrite, then the answer to your question is "node position".

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

Federico, I don't think it is necessary to put the position uris into the uri pool because they are not likely to be shared by multiple data items so you won't really be saving much space (you may be actually end-up wasting space because the uri pool storage has some overhead by itself). Do you agree?

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

Should StructuralAnyUriItem::isDescendant() check that the "other" node is not an attribute?

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

> Should StructuralAnyUriItem::isDescendant() check that the "other" node is not
> an attribute?

Yes, you are right! Descendant doesn't include attributes.

May I add a in-subtree-of function with the same semantics as the current descendant?

Thanks
Federico

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

> Federico, I don't think it is necessary to put the position uris into the uri
> pool because they are not likely to be shared by multiple data items so you
> won't really be saving much space (you may be actually end-up wasting space
> because the uri pool storage has some overhead by itself). Do you agree?

I agree.
Fixing it.

Thanks
Federico

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

> > Should StructuralAnyUriItem::isDescendant() check that the "other" node is
> not
> > an attribute?
>
> Yes, you are right! Descendant doesn't include attributes.
>
> May I add a in-subtree-of function with the same semantics as the current
> descendant?
>
> Thanks
> Federico

It's ok with me, if it is something that you need in your module.

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

Hi Markos,
i noticed that the parse uri function now uses strtoul without checking errno with the following effects:

A missing component is considered 0:
np:in-same-tree-of(xs:anyURI("zorba:..1.50"),xs:anyURI("zorba:0.0.1.50")) ->true

Out of ulong value-space == ULONG_MAX
np:in-same-tree-of(xs:anyURI("zorba:.3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333.1.50"),xs:anyURI("zorba:0.222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222.1.50")) ->true

Is this ok?

Thanks
Federico

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

> Hi Markos,
> i noticed that the parse uri function now uses strtoul without checking errno
> with the following effects:
>
> A missing component is considered 0:
> np:in-same-tree-of(xs:anyURI("zorba:..1.50"),xs:anyURI("zorba:0.0.1.50"))
> ->true
>
>
> Out of ulong value-space == ULONG_MAX
> np:in-same-tree-of(xs:anyURI("zorba:.33333333333333333333333333333333333333333
> 33333333333333333333333333333333333333333333333333333333333333333333.1.50"),xs
> :anyURI("zorba:0.2222222222222222222222222222222222222222222222222222222222222
> 22222222222222222222222222222222222222222222.1.50")) ->true
>
> Is this ok?
>
> Thanks
> Federico

No, it not ok of course. It's a bug (and a similar bug existed before the switch to strtoul as well). I think I have fixed it now (and added the above 2 tests in position_err.xq). Take a look.

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

> > Hi Markos,
> > i noticed that the parse uri function now uses strtoul without checking
> errno
> > with the following effects:
> >
> > A missing component is considered 0:
> > np:in-same-tree-of(xs:anyURI("zorba:..1.50"),xs:anyURI("zorba:0.0.1.50"))
> > ->true
> >

> >
> > Out of ulong value-space == ULONG_MAX
> > np:in-same-tree-
> of(xs:anyURI("zorba:.33333333333333333333333333333333333333333
> >
> 33333333333333333333333333333333333333333333333333333333333333333333.1.50"),xs
> >
> :anyURI("zorba:0.2222222222222222222222222222222222222222222222222222222222222
> > 22222222222222222222222222222222222222222222.1.50")) ->true
> >
> > Is this ok?
> >
> > Thanks
> > Federico
>
> No, it not ok of course. It's a bug (and a similar bug existed before the
> switch to strtoul as well). I think I have fixed it now (and added the above 2
> tests in position_err.xq). Take a look.

Ok, thanks.

I think there is a bug in level because the ordpath of a document node as root contains a different
number of components than those of another kind of node as root. see ctor of ordpath.
Why

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

Connection dropped...

Do you know why document nodes have a component less than any other kind of node when they are the root of their tree?

Another question, tree ids are expected to be unique among all tree currently in the store, or not?

Thanks,
Federico

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

> Connection dropped...
>
> Do you know why document nodes have a component less than any other kind of
> node when they are the root of their tree?
>

I finally found out what you meant (the code is in the OrdPathNode ctor, not the OrdPath ctor).
I think the reason why element node as root has an extra component in its ordpath is to support fn:put on element nodes. The w3c tests require that whatever is fn:put-ed, is retrievable by fn:doc(), which means that I have to put a doc node as parent to the element node. But I think this can be fixed, because the element node is going to be copied anyway.

> Another question, tree ids are expected to be unique among all tree currently
> in the store, or not?

Yes, this is the assumption, although it is not really enforced in the simplestore. Why do you ask?

>
> Thanks,
> Federico

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

Federico, I think the documentation in node-position.xq needs some more work. I can do this, but first we must agree on what is exactly the functionality and the assumptions about node positions that you rely on. For example, in the documentation of the np:node-position() function, you write:

"The returned URI is stable, i.e. it does not change when other nodes are inserted, deleted or modified"

Do you rely on this? If not, then we shouldn't write it down.

Also, look at the following rewrite of the ancestor-of function. Do you agree with it?

(:~
 : Determines whether the node position that is given as second argument is
 : an ancestor of the node position is given as first argument.
 :
 : If the two positions were obtained within the same snapshot S, then the
 : result of the function applies to the corresponding nodes as well, that
 : is, within snapshot S, the second node is an ancestor of the first.
 : Otherwise, the result of the function does not imply anything about the
 : positional relationship of the two nodes.
 :
 : @param $pos1 the potential descendant node position
 : @param $pos2 the potential ancestor node position
 :
 : @return true if the node position $pos2 is an ancestor of the node position
 : $pos1; false otherwise.
 :
 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
 : position computed by the <tt>np:node-position</tt> function.
 :)
declare function np:ancestor-of(
  $pos1 as xs:anyURI,
  $pos2 as xs:anyURI) as xs:boolean external;

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

> > Connection dropped...
> >
> > Do you know why document nodes have a component less than any other kind of
> > node when they are the root of their tree?
> >
>
> I finally found out what you meant (the code is in the OrdPathNode ctor, not
> the OrdPath ctor).
> I think the reason why element node as root has an extra component in its
> ordpath is to support fn:put on element nodes. The w3c tests require that
> whatever is fn:put-ed, is retrievable by fn:doc(), which means that I have to
> put a doc node as parent to the element node. But I think this can be fixed,
> because the element node is going to be copied anyway.

Sorry for the wrong name. I wrote while I was travelling and I made a mistake in
remembering the class name. Hope you didn't lose time figuring that out.
And thanks for making the change.

>
> > Another question, tree ids are expected to be unique among all tree
> currently
> > in the store, or not?
>
> Yes, this is the assumption, although it is not really enforced in the
> simplestore. Why do you ask?
>

At the time I wrote that I was experiencing some bugs in my main branch after trying to merge this one into.
Specifically i was failing to check if two nodes were in the same tree.
Apparently node in different trees had the same tree id.

Since then I investigated the issue and found out that treeids are unique only within their collection or within the collection-less nodes. The store seems to be designed with this in mind and either checks if the tree itself is the same or check the collectionid first.

This behaviour is because XmlTree::setCollection() in node_items.cpp does

    theId = collection->createTreeId();

and not:

    theId = GET_STORE().createTreeId();

and each collection in turn uses an internally incremented integer starting from 0.

This make sense for me, since it limit the risk of going out of range with the integers, but also means
that almost every single function I wrote should also check the collection id to determine if two nodes are in the same tree. I am doing this modification right now.

Federico
> >
> > Thanks,
> > Federico

Cheers
Federico

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

> Federico, I think the documentation in node-position.xq needs some more work.
> I can do this, but first we must agree on what is exactly the functionality
> and the assumptions about node positions that you rely on. For example, in the
> documentation of the np:node-position() function, you write:
>
> "The returned URI is stable, i.e. it does not change when other nodes are
> inserted, deleted or modified"
>
> Do you rely on this? If not, then we shouldn't write it down.

Yes, at the moment I am relying on it. It could be possible however, with some
limitations, to lift off this requirements. I have not a clear idea at the moment
of the limitations involved or the amount of work required to do so. If you think
is bad to promise that uri are stable I can look into it.

>
> Also, look at the following rewrite of the ancestor-of function. Do you agree
> with it?
>
> (:~
> : Determines whether the node position that is given as second argument is
> : an ancestor of the node position is given as first argument.
> :
> : If the two positions were obtained within the same snapshot S, then the
> : result of the function applies to the corresponding nodes as well, that
> : is, within snapshot S, the second node is an ancestor of the first.
> : Otherwise, the result of the function does not imply anything about the
> : positional relationship of the two nodes.
> :
> : @param $pos1 the potential descendant node position
> : @param $pos2 the potential ancestor node position
> :
> : @return true if the node position $pos2 is an ancestor of the node position
> : $pos1; false otherwise.
> :
> : @error zerr:ZAPI0028 if one of the given URI is not a valid node
> : position computed by the <tt>np:node-position</tt> function.
> :)
> declare function np:ancestor-of(
> $pos1 as xs:anyURI,
> $pos2 as xs:anyURI) as xs:boolean external;

Yes, I agree with it. When I wrote this I was a little scared to say that a
structural relationship was ancestor of another, but now that they are called
node positions it should be ok. I am doing it.

Federico

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

> > Federico, I think the documentation in node-position.xq needs some more
> work.
> > I can do this, but first we must agree on what is exactly the functionality
> > and the assumptions about node positions that you rely on. For example, in
> the
> > documentation of the np:node-position() function, you write:
> >
> > "The returned URI is stable, i.e. it does not change when other nodes are
> > inserted, deleted or modified"
> >
> > Do you rely on this? If not, then we shouldn't write it down.
>
> Yes, at the moment I am relying on it. It could be possible however, with some
> limitations, to lift off this requirements. I have not a clear idea at the
> moment
> of the limitations involved or the amount of work required to do so. If you
> think
> is bad to promise that uri are stable I can look into it.
>

It's ok if you rely on this, but I am not sure I understand what it means exactly. Obviously, it is not entirely correct in the current implementation: Consider 2 nodes P and C, where C is a child of P; if P is deleted, the result of node-position(C) before P's deletion is different than after P's deletion (because P and its subtree become part of a new tree). In other words, the node position of C changes when P is deleted. Maybe we should say that the node position of a node is stable as long as the node remains in its current collection and tree?

Second, when you say that you rely on it, does it mean that you may need to compare 2 node positions that were obtained in different snapshots? And if so, do you expect that the result of such a comparison says anything about the positional relationship of the two corresponding nodes at any point in time? (in other words, is what I wrote for the is-ancestor function really correct?)

> >
> > Also, look at the following rewrite of the ancestor-of function. Do you
> agree
> > with it?
> >
> > (:~
> > : Determines whether the node position that is given as second argument is
> > : an ancestor of the node position is given as first argument.
> > :
> > : If the two positions were obtained within the same snapshot S, then the
> > : result of the function applies to the corresponding nodes as well, that
> > : is, within snapshot S, the second node is an ancestor of the first.
> > : Otherwise, the result of the function does not imply anything about the
> > : positional relationship of the two nodes.
> > :
> > : @param $pos1 the potential descendant node position
> > : @param $pos2 the potential ancestor node position
> > :
> > : @return true if the node position $pos2 is an ancestor of the node
> position
> > : $pos1; false otherwise.
> > :
> > : @error zerr:ZAPI0028 if one of the given URI is not a valid node
> > : position computed by the <tt>np:node-position</tt> function.
> > :)
> > declare function np:ancestor-of(
> > $pos1 as xs:anyURI,
> > $pos2 as xs:anyURI) as xs:boolean external;
>
> Yes, I agree with it. When I wrote this I was a little scared to say that a
> structural relationship was ancestor of another, but now that they are called
> node positions it should be ok. I am doing it.
>
> Federico

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :
Download full text (3.3 KiB)

> >"The returned URI is stable, i.e. it does not change when other nodes are
> > inserted, deleted or modified"

> Obviously, it is not entirely correct in the current implementation:
> Consider 2 nodes P and C, where C is a child of P; if P is deleted, the result
> of node-position(C) before P's deletion is different than after P's deletion
> (because P and its subtree become part of a new tree). In other words, the
> node position of C changes when P is deleted. Maybe we should say that the
> node position of a node is stable as long as the node remains in its current
> collection and tree?

Yes, you are right. However even with the limitation you propose another problem
would arise in the current implementation. (ie. TEXT_ORDPATH off)
Consider 3 nodes C1 C2 and C3 children of a node P. Assume that C2 is a text node.
This means that its ordpath is computed on the fly. If C1 is labeled 1.1 and C3 1.3,
the label of C2 would be 1.2.1. Now if you remove C3 and compute again the label of
C2 it would be 1.3. That is not stable even if it remains in the same collection and
tree.

I am removing the whole phrase.

> Second, when you say that you rely on it, does it mean that you may need to
> compare 2 node positions that were obtained in different snapshots? And if so,
> do you expect that the result of such a comparison says anything about the
> positional relationship of the two corresponding nodes at any point in time?
> (in other words, is what I wrote for the is-ancestor function really correct?)

I am (was?*) relying on the fact that the label of two nodes belonging to the
same tree do not change over time. I am (was?*) interseted in some of the relations
(ie. ancestor-descendant) which are not affected by the text node ordpath on-the-fly
computation.

* Just noticed that TEXT_ORDPATH off means that in the interested cases I can no longer
store some the ordpaths in the PUL, so the problem should not exist anymore.

>
>
>
> > >
> > > Also, look at the following rewrite of the ancestor-of function. Do you
> > agree
> > > with it?
> > >
> > > (:~
> > > : Determines whether the node position that is given as second argument
> is
> > > : an ancestor of the node position is given as first argument.
> > > :
> > > : If the two positions were obtained within the same snapshot S, then the
> > > : result of the function applies to the corresponding nodes as well, that
> > > : is, within snapshot S, the second node is an ancestor of the first.
> > > : Otherwise, the result of the function does not imply anything about the
> > > : positional relationship of the two nodes.
> > > :
> > > : @param $pos1 the potential descendant node position
> > > : @param $pos2 the potential ancestor node position
> > > :
> > > : @return true if the node position $pos2 is an ancestor of the node
> > position
> > > : $pos1; false otherwise.
> > > :
> > > : @error zerr:ZAPI0028 if one of the given URI is not a valid node
> > > : position computed by the <tt>np:node-position</tt> function.
> > > :)
> > > declare function np:ancestor-of(
> > > $pos1 as xs:anyURI,
> > > $pos2 as xs:anyURI) as xs:boolean external;
> >
> > Yes, I agree with it. When I...

Read more...

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

> Second, when you say that you rely on it, does it mean that you may need to
> compare 2 node positions that were obtained in different snapshots? And if so,
> do you expect that the result of such a comparison says anything about the
> positional relationship of the two corresponding nodes at any point in time?
> (in other words, is what I wrote for the is-ancestor function really correct?)

What you write for the ancestor function (which i copied also in the other functions)
is correct although, given the current implementation, extra information would be present.

For the sake of curiosity i tried to write the most precise definition possible,
but I don't think that putting this into the methods comment would be an improvement:

The result of the function applies to the corresponding nodes as well,
in each snapshot S in which they belong to the same tree in which they
belonged when the node position was computed.

Follow/preceed in document order would be:
If the two positions correspond to sibling text nodes and both
positions were obtained in the same snapshot, then the function also applies
in each snapshot S in which they belong to the same tree in which they
belonged when the node position was computed.

If the two positions correspond to sibling text nodes and the two
positions were obtained in different snapshots, then it is impossible to determine
if the node corresponding to the first position is a predecessor of the node
corresponding to the second position.

In all other cases, the result of the function applies to the corresponding
nodes as well, in each snapshot S in which they belong to the same tree and
collection in which they belonged when the node position was computed.

Cheers,
Federico

Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Attempt to merge into lp:zorba failed due to conflicts:

text conflict in ChangeLog
text conflict in src/store/naive/simple_store.cpp

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog'
--- ChangeLog 2011-11-02 15:48:06 +0000
+++ ChangeLog 2011-11-02 17:26:24 +0000
@@ -57,6 +57,8 @@
57 * Fixed bug #872796 (validate-in-place can interfere with other update primitives)57 * Fixed bug #872796 (validate-in-place can interfere with other update primitives)
58 * Fixed bug #872799 (validate-in-place can set incorrect types)58 * Fixed bug #872799 (validate-in-place can set incorrect types)
59 * Fixed bug #855715 (Invalid escaped characters in regex not caught)59 * Fixed bug #855715 (Invalid escaped characters in regex not caught)
60 * New node-position module. This module allows to obtain a representation of a node position, which
61 can be used to assess structural relationships with other nodes.
60 * Fixed bug #872502 (validation of the JSON module xqdoc fails)62 * Fixed bug #872502 (validation of the JSON module xqdoc fails)
6163
62version 2.0.164version 2.0.1
6365
=== modified file 'modules/com/zorba-xquery/www/modules/CMakeLists.txt'
--- modules/com/zorba-xquery/www/modules/CMakeLists.txt 2011-09-30 08:08:13 +0000
+++ modules/com/zorba-xquery/www/modules/CMakeLists.txt 2011-11-02 17:26:24 +0000
@@ -46,6 +46,8 @@
46 URI "http://www.zorba-xquery.com/modules/math")46 URI "http://www.zorba-xquery.com/modules/math")
47DECLARE_ZORBA_MODULE(FILE node-reference.xq VERSION 2.047DECLARE_ZORBA_MODULE(FILE node-reference.xq VERSION 2.0
48 URI "http://www.zorba-xquery.com/modules/node-reference")48 URI "http://www.zorba-xquery.com/modules/node-reference")
49DECLARE_ZORBA_MODULE(FILE node-position.xq VERSION 2.0
50 URI "http://www.zorba-xquery.com/modules/node-position")
49DECLARE_ZORBA_MODULE(FILE node.xq VERSION 2.051DECLARE_ZORBA_MODULE(FILE node.xq VERSION 2.0
50 URI "http://www.zorba-xquery.com/modules/node")52 URI "http://www.zorba-xquery.com/modules/node")
51DECLARE_ZORBA_MODULE(FILE project_xqdoc.xq VERSION 2.053DECLARE_ZORBA_MODULE(FILE project_xqdoc.xq VERSION 2.0
5254
=== added file 'modules/com/zorba-xquery/www/modules/node-position.xq'
--- modules/com/zorba-xquery/www/modules/node-position.xq 1970-01-01 00:00:00 +0000
+++ modules/com/zorba-xquery/www/modules/node-position.xq 2011-11-02 17:26:24 +0000
@@ -0,0 +1,524 @@
1xquery version "1.0";
2(:
3 : Copyright 2006-2011 The FLWOR Foundation.
4 :
5 : Licensed under the Apache License, Version 2.0 (the "License");
6 : you may not use this file except in compliance with the License.
7 : You may obtain a copy of the License at
8 :
9 : http://www.apache.org/licenses/LICENSE-2.0
10 :
11 : Unless required by applicable law or agreed to in writing, software
12 : distributed under the License is distributed on an "AS IS" BASIS,
13 : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 : See the License for the specific language governing permissions and
15 : limitations under the License.
16 :)
17
18(:~
19 : This module provides a function (np:node-position) that, given a node,
20 : returns positional information about the node in the form of an xs:anyURI
21 : item. The module also defines functions that use such positional information
22 : to determine: (1) positional relationships between two nodes (e.g. if one
23 : is the ancestor of another) and (2) positional properties of a single node
24 : (e.g. its level in the tree).
25 :
26 : Within this module, the term "node position" will be used to refer to an
27 : xs:anyURI item that is returned by the np:node-position function.
28 :
29 : @author Federico Cavalieri, Markos Zaharioudakis
30 :
31 : @project XDM/node
32 :)
33module namespace np = "http://www.zorba-xquery.com/modules/node-position";
34
35declare namespace ver = "http://www.zorba-xquery.com/options/versioning";
36declare option ver:module-version "2.0";
37
38(:~
39 : Return a URI item containing positional information for a given node.
40 :
41 : <p>Within a snapshot, each has a different positional URI. However,
42 : different nodes in different snapshots might have the same URI.</p>
43 :
44 : @param $arg the node for which the positional information URI
45 : should be computed
46 :
47 : @return the opaque positional information URI of the node.
48 :)
49declare function np:node-position(
50 $arg as node()
51) as xs:anyURI external;
52
53(:~
54 : Determines whether the node position given as second argument is
55 : an ancestor of the node position given as first argument.
56 :
57 : If the two positions were obtained within the same snapshot S, then the
58 : result of the function applies to the corresponding nodes as well, that
59 : is, within snapshot S, the second node is an ancestor of the first.
60 : Otherwise, the result of the function does not imply anything about the
61 : positional relationship of the two nodes.
62 :
63 : @param $n-pos1 the potential descendant node position
64 : @param $n-pos2 the potential ancestor node position
65 :
66 : @return true if the node position $n-pos2 is an ancestor of the node position
67 : $n-pos1; false otherwise.
68 :
69 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
70 : position computed by the <tt>np:node-position</tt> function.
71 :)
72declare function np:ancestor-of(
73 $pos1 as xs:anyURI,
74 $pos2 as xs:anyURI) as xs:boolean external;
75
76(:~
77 : Determines whether the node position given as second argument is
78 : a descendant of the node position given as first argument.
79 :
80 : If the two positions were obtained within the same snapshot S, then the
81 : result of the function applies to the corresponding nodes as well, that
82 : is, within snapshot S, the second node is a descendant of the first.
83 : Otherwise, the result of the function does not imply anything about the
84 : positional relationship of the two nodes.
85 :
86 : @param $n-pos1 the potential ancestor node position
87 : @param $n-pos2 the potential descendant node position
88 :
89 : @return true if the node position $n-pos2 is a descendant of the node
90 : position $n-pos1; false otherwise.
91 :
92 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
93 : position computed by the <tt>np:node-position</tt> function.
94 :)
95declare function np:descendant-of(
96 $n-pos1 as xs:anyURI,
97 $n-pos2 as xs:anyURI) as xs:boolean external;
98
99(:~
100 : Determines whether the node position given as second argument belongs
101 : to the subtree rooted at the node position given as first argument.
102 :
103 : If the two positions were obtained within the same snapshot S, then the
104 : result of the function applies to the corresponding nodes as well, that
105 : is, within snapshot S, the second node belongs to the subtree rooted at the
106 : first. Otherwise, the result of the function does not imply anything about
107 : the positional relationship of the two nodes.
108 :
109 : This function differs from np:descendant-of in the way it treats attribute
110 : nodes. np:descendant-of follows the XQuery/XPath specification for the
111 : descendant axis, and as a result, it does not consider attributes as
112 : descendants of any nodes; it will always return false if $n-pos2 was
113 : obtained from an attribute node.In contrast, np:in-subtree-of will return
114 : true if $n-pos2 was obtained from an attribute node that appeared in the
115 : subtree of the node that $n-pos1 was obtained from.
116 :
117 : @param $n-pos1 the potential subtree root node position
118 : @param $n-pos2 the potential node in the subtree node position
119 :
120 : @return true if the node position $n-pos2 belongs to the subtree rooted at
121 : the node position $n-pos1; false otherwise.
122 :
123 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
124 : position computed by the <tt>np:node-position</tt> function.
125 :)
126declare function np:in-subtree-of(
127 $n-pos1 as xs:anyURI,
128 $n-pos2 as xs:anyURI) as xs:boolean external;
129
130(:~
131 : Determines whether the node position given as second argument is
132 : the parent of the node position given as first argument.
133 :
134 : If the two positions were obtained within the same snapshot S, then the
135 : result of the function applies to the corresponding nodes as well, that
136 : is, within snapshot S, the second node is the parent of the first.
137 : Otherwise, the result of the function does not imply anything about the
138 : positional relationship of the two nodes.
139 :
140 : @param $n-pos1 the potential child node position
141 : @param $n-pos2 the potential parent node position
142 :
143 : @return true if the node position $n-pos2 is the parent of the node position
144 : $n-pos1; false otherwise.
145 :
146 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
147 : position computed by the <tt>np:node-position</tt> function.
148 :)
149declare function np:parent-of(
150 $n-pos1 as xs:anyURI,
151 $n-pos2 as xs:anyURI) as xs:boolean external;
152
153(:~
154 : Determines whether the node position given as second argument is
155 : a child of the node position given as first argument.
156 :
157 : If the two positions were obtained within the same snapshot S, then the
158 : result of the function applies to the corresponding nodes as well, that
159 : is, within snapshot S, the second node is a child of the first.
160 : Otherwise, the result of the function does not imply anything about the
161 : positional relationship of the two nodes.
162 :
163 : @param $n-pos1 the potential parent node position
164 : @param $n-pos2 the potential child node position
165 :
166 : @return true if the node position $n-pos2 is a child of the node position
167 : $n-pos1; false otherwise.
168 :
169 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
170 : position computed by the <tt>np:node-position</tt> function.
171 :)
172declare function np:child-of(
173 $n-pos1 as xs:anyURI,
174 $n-pos2 as xs:anyURI) as xs:boolean external;
175
176(:~
177 : Determines whether the node position given as second argument is
178 : an attribute of the node position given as first argument.
179 :
180 : If the two positions were obtained within the same snapshot S, then the
181 : result of the function applies to the corresponding nodes as well, that
182 : is, within snapshot S, the second node is an attribute of the first.
183 : Otherwise, the result of the function does not imply anything about the
184 : positional relationship of the two nodes.
185 :
186 : @param $n-pos1 the potential parent node position
187 : @param $n-pos2 the potential attribute node position
188 :
189 : @return true if the node position $n-pos2 is an attribute of the node
190 : position $n-pos1; false otherwise.
191 :
192 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
193 : position computed by the <tt>np:node-position</tt> function.
194 :)
195declare function np:attribute-of(
196 $n-pos1 as xs:anyURI,
197 $n-pos2 as xs:anyURI) as xs:boolean external;
198
199(:~
200 : Determines whether the node position given as second argument is
201 : a following-sibling of the node position given as first argument.
202 :
203 : If the two positions were obtained within the same snapshot S, then the
204 : result of the function applies to the corresponding nodes as well, that
205 : is, within snapshot S, the second node is a following-sibling of the first.
206 : Otherwise, the result of the function does not imply anything about the
207 : positional relationship of the two nodes.
208 :
209 : @param $n-pos1 the potential preceding-sibling node position
210 : @param $n-pos2 the potential following-sibling node position
211 :
212 : @return true if the node position $n-pos2 is a following-sibling of the node
213 : position $n-pos1; false otherwise.
214 :
215 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
216 : position computed by the <tt>np:node-position</tt> function.
217 :)
218declare function np:following-sibling-of(
219 $n-pos1 as xs:anyURI,
220 $n-pos2 as xs:anyURI) as xs:boolean external;
221
222(:~
223 : Determines whether the node position given as second argument is
224 : a preceding-sibling of the node position given as first argument.
225 :
226 : If the two positions were obtained within the same snapshot S, then the
227 : result of the function applies to the corresponding nodes as well, that
228 : is, within snapshot S, the second node is a preceding-sibling of the first.
229 : Otherwise, the result of the function does not imply anything about the
230 : positional relationship of the two nodes.
231 :
232 : @param $n-pos1 the potential following-sibling node position
233 : @param $n-pos2 the potential preceding-sibling node position
234 :
235 : @return true if the node position $n-pos2 is a preceding-sibling of the node
236 : position $n-pos1; false otherwise.
237 :
238 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
239 : position computed by the <tt>np:node-position</tt> function.
240 :)
241declare function np:preceding-sibling-of(
242 $n-pos1 as xs:anyURI,
243 $n-pos2 as xs:anyURI) as xs:boolean external;
244
245(:~
246 : Determines whether two node positions are siblings.
247 :
248 : If the two positions were obtained within the same snapshot S, then the
249 : result of the function applies to the corresponding nodes as well, that
250 : is, within snapshot S, the second node is a sibling of the first.
251 : Otherwise, the result of the function does not imply anything about the
252 : positional relationship of the two nodes.
253 :
254 : @param $n-pos1 a node position
255 : @param $n-pos2 a node position
256 :
257 : @return true if the two node positions $n-pos1 and $n-pos2 are siblings;
258 : false otherwise.
259 :
260 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
261 : position computed by the <tt>np:node-position</tt> function.
262 :)
263declare function np:sibling-of(
264 $n-pos1 as xs:anyURI,
265 $n-pos2 as xs:anyURI) as xs:boolean external;
266
267(:~
268 : Determines whether the node position given as second argument is
269 : following the node position given as first argument.
270 :
271 : If the two positions were obtained within the same snapshot S, then the
272 : result of the function applies to the corresponding nodes as well, that
273 : is, within snapshot S, the second node is following the first.
274 : Otherwise, the result of the function does not imply anything about the
275 : positional relationship of the two nodes.
276 :
277 : @param $n-pos1 the potential preceding node position
278 : @param $n-pos2 the potential following node position
279 :
280 : @return true if node positions $n-pos1 and $n-pos2 belong to the same XML
281 : tree and $n-pos2 is following the node position $n-pos1; false
282 : otherwise.
283 :
284 : @error zerr:ZAPI0028 if one of the given URI is not a valid node position
285 : computed by the <tt>np:node-position</tt> function.
286 :)
287declare function np:following-of(
288 $n-pos1 as xs:anyURI,
289 $n-pos2 as xs:anyURI) as xs:boolean external;
290
291(:~
292 : Determines whether the node position given as second argument is
293 : following in document order the node position given as first argument.
294 :
295 : If the two positions were obtained within the same snapshot S, then the
296 : result of the function applies to the corresponding nodes as well, that
297 : is, within snapshot S, the second node is following in document order the
298 : first. Otherwise, the result of the function does not imply anything about
299 : the positional relationship of the two nodes.
300 :
301 : @param $n-pos1 the potential preceding node position
302 : @param $n-pos2 the potential following node position
303 :
304 : @return true if the node position $n-pos2 is following in document order the
305 : node position $n-pos1; false otherwise.
306 :
307 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
308 : position computed by the <tt>np:node-position</tt> function.
309 :)
310declare function np:following-in-document-order-of(
311 $n-pos1 as xs:anyURI,
312 $n-pos2 as xs:anyURI) as xs:boolean external;
313
314(:~
315 : Determines whether the node position given as second argument is
316 : preceding the node position given as first argument.
317 :
318 : If the two positions were obtained within the same snapshot S, then the
319 : result of the function applies to the corresponding nodes as well, that
320 : is, within snapshot S, the second node is preceding the first.
321 : Otherwise, the result of the function does not imply anything about the
322 : positional relationship of the two nodes.
323 :
324 : @param $n-pos1 the potential following node position
325 : @param $n-pos2 the potential preceding node position
326 :
327 : @return true if node positions $n-pos1 and $n-pos2 belong to the same XML
328 : tree and $n-pos2 is preceding the node position $n-pos1; false
329 : otherwise.
330 :
331 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
332 : position computed by the <tt>np:node-position</tt> function.
333 :)
334declare function np:preceding-of(
335 $n-pos1 as xs:anyURI,
336 $n-pos2 as xs:anyURI) as xs:boolean external;
337
338(:~
339 : Determines whether the node position given as second argument is
340 : preceding in document order the node position given as first argument.
341 :
342 : If the two positions were obtained within the same snapshot S, then the
343 : result of the function applies to the corresponding nodes as well, that
344 : is, within snapshot S, the second node is preceding in document order the
345 : first. Otherwise, the result of the function does not imply anything about
346 : the positional relationship of the two nodes.
347 :
348 : @param $n-pos1 the potential following node position
349 : @param $n-pos2 the potential preceding node position
350 :
351 : @return true if the node position $n-pos2 is preceding in document order the
352 : node position $n-pos1; false otherwise.
353 :
354 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
355 : position computed by the <tt>np:node-position</tt> function.
356 :)
357declare function np:preceding-in-document-order-of(
358 $n-pos1 as xs:anyURI,
359 $n-pos2 as xs:anyURI) as xs:boolean external;
360
361(:~
362 : Computes the level of a node position in its tree.
363 :
364 : Note: The root node of a tree is at level one.
365 :
366 : The result of the function applies to the corresponding node as well,
367 : that is, within the snapshot in which the position was computed, the node
368 : level is the returned one.
369 : The result of the function does not imply anything about the
370 : node level in other snapshots.
371 :
372 : @param $n-pos the node position of the node whose level should be
373 : determined.
374 :
375 : @return the level in the tree of the node position $n-pos as xs:integer.
376 :
377 : @error zerr:ZAPI0028 if the given URI is not a valid node
378 : position computed by the <tt>np:node-position</tt> function.
379 :)
380declare function np:level(
381 $n-pos as xs:anyURI) as xs:integer external;
382
383(:~
384 : Determines whether a node position corresponds to an attribute node.
385 :
386 : @param $n-pos the potential attribute node position
387 :
388 : @return true if the node position $n-pos corresponds to an attribute;
389 : false otherwise.
390 :
391 : @error zerr:ZAPI0028 if the given URI is not a valid node
392 : position computed by the <tt>np:node-position</tt> function.
393 :)
394declare function np:is-attribute(
395 $n-pos1 as xs:anyURI) as xs:boolean external;
396
397(:~
398 : Determines whether a node position corresponds to a comment node.
399 :
400 : @param $n-pos the potential comment node position
401 :
402 : @return true if the node position $n-pos corresponds to an comment;
403 : false otherwise.
404 :
405 : @error zerr:ZAPI0028 if the given URI is not a valid node
406 : position computed by the <tt>np:node-position</tt> function.
407 :)
408declare function np:is-comment(
409 $n-pos1 as xs:anyURI) as xs:boolean external;
410
411(:~
412 : Determines whether a node position corresponds to a document node.
413 :
414 : @param $n-pos the potential document node position
415 :
416 : @return true if the node position $n-pos corresponds to a document;
417 : false otherwise.
418 :
419 : @error zerr:ZAPI0028 if the given URI is not a valid node
420 : position computed by the <tt>np:node-position</tt> function.
421 :)
422declare function np:is-document(
423 $n-pos1 as xs:anyURI) as xs:boolean external;
424
425(:~
426 : Determines whether a node position corresponds to an element node.
427 :
428 : @param $n-pos the potential element node position
429 :
430 : @return true if the node position $n-pos corresponds to an element;
431 : false otherwise.
432 :
433 : @error zerr:ZAPI0028 if the given URI is not a valid node
434 : position computed by the <tt>np:node-position</tt> function.
435 :)
436declare function np:is-element(
437 $n-pos1 as xs:anyURI) as xs:boolean external;
438
439(:~
440 : Determines whether a node position corresponds to an processing-instruction
441 : node.
442 :
443 : @param $n-pos the potential processing-instruction node position
444 :
445 : @return true if the node position $n-pos corresponds to a processing
446 : instruction; false otherwise.
447 :
448 : @error zerr:ZAPI0028 if the given URI is not a valid node
449 : position computed by the <tt>np:node-position</tt> function.
450 :)
451declare function np:is-processing-instruction(
452 $n-pos1 as xs:anyURI) as xs:boolean external;
453
454(:~
455 : Determines whether a node position corresponds to a text node.
456 :
457 : @param $n-pos the potential text node position
458 :
459 : @return true if the node position $n-pos corresponds to a text;
460 : false otherwise.
461 :
462 : @error zerr:ZAPI0028 if the given URI is not a valid node
463 : position computed by the <tt>np:node-position</tt> function.
464 :)
465declare function np:is-text(
466 $n-pos1 as xs:anyURI) as xs:boolean external;
467
468(:~
469 : Determines whether two node positions belong to the same tree.
470 :
471 : If the two positions were obtained within the same snapshot S, then the
472 : result of the function applies to the corresponding nodes as well, that
473 : is, within snapshot S, the two nodes belong to the same tree.
474 : Otherwise, the result of the function does not imply anything about
475 : the positional relationship of the two nodes.
476 :
477 : @param $n-pos1 a node position
478 : @param $n-pos2 a node position
479 :
480 : @return true if the two nodes whose node positions are $n-pos1
481 : and $n-pos2 belong to the same tree.
482 :
483 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
484 : position computed by the <tt>np:node-position</tt> function.
485 :)
486declare function np:in-same-tree-of(
487 $n-pos1 as xs:anyURI,
488 $n-pos2 as xs:anyURI) as xs:boolean external;
489
490(:~
491 : Determines whether a node position belongs to a collection.
492 :
493 : @param $n-pos the node position
494 :
495 : @return true if the node position $n-pos
496 : belongs to a collection; false otherwise.
497 :
498 : @error zerr:ZAPI0028 if the given URI is not a valid node
499 : position computed by the <tt>np:node-position</tt> function.
500 :)
501declare function np:in-collection(
502 $n-pos as xs:anyURI) as xs:boolean external;
503
504(:~
505 : Determines whether two node positions belong to the same collection.
506 :
507 : If the two positions were obtained within the same snapshot S, then the
508 : result of the function applies to the corresponding nodes as well, that
509 : is, within snapshot S, the two nodes belong to the same collection.
510 : Otherwise, the result of the function does not imply anything about
511 : the positional relationship of the two nodes.
512 :
513 : @param $n-pos1 a node position
514 : @param $n-pos2 a node position
515 :
516 : @return true if the two nodes whose node positions are $n-pos1
517 : and $n-pos2 belong to the same collection.
518 :
519 : @error zerr:ZAPI0028 if one of the given URI is not a valid node
520 : position computed by the <tt>np:node-position</tt> function.
521 :)
522declare function np:in-same-collection-of(
523 $n-pos1 as xs:anyURI,
524 $n-pos2 as xs:anyURI) as xs:boolean external;
0525
=== modified file 'src/context/static_context.cpp'
--- src/context/static_context.cpp 2011-11-01 13:47:10 +0000
+++ src/context/static_context.cpp 2011-11-02 17:26:24 +0000
@@ -280,6 +280,9 @@
280static_context::ZORBA_NODEREF_FN_NS = NS_PRE + "modules/node-reference";280static_context::ZORBA_NODEREF_FN_NS = NS_PRE + "modules/node-reference";
281281
282const zstring282const zstring
283static_context::ZORBA_NODEPOS_FN_NS = NS_PRE + "modules/node-position";
284
285const zstring
283static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DDL_FN_NS286static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DDL_FN_NS
284 = NS_PRE + "modules/store/dynamic/collections/ddl";287 = NS_PRE + "modules/store/dynamic/collections/ddl";
285288
@@ -373,6 +376,7 @@
373 return (ns == ZORBA_MATH_FN_NS ||376 return (ns == ZORBA_MATH_FN_NS ||
374 ns == ZORBA_BASE64_FN_NS ||377 ns == ZORBA_BASE64_FN_NS ||
375 ns == ZORBA_NODEREF_FN_NS ||378 ns == ZORBA_NODEREF_FN_NS ||
379 ns == ZORBA_NODEPOS_FN_NS ||
376 ns == ZORBA_STORE_DYNAMIC_DOCUMENTS_FN_NS ||380 ns == ZORBA_STORE_DYNAMIC_DOCUMENTS_FN_NS ||
377 ns == ZORBA_STORE_DYNAMIC_UNORDERED_MAP_FN_NS ||381 ns == ZORBA_STORE_DYNAMIC_UNORDERED_MAP_FN_NS ||
378 ns == ZORBA_STORE_DYNAMIC_COLLECTIONS_DDL_FN_NS ||382 ns == ZORBA_STORE_DYNAMIC_COLLECTIONS_DDL_FN_NS ||
379383
=== modified file 'src/context/static_context.h'
--- src/context/static_context.h 2011-11-01 13:47:10 +0000
+++ src/context/static_context.h 2011-11-02 17:26:24 +0000
@@ -450,6 +450,7 @@
450 static const zstring ZORBA_MATH_FN_NS;450 static const zstring ZORBA_MATH_FN_NS;
451 static const zstring ZORBA_BASE64_FN_NS;451 static const zstring ZORBA_BASE64_FN_NS;
452 static const zstring ZORBA_NODEREF_FN_NS;452 static const zstring ZORBA_NODEREF_FN_NS;
453 static const zstring ZORBA_NODEPOS_FN_NS;
453 static const zstring ZORBA_STORE_DYNAMIC_COLLECTIONS_DDL_FN_NS;454 static const zstring ZORBA_STORE_DYNAMIC_COLLECTIONS_DDL_FN_NS;
454 static const zstring ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS;455 static const zstring ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS;
455 static const zstring ZORBA_STORE_STATIC_COLLECTIONS_DDL_FN_NS;456 static const zstring ZORBA_STORE_STATIC_COLLECTIONS_DDL_FN_NS;
456457
=== modified file 'src/functions/library.cpp'
--- src/functions/library.cpp 2011-09-27 16:01:34 +0000
+++ src/functions/library.cpp 2011-11-02 17:26:24 +0000
@@ -44,6 +44,7 @@
44#include "functions/func_ic_ddl.h"44#include "functions/func_ic_ddl.h"
45#include "functions/func_maths.h"45#include "functions/func_maths.h"
46#include "functions/func_nodes.h"46#include "functions/func_nodes.h"
47#include "functions/func_node_position.h"
47#include "functions/func_node_sort_distinct.h"48#include "functions/func_node_sort_distinct.h"
48#include "functions/func_numerics.h"49#include "functions/func_numerics.h"
49#include "functions/func_numerics_impl.h"50#include "functions/func_numerics_impl.h"
@@ -108,6 +109,7 @@
108 populate_context_ic_ddl(sctx);109 populate_context_ic_ddl(sctx);
109 populate_context_maths(sctx);110 populate_context_maths(sctx);
110 populate_context_nodes(sctx);111 populate_context_nodes(sctx);
112 populate_context_node_position(sctx);
111 populate_context_numerics(sctx);113 populate_context_numerics(sctx);
112 populate_context_other_diagnostics(sctx);114 populate_context_other_diagnostics(sctx);
113 populate_context_parsing_and_serializing(sctx);115 populate_context_parsing_and_serializing(sctx);
114116
=== added file 'src/functions/pregenerated/func_node_position.cpp'
--- src/functions/pregenerated/func_node_position.cpp 1970-01-01 00:00:00 +0000
+++ src/functions/pregenerated/func_node_position.cpp 2011-11-02 17:26:24 +0000
@@ -0,0 +1,584 @@
1/*
2 * Copyright 2006-2008 The FLWOR Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17// ******************************************
18// * *
19// * THIS IS A GENERATED FILE. DO NOT EDIT! *
20// * SEE .xml FILE WITH SAME NAME *
21// * *
22// ******************************************
23
24
25#include "stdafx.h"
26#include "runtime/nodes/node_position.h"
27#include "functions/func_node_position.h"
28
29
30namespace zorba{
31
32
33
34PlanIter_t fn_zorba_pos_node_position::codegen(
35 CompilerCB*,
36 static_context* sctx,
37 const QueryLoc& loc,
38 std::vector<PlanIter_t>& argv,
39 AnnotationHolder& ann) const
40{
41 return new NodePositionIterator(sctx, loc, argv);
42}
43
44PlanIter_t fn_zorba_pos_ancestor_of::codegen(
45 CompilerCB*,
46 static_context* sctx,
47 const QueryLoc& loc,
48 std::vector<PlanIter_t>& argv,
49 AnnotationHolder& ann) const
50{
51 return new IsAncestorPositionIterator(sctx, loc, argv);
52}
53
54PlanIter_t fn_zorba_pos_following_sibling_of::codegen(
55 CompilerCB*,
56 static_context* sctx,
57 const QueryLoc& loc,
58 std::vector<PlanIter_t>& argv,
59 AnnotationHolder& ann) const
60{
61 return new IsFollowingSiblingPositionIterator(sctx, loc, argv);
62}
63
64PlanIter_t fn_zorba_pos_following_of::codegen(
65 CompilerCB*,
66 static_context* sctx,
67 const QueryLoc& loc,
68 std::vector<PlanIter_t>& argv,
69 AnnotationHolder& ann) const
70{
71 return new IsFollowingPositionIterator(sctx, loc, argv);
72}
73
74PlanIter_t fn_zorba_pos_in_subtree_of::codegen(
75 CompilerCB*,
76 static_context* sctx,
77 const QueryLoc& loc,
78 std::vector<PlanIter_t>& argv,
79 AnnotationHolder& ann) const
80{
81 return new IsInSubtreeOfPositionIterator(sctx, loc, argv);
82}
83
84PlanIter_t fn_zorba_pos_descendant_of::codegen(
85 CompilerCB*,
86 static_context* sctx,
87 const QueryLoc& loc,
88 std::vector<PlanIter_t>& argv,
89 AnnotationHolder& ann) const
90{
91 return new IsDescendantPositionIterator(sctx, loc, argv);
92}
93
94PlanIter_t fn_zorba_pos_preceding_sibling_of::codegen(
95 CompilerCB*,
96 static_context* sctx,
97 const QueryLoc& loc,
98 std::vector<PlanIter_t>& argv,
99 AnnotationHolder& ann) const
100{
101 return new IsPrecedingSiblingPositionIterator(sctx, loc, argv);
102}
103
104PlanIter_t fn_zorba_pos_preceding_of::codegen(
105 CompilerCB*,
106 static_context* sctx,
107 const QueryLoc& loc,
108 std::vector<PlanIter_t>& argv,
109 AnnotationHolder& ann) const
110{
111 return new IsPrecedingPositionIterator(sctx, loc, argv);
112}
113
114PlanIter_t fn_zorba_pos_child_of::codegen(
115 CompilerCB*,
116 static_context* sctx,
117 const QueryLoc& loc,
118 std::vector<PlanIter_t>& argv,
119 AnnotationHolder& ann) const
120{
121 return new IsChildPositionIterator(sctx, loc, argv);
122}
123
124PlanIter_t fn_zorba_pos_attribute_of::codegen(
125 CompilerCB*,
126 static_context* sctx,
127 const QueryLoc& loc,
128 std::vector<PlanIter_t>& argv,
129 AnnotationHolder& ann) const
130{
131 return new IsAttributeOfPositionIterator(sctx, loc, argv);
132}
133
134PlanIter_t fn_zorba_pos_parent_of::codegen(
135 CompilerCB*,
136 static_context* sctx,
137 const QueryLoc& loc,
138 std::vector<PlanIter_t>& argv,
139 AnnotationHolder& ann) const
140{
141 return new IsParentPositionIterator(sctx, loc, argv);
142}
143
144PlanIter_t fn_zorba_pos_preceding_in_document_order_of::codegen(
145 CompilerCB*,
146 static_context* sctx,
147 const QueryLoc& loc,
148 std::vector<PlanIter_t>& argv,
149 AnnotationHolder& ann) const
150{
151 return new IsPrecedingInDocumentOrderPositionIterator(sctx, loc, argv);
152}
153
154PlanIter_t fn_zorba_pos_following_in_document_order_of::codegen(
155 CompilerCB*,
156 static_context* sctx,
157 const QueryLoc& loc,
158 std::vector<PlanIter_t>& argv,
159 AnnotationHolder& ann) const
160{
161 return new IsFollowingInDocumentOrderPositionIterator(sctx, loc, argv);
162}
163
164PlanIter_t fn_zorba_pos_level::codegen(
165 CompilerCB*,
166 static_context* sctx,
167 const QueryLoc& loc,
168 std::vector<PlanIter_t>& argv,
169 AnnotationHolder& ann) const
170{
171 return new LevelPositionIterator(sctx, loc, argv);
172}
173
174PlanIter_t fn_zorba_pos_is_attribute::codegen(
175 CompilerCB*,
176 static_context* sctx,
177 const QueryLoc& loc,
178 std::vector<PlanIter_t>& argv,
179 AnnotationHolder& ann) const
180{
181 return new IsAttributePositionIterator(sctx, loc, argv);
182}
183
184PlanIter_t fn_zorba_pos_is_comment::codegen(
185 CompilerCB*,
186 static_context* sctx,
187 const QueryLoc& loc,
188 std::vector<PlanIter_t>& argv,
189 AnnotationHolder& ann) const
190{
191 return new IsCommentPositionIterator(sctx, loc, argv);
192}
193
194PlanIter_t fn_zorba_pos_is_document::codegen(
195 CompilerCB*,
196 static_context* sctx,
197 const QueryLoc& loc,
198 std::vector<PlanIter_t>& argv,
199 AnnotationHolder& ann) const
200{
201 return new IsDocumentPositionIterator(sctx, loc, argv);
202}
203
204PlanIter_t fn_zorba_pos_is_element::codegen(
205 CompilerCB*,
206 static_context* sctx,
207 const QueryLoc& loc,
208 std::vector<PlanIter_t>& argv,
209 AnnotationHolder& ann) const
210{
211 return new IsElementPositionIterator(sctx, loc, argv);
212}
213
214PlanIter_t fn_zorba_pos_is_processing_instruction::codegen(
215 CompilerCB*,
216 static_context* sctx,
217 const QueryLoc& loc,
218 std::vector<PlanIter_t>& argv,
219 AnnotationHolder& ann) const
220{
221 return new IsProcessingInstructionPositionIterator(sctx, loc, argv);
222}
223
224PlanIter_t fn_zorba_pos_is_text::codegen(
225 CompilerCB*,
226 static_context* sctx,
227 const QueryLoc& loc,
228 std::vector<PlanIter_t>& argv,
229 AnnotationHolder& ann) const
230{
231 return new IsTextPositionIterator(sctx, loc, argv);
232}
233
234PlanIter_t fn_zorba_pos_sibling_of::codegen(
235 CompilerCB*,
236 static_context* sctx,
237 const QueryLoc& loc,
238 std::vector<PlanIter_t>& argv,
239 AnnotationHolder& ann) const
240{
241 return new IsSiblingPositionIterator(sctx, loc, argv);
242}
243
244PlanIter_t fn_zorba_pos_in_same_tree_of::codegen(
245 CompilerCB*,
246 static_context* sctx,
247 const QueryLoc& loc,
248 std::vector<PlanIter_t>& argv,
249 AnnotationHolder& ann) const
250{
251 return new InSameTreePositionIterator(sctx, loc, argv);
252}
253
254PlanIter_t fn_zorba_pos_in_collection::codegen(
255 CompilerCB*,
256 static_context* sctx,
257 const QueryLoc& loc,
258 std::vector<PlanIter_t>& argv,
259 AnnotationHolder& ann) const
260{
261 return new InCollectionPositionIterator(sctx, loc, argv);
262}
263
264PlanIter_t fn_zorba_pos_in_same_collection_of::codegen(
265 CompilerCB*,
266 static_context* sctx,
267 const QueryLoc& loc,
268 std::vector<PlanIter_t>& argv,
269 AnnotationHolder& ann) const
270{
271 return new InSameCollectionPositionIterator(sctx, loc, argv);
272}
273
274void populate_context_node_position(static_context* sctx)
275{
276 {
277
278
279 DECL_WITH_KIND(sctx, fn_zorba_pos_node_position,
280 (createQName("http://www.zorba-xquery.com/modules/node-position","","node-position"),
281 GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE,
282 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE),
283 FunctionConsts::FN_ZORBA_POS_NODE_POSITION_1);
284
285 }
286
287
288 {
289
290
291 DECL_WITH_KIND(sctx, fn_zorba_pos_ancestor_of,
292 (createQName("http://www.zorba-xquery.com/modules/node-position","","ancestor-of"),
293 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
294 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
295 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
296 FunctionConsts::FN_ZORBA_POS_ANCESTOR_OF_2);
297
298 }
299
300
301 {
302
303
304 DECL_WITH_KIND(sctx, fn_zorba_pos_following_sibling_of,
305 (createQName("http://www.zorba-xquery.com/modules/node-position","","following-sibling-of"),
306 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
307 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
308 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
309 FunctionConsts::FN_ZORBA_POS_FOLLOWING_SIBLING_OF_2);
310
311 }
312
313
314 {
315
316
317 DECL_WITH_KIND(sctx, fn_zorba_pos_following_of,
318 (createQName("http://www.zorba-xquery.com/modules/node-position","","following-of"),
319 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
320 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
321 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
322 FunctionConsts::FN_ZORBA_POS_FOLLOWING_OF_2);
323
324 }
325
326
327 {
328
329
330 DECL_WITH_KIND(sctx, fn_zorba_pos_in_subtree_of,
331 (createQName("http://www.zorba-xquery.com/modules/node-position","","in-subtree-of"),
332 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
333 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
334 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
335 FunctionConsts::FN_ZORBA_POS_IN_SUBTREE_OF_2);
336
337 }
338
339
340 {
341
342
343 DECL_WITH_KIND(sctx, fn_zorba_pos_descendant_of,
344 (createQName("http://www.zorba-xquery.com/modules/node-position","","descendant-of"),
345 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
346 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
347 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
348 FunctionConsts::FN_ZORBA_POS_DESCENDANT_OF_2);
349
350 }
351
352
353 {
354
355
356 DECL_WITH_KIND(sctx, fn_zorba_pos_preceding_sibling_of,
357 (createQName("http://www.zorba-xquery.com/modules/node-position","","preceding-sibling-of"),
358 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
359 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
360 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
361 FunctionConsts::FN_ZORBA_POS_PRECEDING_SIBLING_OF_2);
362
363 }
364
365
366 {
367
368
369 DECL_WITH_KIND(sctx, fn_zorba_pos_preceding_of,
370 (createQName("http://www.zorba-xquery.com/modules/node-position","","preceding-of"),
371 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
372 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
373 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
374 FunctionConsts::FN_ZORBA_POS_PRECEDING_OF_2);
375
376 }
377
378
379 {
380
381
382 DECL_WITH_KIND(sctx, fn_zorba_pos_child_of,
383 (createQName("http://www.zorba-xquery.com/modules/node-position","","child-of"),
384 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
385 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
386 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
387 FunctionConsts::FN_ZORBA_POS_CHILD_OF_2);
388
389 }
390
391
392 {
393
394
395 DECL_WITH_KIND(sctx, fn_zorba_pos_attribute_of,
396 (createQName("http://www.zorba-xquery.com/modules/node-position","","attribute-of"),
397 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
398 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
399 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
400 FunctionConsts::FN_ZORBA_POS_ATTRIBUTE_OF_2);
401
402 }
403
404
405 {
406
407
408 DECL_WITH_KIND(sctx, fn_zorba_pos_parent_of,
409 (createQName("http://www.zorba-xquery.com/modules/node-position","","parent-of"),
410 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
411 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
412 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
413 FunctionConsts::FN_ZORBA_POS_PARENT_OF_2);
414
415 }
416
417
418 {
419
420
421 DECL_WITH_KIND(sctx, fn_zorba_pos_preceding_in_document_order_of,
422 (createQName("http://www.zorba-xquery.com/modules/node-position","","preceding-in-document-order-of"),
423 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
424 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
425 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
426 FunctionConsts::FN_ZORBA_POS_PRECEDING_IN_DOCUMENT_ORDER_OF_2);
427
428 }
429
430
431 {
432
433
434 DECL_WITH_KIND(sctx, fn_zorba_pos_following_in_document_order_of,
435 (createQName("http://www.zorba-xquery.com/modules/node-position","","following-in-document-order-of"),
436 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
437 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
438 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
439 FunctionConsts::FN_ZORBA_POS_FOLLOWING_IN_DOCUMENT_ORDER_OF_2);
440
441 }
442
443
444 {
445
446
447 DECL_WITH_KIND(sctx, fn_zorba_pos_level,
448 (createQName("http://www.zorba-xquery.com/modules/node-position","","level"),
449 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
450 GENV_TYPESYSTEM.INTEGER_TYPE_ONE),
451 FunctionConsts::FN_ZORBA_POS_LEVEL_1);
452
453 }
454
455
456 {
457
458
459 DECL_WITH_KIND(sctx, fn_zorba_pos_is_attribute,
460 (createQName("http://www.zorba-xquery.com/modules/node-position","","is-attribute"),
461 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
462 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
463 FunctionConsts::FN_ZORBA_POS_IS_ATTRIBUTE_1);
464
465 }
466
467
468 {
469
470
471 DECL_WITH_KIND(sctx, fn_zorba_pos_is_comment,
472 (createQName("http://www.zorba-xquery.com/modules/node-position","","is-comment"),
473 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
474 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
475 FunctionConsts::FN_ZORBA_POS_IS_COMMENT_1);
476
477 }
478
479
480 {
481
482
483 DECL_WITH_KIND(sctx, fn_zorba_pos_is_document,
484 (createQName("http://www.zorba-xquery.com/modules/node-position","","is-document"),
485 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
486 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
487 FunctionConsts::FN_ZORBA_POS_IS_DOCUMENT_1);
488
489 }
490
491
492 {
493
494
495 DECL_WITH_KIND(sctx, fn_zorba_pos_is_element,
496 (createQName("http://www.zorba-xquery.com/modules/node-position","","is-element"),
497 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
498 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
499 FunctionConsts::FN_ZORBA_POS_IS_ELEMENT_1);
500
501 }
502
503
504 {
505
506
507 DECL_WITH_KIND(sctx, fn_zorba_pos_is_processing_instruction,
508 (createQName("http://www.zorba-xquery.com/modules/node-position","","is-processing-instruction"),
509 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
510 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
511 FunctionConsts::FN_ZORBA_POS_IS_PROCESSING_INSTRUCTION_1);
512
513 }
514
515
516 {
517
518
519 DECL_WITH_KIND(sctx, fn_zorba_pos_is_text,
520 (createQName("http://www.zorba-xquery.com/modules/node-position","","is-text"),
521 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
522 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
523 FunctionConsts::FN_ZORBA_POS_IS_TEXT_1);
524
525 }
526
527
528 {
529
530
531 DECL_WITH_KIND(sctx, fn_zorba_pos_sibling_of,
532 (createQName("http://www.zorba-xquery.com/modules/node-position","","sibling-of"),
533 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
534 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
535 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
536 FunctionConsts::FN_ZORBA_POS_SIBLING_OF_2);
537
538 }
539
540
541 {
542
543
544 DECL_WITH_KIND(sctx, fn_zorba_pos_in_same_tree_of,
545 (createQName("http://www.zorba-xquery.com/modules/node-position","","in-same-tree-of"),
546 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
547 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
548 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
549 FunctionConsts::FN_ZORBA_POS_IN_SAME_TREE_OF_2);
550
551 }
552
553
554 {
555
556
557 DECL_WITH_KIND(sctx, fn_zorba_pos_in_collection,
558 (createQName("http://www.zorba-xquery.com/modules/node-position","","in-collection"),
559 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
560 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
561 FunctionConsts::FN_ZORBA_POS_IN_COLLECTION_1);
562
563 }
564
565
566 {
567
568
569 DECL_WITH_KIND(sctx, fn_zorba_pos_in_same_collection_of,
570 (createQName("http://www.zorba-xquery.com/modules/node-position","","in-same-collection-of"),
571 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
572 GENV_TYPESYSTEM.ANY_URI_TYPE_ONE,
573 GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
574 FunctionConsts::FN_ZORBA_POS_IN_SAME_COLLECTION_OF_2);
575
576 }
577
578}
579
580
581}
582
583
584
0585
=== added file 'src/functions/pregenerated/func_node_position.h'
--- src/functions/pregenerated/func_node_position.h 1970-01-01 00:00:00 +0000
+++ src/functions/pregenerated/func_node_position.h 2011-11-02 17:26:24 +0000
@@ -0,0 +1,361 @@
1/*
2 * Copyright 2006-2008 The FLWOR Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17// ******************************************
18// * *
19// * THIS IS A GENERATED FILE. DO NOT EDIT! *
20// * SEE .xml FILE WITH SAME NAME *
21// * *
22// ******************************************
23
24
25#ifndef ZORBA_FUNCTIONS_NODE_POSITION_H
26#define ZORBA_FUNCTIONS_NODE_POSITION_H
27
28
29#include "common/shared_types.h"
30#include "functions/function_impl.h"
31
32
33namespace zorba {
34
35
36void populate_context_node_position(static_context* sctx);
37
38
39
40
41//fn-zorba-pos:node-position
42class fn_zorba_pos_node_position : public function
43{
44public:
45 fn_zorba_pos_node_position(const signature& sig, FunctionConsts::FunctionKind kind)
46 : function(sig, kind) {
47
48}
49
50 CODEGEN_DECL();
51};
52
53
54//fn-zorba-pos:ancestor-of
55class fn_zorba_pos_ancestor_of : public function
56{
57public:
58 fn_zorba_pos_ancestor_of(const signature& sig, FunctionConsts::FunctionKind kind)
59 : function(sig, kind) {
60
61}
62
63 CODEGEN_DECL();
64};
65
66
67//fn-zorba-pos:following-sibling-of
68class fn_zorba_pos_following_sibling_of : public function
69{
70public:
71 fn_zorba_pos_following_sibling_of(const signature& sig, FunctionConsts::FunctionKind kind)
72 : function(sig, kind) {
73
74}
75
76 CODEGEN_DECL();
77};
78
79
80//fn-zorba-pos:following-of
81class fn_zorba_pos_following_of : public function
82{
83public:
84 fn_zorba_pos_following_of(const signature& sig, FunctionConsts::FunctionKind kind)
85 : function(sig, kind) {
86
87}
88
89 CODEGEN_DECL();
90};
91
92
93//fn-zorba-pos:in-subtree-of
94class fn_zorba_pos_in_subtree_of : public function
95{
96public:
97 fn_zorba_pos_in_subtree_of(const signature& sig, FunctionConsts::FunctionKind kind)
98 : function(sig, kind) {
99
100}
101
102 CODEGEN_DECL();
103};
104
105
106//fn-zorba-pos:descendant-of
107class fn_zorba_pos_descendant_of : public function
108{
109public:
110 fn_zorba_pos_descendant_of(const signature& sig, FunctionConsts::FunctionKind kind)
111 : function(sig, kind) {
112
113}
114
115 CODEGEN_DECL();
116};
117
118
119//fn-zorba-pos:preceding-sibling-of
120class fn_zorba_pos_preceding_sibling_of : public function
121{
122public:
123 fn_zorba_pos_preceding_sibling_of(const signature& sig, FunctionConsts::FunctionKind kind)
124 : function(sig, kind) {
125
126}
127
128 CODEGEN_DECL();
129};
130
131
132//fn-zorba-pos:preceding-of
133class fn_zorba_pos_preceding_of : public function
134{
135public:
136 fn_zorba_pos_preceding_of(const signature& sig, FunctionConsts::FunctionKind kind)
137 : function(sig, kind) {
138
139}
140
141 CODEGEN_DECL();
142};
143
144
145//fn-zorba-pos:child-of
146class fn_zorba_pos_child_of : public function
147{
148public:
149 fn_zorba_pos_child_of(const signature& sig, FunctionConsts::FunctionKind kind)
150 : function(sig, kind) {
151
152}
153
154 CODEGEN_DECL();
155};
156
157
158//fn-zorba-pos:attribute-of
159class fn_zorba_pos_attribute_of : public function
160{
161public:
162 fn_zorba_pos_attribute_of(const signature& sig, FunctionConsts::FunctionKind kind)
163 : function(sig, kind) {
164
165}
166
167 CODEGEN_DECL();
168};
169
170
171//fn-zorba-pos:parent-of
172class fn_zorba_pos_parent_of : public function
173{
174public:
175 fn_zorba_pos_parent_of(const signature& sig, FunctionConsts::FunctionKind kind)
176 : function(sig, kind) {
177
178}
179
180 CODEGEN_DECL();
181};
182
183
184//fn-zorba-pos:preceding-in-document-order-of
185class fn_zorba_pos_preceding_in_document_order_of : public function
186{
187public:
188 fn_zorba_pos_preceding_in_document_order_of(const signature& sig, FunctionConsts::FunctionKind kind)
189 : function(sig, kind) {
190
191}
192
193 CODEGEN_DECL();
194};
195
196
197//fn-zorba-pos:following-in-document-order-of
198class fn_zorba_pos_following_in_document_order_of : public function
199{
200public:
201 fn_zorba_pos_following_in_document_order_of(const signature& sig, FunctionConsts::FunctionKind kind)
202 : function(sig, kind) {
203
204}
205
206 CODEGEN_DECL();
207};
208
209
210//fn-zorba-pos:level
211class fn_zorba_pos_level : public function
212{
213public:
214 fn_zorba_pos_level(const signature& sig, FunctionConsts::FunctionKind kind)
215 : function(sig, kind) {
216
217}
218
219 CODEGEN_DECL();
220};
221
222
223//fn-zorba-pos:is-attribute
224class fn_zorba_pos_is_attribute : public function
225{
226public:
227 fn_zorba_pos_is_attribute(const signature& sig, FunctionConsts::FunctionKind kind)
228 : function(sig, kind) {
229
230}
231
232 CODEGEN_DECL();
233};
234
235
236//fn-zorba-pos:is-comment
237class fn_zorba_pos_is_comment : public function
238{
239public:
240 fn_zorba_pos_is_comment(const signature& sig, FunctionConsts::FunctionKind kind)
241 : function(sig, kind) {
242
243}
244
245 CODEGEN_DECL();
246};
247
248
249//fn-zorba-pos:is-document
250class fn_zorba_pos_is_document : public function
251{
252public:
253 fn_zorba_pos_is_document(const signature& sig, FunctionConsts::FunctionKind kind)
254 : function(sig, kind) {
255
256}
257
258 CODEGEN_DECL();
259};
260
261
262//fn-zorba-pos:is-element
263class fn_zorba_pos_is_element : public function
264{
265public:
266 fn_zorba_pos_is_element(const signature& sig, FunctionConsts::FunctionKind kind)
267 : function(sig, kind) {
268
269}
270
271 CODEGEN_DECL();
272};
273
274
275//fn-zorba-pos:is-processing-instruction
276class fn_zorba_pos_is_processing_instruction : public function
277{
278public:
279 fn_zorba_pos_is_processing_instruction(const signature& sig, FunctionConsts::FunctionKind kind)
280 : function(sig, kind) {
281
282}
283
284 CODEGEN_DECL();
285};
286
287
288//fn-zorba-pos:is-text
289class fn_zorba_pos_is_text : public function
290{
291public:
292 fn_zorba_pos_is_text(const signature& sig, FunctionConsts::FunctionKind kind)
293 : function(sig, kind) {
294
295}
296
297 CODEGEN_DECL();
298};
299
300
301//fn-zorba-pos:sibling-of
302class fn_zorba_pos_sibling_of : public function
303{
304public:
305 fn_zorba_pos_sibling_of(const signature& sig, FunctionConsts::FunctionKind kind)
306 : function(sig, kind) {
307
308}
309
310 CODEGEN_DECL();
311};
312
313
314//fn-zorba-pos:in-same-tree-of
315class fn_zorba_pos_in_same_tree_of : public function
316{
317public:
318 fn_zorba_pos_in_same_tree_of(const signature& sig, FunctionConsts::FunctionKind kind)
319 : function(sig, kind) {
320
321}
322
323 CODEGEN_DECL();
324};
325
326
327//fn-zorba-pos:in-collection
328class fn_zorba_pos_in_collection : public function
329{
330public:
331 fn_zorba_pos_in_collection(const signature& sig, FunctionConsts::FunctionKind kind)
332 : function(sig, kind) {
333
334}
335
336 CODEGEN_DECL();
337};
338
339
340//fn-zorba-pos:in-same-collection-of
341class fn_zorba_pos_in_same_collection_of : public function
342{
343public:
344 fn_zorba_pos_in_same_collection_of(const signature& sig, FunctionConsts::FunctionKind kind)
345 : function(sig, kind) {
346
347}
348
349 CODEGEN_DECL();
350};
351
352
353} //namespace zorba
354
355
356#endif
357/*
358 * Local variables:
359 * mode: c++
360 * End:
361 */
0362
=== modified file 'src/functions/pregenerated/function_enum.h'
--- src/functions/pregenerated/function_enum.h 2011-10-19 15:28:51 +0000
+++ src/functions/pregenerated/function_enum.h 2011-11-02 17:26:24 +0000
@@ -193,6 +193,30 @@
193 FN_ZORBA_MATH_IS_NAN_1,193 FN_ZORBA_MATH_IS_NAN_1,
194 FN_ZORBA_MATH_MODF_1,194 FN_ZORBA_MATH_MODF_1,
195 FN_ZORBA_MATH_FREXP_1,195 FN_ZORBA_MATH_FREXP_1,
196 FN_ZORBA_POS_NODE_POSITION_1,
197 FN_ZORBA_POS_ANCESTOR_OF_2,
198 FN_ZORBA_POS_FOLLOWING_SIBLING_OF_2,
199 FN_ZORBA_POS_FOLLOWING_OF_2,
200 FN_ZORBA_POS_IN_SUBTREE_OF_2,
201 FN_ZORBA_POS_DESCENDANT_OF_2,
202 FN_ZORBA_POS_PRECEDING_SIBLING_OF_2,
203 FN_ZORBA_POS_PRECEDING_OF_2,
204 FN_ZORBA_POS_CHILD_OF_2,
205 FN_ZORBA_POS_ATTRIBUTE_OF_2,
206 FN_ZORBA_POS_PARENT_OF_2,
207 FN_ZORBA_POS_PRECEDING_IN_DOCUMENT_ORDER_OF_2,
208 FN_ZORBA_POS_FOLLOWING_IN_DOCUMENT_ORDER_OF_2,
209 FN_ZORBA_POS_LEVEL_1,
210 FN_ZORBA_POS_IS_ATTRIBUTE_1,
211 FN_ZORBA_POS_IS_COMMENT_1,
212 FN_ZORBA_POS_IS_DOCUMENT_1,
213 FN_ZORBA_POS_IS_ELEMENT_1,
214 FN_ZORBA_POS_IS_PROCESSING_INSTRUCTION_1,
215 FN_ZORBA_POS_IS_TEXT_1,
216 FN_ZORBA_POS_SIBLING_OF_2,
217 FN_ZORBA_POS_IN_SAME_TREE_OF_2,
218 FN_ZORBA_POS_IN_COLLECTION_1,
219 FN_ZORBA_POS_IN_SAME_COLLECTION_OF_2,
196 FN_ZORBA_REF_NODE_REFERENCE_1,220 FN_ZORBA_REF_NODE_REFERENCE_1,
197 FN_ZORBA_REF_NODE_BY_REFERENCE_1,221 FN_ZORBA_REF_NODE_BY_REFERENCE_1,
198 FN_LOCAL_NAME_0,222 FN_LOCAL_NAME_0,
199223
=== added file 'src/runtime/nodes/node_position_impl.cpp'
--- src/runtime/nodes/node_position_impl.cpp 1970-01-01 00:00:00 +0000
+++ src/runtime/nodes/node_position_impl.cpp 2011-11-02 17:26:24 +0000
@@ -0,0 +1,756 @@
1/*
2 * Copyright 2006-2008 The FLWOR Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#include "stdafx.h"
17
18#include "runtime/nodes/node_position.h"
19#include "zorbamisc/ns_consts.h"
20
21#include "system/globalenv.h"
22
23#include "store/api/item.h"
24#include "store/api/iterator.h"
25#include "store/api/item_factory.h"
26#include "store/api/store.h"
27#include "store/naive/atomic_items.h"
28#include "store/naive/ordpath.h"
29
30#include "util/string_util.h"
31#include "util/uri_util.h"
32#include "zorbautils/string_util.h"
33
34using namespace std;
35
36namespace zorba {
37
38/*******************************************************************************
39
40********************************************************************************/
41bool NodePositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
42{
43 bool valid;
44 store::Item_t inNode;
45
46 PlanIteratorState* state;
47 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
48
49 valid = consumeNext(inNode, theChildren[0], planState);
50 assert(valid);
51
52 STACK_PUSH(GENV_STORE.getStructuralInformation(result, inNode), state);
53 STACK_END(state);
54}
55
56
57/*******************************************************************************
58
59********************************************************************************/
60bool
61IsAncestorPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
62{
63 store::Item_t lUriA;
64 store::Item_t lUriB;
65
66 PlanIteratorState* state;
67 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
68
69 consumeNext(lUriA, theChildren[0].getp(), planState);
70 consumeNext(lUriB, theChildren[1].getp(), planState);
71
72 try
73 {
74 GENV_ITEMFACTORY->createBoolean(result, lUriA->isAncestor(lUriB));
75 }
76 catch (ZorbaException& e)
77 {
78 set_source(e, loc);
79 throw;
80 }
81
82 STACK_PUSH(true,state);
83
84 STACK_END (state);
85}
86
87
88/*******************************************************************************
89
90********************************************************************************/
91bool
92IsFollowingSiblingPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
93{
94 store::Item_t lUriA;
95 store::Item_t lUriB;
96
97 PlanIteratorState* state;
98 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
99
100 consumeNext(lUriA, theChildren[0].getp(), planState);
101 consumeNext(lUriB, theChildren[1].getp(), planState);
102
103 try
104 {
105 GENV_ITEMFACTORY->createBoolean(result, lUriA->isFollowingSibling(lUriB));
106 }
107 catch (ZorbaException& e)
108 {
109 set_source(e, loc);
110 throw;
111 }
112
113 STACK_PUSH(true,state);
114
115 STACK_END (state);
116}
117
118
119/*******************************************************************************
120
121********************************************************************************/
122bool
123IsFollowingPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
124{
125 store::Item_t lUriA;
126 store::Item_t lUriB;
127
128 PlanIteratorState* state;
129 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
130
131 consumeNext(lUriA, theChildren[0].getp(), planState);
132 consumeNext(lUriB, theChildren[1].getp(), planState);
133
134 try
135 {
136 GENV_ITEMFACTORY->createBoolean(result, lUriA->isFollowing(lUriB));
137 }
138 catch (ZorbaException& e)
139 {
140 set_source(e, loc);
141 throw;
142 }
143
144 STACK_PUSH(true,state);
145
146 STACK_END (state);
147}
148
149
150/*******************************************************************************
151
152********************************************************************************/
153bool
154IsInSubtreeOfPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
155{
156 store::Item_t lUriA;
157 store::Item_t lUriB;
158
159 PlanIteratorState *state;
160 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
161
162 consumeNext(lUriA, theChildren[0].getp(), planState);
163 consumeNext(lUriB, theChildren[1].getp(), planState);
164
165 try
166 {
167 GENV_ITEMFACTORY->createBoolean(result, lUriA->isInSubtreeOf(lUriB));
168 }
169 catch (ZorbaException& e)
170 {
171 set_source(e, loc);
172 throw;
173 }
174
175 STACK_PUSH(true,state);
176
177 STACK_END (state);
178}
179
180
181/*******************************************************************************
182
183********************************************************************************/
184bool
185IsDescendantPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
186{
187 store::Item_t lUriA;
188 store::Item_t lUriB;
189
190 PlanIteratorState *state;
191 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
192
193 consumeNext(lUriA, theChildren[0].getp(), planState);
194 consumeNext(lUriB, theChildren[1].getp(), planState);
195
196 try
197 {
198 GENV_ITEMFACTORY->createBoolean(result, lUriA->isDescendant(lUriB));
199 }
200 catch (ZorbaException& e)
201 {
202 set_source(e, loc);
203 throw;
204 }
205
206 STACK_PUSH(true,state);
207
208 STACK_END (state);
209}
210
211
212/*******************************************************************************
213
214********************************************************************************/
215bool
216IsPrecedingSiblingPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
217{
218 store::Item_t lUriA;
219 store::Item_t lUriB;
220
221 PlanIteratorState *state;
222 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
223
224 consumeNext(lUriA, theChildren[0].getp(), planState);
225 consumeNext(lUriB, theChildren[1].getp(), planState);
226
227 try
228 {
229 GENV_ITEMFACTORY->createBoolean(result, lUriA->isPrecedingSibling(lUriB));
230
231 }
232 catch (ZorbaException& e)
233 {
234 set_source(e, loc);
235 throw;
236 }
237
238 STACK_PUSH(true,state);
239
240 STACK_END (state);
241}
242
243
244/*******************************************************************************
245
246********************************************************************************/
247bool
248IsPrecedingPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
249{
250 store::Item_t lUriA;
251 store::Item_t lUriB;
252
253 PlanIteratorState *state;
254 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
255
256 consumeNext(lUriA, theChildren[0].getp(), planState);
257 consumeNext(lUriB, theChildren[1].getp(), planState);
258
259 try
260 {
261 GENV_ITEMFACTORY->createBoolean(result, lUriA->isPreceding(lUriB));
262 }
263 catch (ZorbaException& e)
264 {
265 set_source(e, loc);
266 throw;
267 }
268
269 STACK_PUSH(true,state);
270
271 STACK_END (state);
272}
273
274
275/*******************************************************************************
276
277********************************************************************************/
278bool
279IsChildPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
280{
281 store::Item_t lUriA;
282 store::Item_t lUriB;
283
284 PlanIteratorState *state;
285 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
286
287 consumeNext(lUriA, theChildren[0].getp(), planState);
288 consumeNext(lUriB, theChildren[1].getp(), planState);
289
290 try
291 {
292 GENV_ITEMFACTORY->createBoolean(result, lUriA->isChild(lUriB));
293 }
294 catch (ZorbaException& e)
295 {
296 set_source(e, loc);
297 throw;
298 }
299
300 STACK_PUSH(true,state);
301
302 STACK_END (state);
303}
304
305
306/*******************************************************************************
307
308********************************************************************************/
309bool
310IsAttributeOfPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
311{
312 store::Item_t lUriA;
313 store::Item_t lUriB;
314
315 PlanIteratorState *state;
316 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
317
318 consumeNext(lUriA, theChildren[0].getp(), planState);
319 consumeNext(lUriB, theChildren[1].getp(), planState);
320
321 try
322 {
323 GENV_ITEMFACTORY->createBoolean(result, lUriA->isAttribute(lUriB));
324 }
325 catch (ZorbaException& e)
326 {
327 set_source(e, loc);
328 throw;
329 }
330
331 STACK_PUSH(true,state);
332
333 STACK_END (state);
334}
335
336
337/*******************************************************************************
338
339********************************************************************************/
340bool
341IsParentPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
342{
343 store::Item_t lUriA;
344 store::Item_t lUriB;
345
346 PlanIteratorState *state;
347 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
348
349 consumeNext(lUriA, theChildren[0].getp(), planState);
350 consumeNext(lUriB, theChildren[1].getp(), planState);
351
352 try
353 {
354 GENV_ITEMFACTORY->createBoolean(result, lUriA->isParent(lUriB));
355 }
356 catch (ZorbaException& e)
357 {
358 set_source(e, loc);
359 throw;
360 }
361
362 STACK_PUSH(true,state);
363
364 STACK_END (state);
365}
366
367
368/*******************************************************************************
369
370********************************************************************************/
371bool
372IsPrecedingInDocumentOrderPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
373{
374 store::Item_t lUriA;
375 store::Item_t lUriB;
376
377 PlanIteratorState *state;
378 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
379
380 consumeNext(lUriA, theChildren[0].getp(), planState);
381 consumeNext(lUriB, theChildren[1].getp(), planState);
382
383 try
384 {
385 GENV_ITEMFACTORY->createBoolean(result, lUriA->isPrecedingInDocumentOrder(lUriB));
386 }
387 catch (ZorbaException& e)
388 {
389 set_source(e, loc);
390 throw;
391 }
392
393 STACK_PUSH(true,state);
394
395 STACK_END (state);
396}
397
398
399/*******************************************************************************
400
401********************************************************************************/
402bool
403IsFollowingInDocumentOrderPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
404{
405 store::Item_t lUriA;
406 store::Item_t lUriB;
407
408 PlanIteratorState *state;
409 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
410
411 consumeNext(lUriA, theChildren[0].getp(), planState);
412 consumeNext(lUriB, theChildren[1].getp(), planState);
413
414 try
415 {
416 GENV_ITEMFACTORY->createBoolean(result, lUriA->isFollowingInDocumentOrder(lUriB));
417 }
418 catch (ZorbaException& e)
419 {
420 set_source(e, loc);
421 throw;
422 }
423
424 STACK_PUSH(true,state);
425
426 STACK_END (state);
427}
428
429
430/*******************************************************************************
431
432********************************************************************************/
433bool
434LevelPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
435{
436 store::Item_t lUri;
437
438 PlanIteratorState *state;
439 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
440
441 consumeNext(lUri, theChildren[0].getp(), planState);
442
443 try
444 {
445 result = lUri->getLevel();
446 }
447 catch (ZorbaException& e)
448 {
449 set_source(e, loc);
450 throw;
451 }
452
453 STACK_PUSH(true, state);
454
455 STACK_END (state);
456}
457
458
459/*******************************************************************************
460
461********************************************************************************/
462bool
463IsAttributePositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
464{
465 store::Item_t lUri;
466
467 PlanIteratorState *state;
468 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
469
470 consumeNext(lUri, theChildren[0].getp(), planState);
471
472 try
473 {
474 GENV_ITEMFACTORY->createBoolean(result, lUri->isAttribute());
475 }
476 catch (ZorbaException& e)
477 {
478 set_source(e, loc);
479 throw;
480 }
481
482 STACK_PUSH(true,state);
483
484 STACK_END (state);
485}
486
487
488/*******************************************************************************
489
490********************************************************************************/
491bool
492IsCommentPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
493{
494 store::Item_t lUri;
495
496 PlanIteratorState *state;
497 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
498
499 consumeNext(lUri, theChildren[0].getp(), planState);
500
501 try
502 {
503 GENV_ITEMFACTORY->createBoolean(result, lUri->isComment());
504 }
505 catch (ZorbaException& e)
506 {
507 set_source(e, loc);
508 throw;
509 }
510
511 STACK_PUSH(true,state);
512
513 STACK_END (state);
514}
515
516
517/*******************************************************************************
518
519********************************************************************************/
520bool
521IsDocumentPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
522{
523 store::Item_t lUri;
524
525 PlanIteratorState *state;
526 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
527
528 consumeNext(lUri, theChildren[0].getp(), planState);
529
530 try
531 {
532 GENV_ITEMFACTORY->createBoolean(result, lUri->isDocument());
533 }
534 catch (ZorbaException& e)
535 {
536 set_source(e, loc);
537 throw;
538 }
539
540 STACK_PUSH(true,state);
541
542 STACK_END (state);
543}
544
545
546/*******************************************************************************
547
548********************************************************************************/
549bool
550IsElementPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
551{
552 store::Item_t lUri;
553
554 PlanIteratorState *state;
555 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
556
557 consumeNext(lUri, theChildren[0].getp(), planState);
558
559 try
560 {
561 GENV_ITEMFACTORY->createBoolean(result, lUri->isElement());
562 }
563 catch (ZorbaException& e)
564 {
565 set_source(e, loc);
566 throw;
567 }
568
569 STACK_PUSH(true,state);
570
571 STACK_END (state);
572}
573
574
575/*******************************************************************************
576
577********************************************************************************/
578bool
579IsProcessingInstructionPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
580{
581 store::Item_t lUri;
582
583 PlanIteratorState *state;
584 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
585
586 consumeNext(lUri, theChildren[0].getp(), planState);
587
588 try
589 {
590 GENV_ITEMFACTORY->createBoolean(result, lUri->isProcessingInstruction());
591 }
592 catch (ZorbaException& e)
593 {
594 set_source(e, loc);
595 throw;
596 }
597
598 STACK_PUSH(true,state);
599
600 STACK_END (state);
601}
602
603
604/*******************************************************************************
605
606********************************************************************************/
607bool
608IsTextPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
609{
610 store::Item_t lUri;
611
612 PlanIteratorState *state;
613 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
614
615 consumeNext(lUri, theChildren[0].getp(), planState);
616
617 try
618 {
619 GENV_ITEMFACTORY->createBoolean(result, lUri->isText());
620 }
621 catch (ZorbaException& e)
622 {
623 set_source(e, loc);
624 throw;
625 }
626
627 STACK_PUSH(true,state);
628
629 STACK_END (state);
630}
631
632
633/*******************************************************************************
634
635********************************************************************************/
636bool
637IsSiblingPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
638{
639 store::Item_t lUriA;
640 store::Item_t lUriB;
641
642 PlanIteratorState *state;
643 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
644
645 consumeNext(lUriA, theChildren[0].getp(), planState);
646 consumeNext(lUriB, theChildren[1].getp(), planState);
647
648 try
649 {
650 GENV_ITEMFACTORY->createBoolean(result, lUriA->isSibling(lUriB));
651 }
652 catch (ZorbaException& e)
653 {
654 set_source(e, loc);
655 throw;
656 }
657
658 STACK_PUSH(true,state);
659
660 STACK_END (state);
661}
662
663
664/*******************************************************************************
665
666********************************************************************************/
667bool
668InSameTreePositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
669{
670 store::Item_t lUriA;
671 store::Item_t lUriB;
672
673 PlanIteratorState *state;
674 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
675
676 consumeNext(lUriA, theChildren[0].getp(), planState);
677 consumeNext(lUriB, theChildren[1].getp(), planState);
678
679 try
680 {
681 GENV_ITEMFACTORY->createBoolean(result, lUriA->inSameTree(lUriB));
682 }
683 catch (ZorbaException& e)
684 {
685 set_source(e, loc);
686 throw;
687 }
688
689 STACK_PUSH(true,state);
690
691 STACK_END (state);
692}
693
694
695/*******************************************************************************
696
697********************************************************************************/
698bool
699InCollectionPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
700{
701 store::Item_t lUri;
702
703 PlanIteratorState *state;
704 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
705
706 consumeNext(lUri, theChildren[0].getp(), planState);
707
708 try
709 {
710 GENV_ITEMFACTORY->createBoolean(result, lUri->inCollection());
711 }
712 catch (ZorbaException& e)
713 {
714 set_source(e, loc);
715 throw;
716 }
717
718 STACK_PUSH(true,state);
719
720 STACK_END (state);
721}
722
723
724/*******************************************************************************
725
726********************************************************************************/
727bool
728InSameCollectionPositionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
729{
730 store::Item_t lUriA;
731 store::Item_t lUriB;
732
733 PlanIteratorState *state;
734 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
735
736 consumeNext(lUriA, theChildren[0].getp(), planState);
737 consumeNext(lUriB, theChildren[1].getp(), planState);
738
739 try
740 {
741 GENV_ITEMFACTORY->createBoolean(result, lUriA->inSameCollection(lUriB));
742 }
743 catch (ZorbaException& e)
744 {
745 set_source(e, loc);
746 throw;
747 }
748
749 STACK_PUSH(true,state);
750
751 STACK_END (state);
752}
753
754} // namespace zorba
755/* vim:set et sw=2 ts=2: */
756
0757
=== added file 'src/runtime/nodes/pregenerated/node_position.cpp'
--- src/runtime/nodes/pregenerated/node_position.cpp 1970-01-01 00:00:00 +0000
+++ src/runtime/nodes/pregenerated/node_position.cpp 2011-11-02 17:26:24 +0000
@@ -0,0 +1,710 @@
1/*
2 * Copyright 2006-2008 The FLWOR Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17// ******************************************
18// * *
19// * THIS IS A GENERATED FILE. DO NOT EDIT! *
20// * SEE .xml FILE WITH SAME NAME *
21// * *
22// ******************************************
23
24#include "stdafx.h"
25#include "zorbatypes/rchandle.h"
26#include "zorbatypes/zstring.h"
27#include "runtime/visitors/planiter_visitor.h"
28#include "runtime/nodes/node_position.h"
29#include "system/globalenv.h"
30
31
32
33namespace zorba {
34
35// <NodePositionIterator>
36const char* NodePositionIterator::class_name_str = "NodePositionIterator";
37NodePositionIterator::class_factory<NodePositionIterator>
38NodePositionIterator::g_class_factory;
39
40const serialization::ClassVersion
41NodePositionIterator::class_versions[] ={{ 1, 0x000905, false}};
42
43const int NodePositionIterator::class_versions_count =
44sizeof(NodePositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
45
46void NodePositionIterator::accept(PlanIterVisitor& v) const {
47 v.beginVisit(*this);
48
49 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
50 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
51 for ( ; lIter != lEnd; ++lIter ){
52 (*lIter)->accept(v);
53 }
54
55 v.endVisit(*this);
56}
57
58NodePositionIterator::~NodePositionIterator() {}
59
60// </NodePositionIterator>
61
62
63// <IsAncestorPositionIterator>
64const char* IsAncestorPositionIterator::class_name_str = "IsAncestorPositionIterator";
65IsAncestorPositionIterator::class_factory<IsAncestorPositionIterator>
66IsAncestorPositionIterator::g_class_factory;
67
68const serialization::ClassVersion
69IsAncestorPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
70
71const int IsAncestorPositionIterator::class_versions_count =
72sizeof(IsAncestorPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
73
74void IsAncestorPositionIterator::accept(PlanIterVisitor& v) const {
75 v.beginVisit(*this);
76
77 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
78 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
79 for ( ; lIter != lEnd; ++lIter ){
80 (*lIter)->accept(v);
81 }
82
83 v.endVisit(*this);
84}
85
86IsAncestorPositionIterator::~IsAncestorPositionIterator() {}
87
88// </IsAncestorPositionIterator>
89
90
91// <IsFollowingSiblingPositionIterator>
92const char* IsFollowingSiblingPositionIterator::class_name_str = "IsFollowingSiblingPositionIterator";
93IsFollowingSiblingPositionIterator::class_factory<IsFollowingSiblingPositionIterator>
94IsFollowingSiblingPositionIterator::g_class_factory;
95
96const serialization::ClassVersion
97IsFollowingSiblingPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
98
99const int IsFollowingSiblingPositionIterator::class_versions_count =
100sizeof(IsFollowingSiblingPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
101
102void IsFollowingSiblingPositionIterator::accept(PlanIterVisitor& v) const {
103 v.beginVisit(*this);
104
105 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
106 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
107 for ( ; lIter != lEnd; ++lIter ){
108 (*lIter)->accept(v);
109 }
110
111 v.endVisit(*this);
112}
113
114IsFollowingSiblingPositionIterator::~IsFollowingSiblingPositionIterator() {}
115
116// </IsFollowingSiblingPositionIterator>
117
118
119// <IsFollowingPositionIterator>
120const char* IsFollowingPositionIterator::class_name_str = "IsFollowingPositionIterator";
121IsFollowingPositionIterator::class_factory<IsFollowingPositionIterator>
122IsFollowingPositionIterator::g_class_factory;
123
124const serialization::ClassVersion
125IsFollowingPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
126
127const int IsFollowingPositionIterator::class_versions_count =
128sizeof(IsFollowingPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
129
130void IsFollowingPositionIterator::accept(PlanIterVisitor& v) const {
131 v.beginVisit(*this);
132
133 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
134 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
135 for ( ; lIter != lEnd; ++lIter ){
136 (*lIter)->accept(v);
137 }
138
139 v.endVisit(*this);
140}
141
142IsFollowingPositionIterator::~IsFollowingPositionIterator() {}
143
144// </IsFollowingPositionIterator>
145
146
147// <IsInSubtreeOfPositionIterator>
148const char* IsInSubtreeOfPositionIterator::class_name_str = "IsInSubtreeOfPositionIterator";
149IsInSubtreeOfPositionIterator::class_factory<IsInSubtreeOfPositionIterator>
150IsInSubtreeOfPositionIterator::g_class_factory;
151
152const serialization::ClassVersion
153IsInSubtreeOfPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
154
155const int IsInSubtreeOfPositionIterator::class_versions_count =
156sizeof(IsInSubtreeOfPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
157
158void IsInSubtreeOfPositionIterator::accept(PlanIterVisitor& v) const {
159 v.beginVisit(*this);
160
161 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
162 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
163 for ( ; lIter != lEnd; ++lIter ){
164 (*lIter)->accept(v);
165 }
166
167 v.endVisit(*this);
168}
169
170IsInSubtreeOfPositionIterator::~IsInSubtreeOfPositionIterator() {}
171
172// </IsInSubtreeOfPositionIterator>
173
174
175// <IsDescendantPositionIterator>
176const char* IsDescendantPositionIterator::class_name_str = "IsDescendantPositionIterator";
177IsDescendantPositionIterator::class_factory<IsDescendantPositionIterator>
178IsDescendantPositionIterator::g_class_factory;
179
180const serialization::ClassVersion
181IsDescendantPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
182
183const int IsDescendantPositionIterator::class_versions_count =
184sizeof(IsDescendantPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
185
186void IsDescendantPositionIterator::accept(PlanIterVisitor& v) const {
187 v.beginVisit(*this);
188
189 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
190 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
191 for ( ; lIter != lEnd; ++lIter ){
192 (*lIter)->accept(v);
193 }
194
195 v.endVisit(*this);
196}
197
198IsDescendantPositionIterator::~IsDescendantPositionIterator() {}
199
200// </IsDescendantPositionIterator>
201
202
203// <IsPrecedingSiblingPositionIterator>
204const char* IsPrecedingSiblingPositionIterator::class_name_str = "IsPrecedingSiblingPositionIterator";
205IsPrecedingSiblingPositionIterator::class_factory<IsPrecedingSiblingPositionIterator>
206IsPrecedingSiblingPositionIterator::g_class_factory;
207
208const serialization::ClassVersion
209IsPrecedingSiblingPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
210
211const int IsPrecedingSiblingPositionIterator::class_versions_count =
212sizeof(IsPrecedingSiblingPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
213
214void IsPrecedingSiblingPositionIterator::accept(PlanIterVisitor& v) const {
215 v.beginVisit(*this);
216
217 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
218 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
219 for ( ; lIter != lEnd; ++lIter ){
220 (*lIter)->accept(v);
221 }
222
223 v.endVisit(*this);
224}
225
226IsPrecedingSiblingPositionIterator::~IsPrecedingSiblingPositionIterator() {}
227
228// </IsPrecedingSiblingPositionIterator>
229
230
231// <IsPrecedingPositionIterator>
232const char* IsPrecedingPositionIterator::class_name_str = "IsPrecedingPositionIterator";
233IsPrecedingPositionIterator::class_factory<IsPrecedingPositionIterator>
234IsPrecedingPositionIterator::g_class_factory;
235
236const serialization::ClassVersion
237IsPrecedingPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
238
239const int IsPrecedingPositionIterator::class_versions_count =
240sizeof(IsPrecedingPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
241
242void IsPrecedingPositionIterator::accept(PlanIterVisitor& v) const {
243 v.beginVisit(*this);
244
245 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
246 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
247 for ( ; lIter != lEnd; ++lIter ){
248 (*lIter)->accept(v);
249 }
250
251 v.endVisit(*this);
252}
253
254IsPrecedingPositionIterator::~IsPrecedingPositionIterator() {}
255
256// </IsPrecedingPositionIterator>
257
258
259// <IsChildPositionIterator>
260const char* IsChildPositionIterator::class_name_str = "IsChildPositionIterator";
261IsChildPositionIterator::class_factory<IsChildPositionIterator>
262IsChildPositionIterator::g_class_factory;
263
264const serialization::ClassVersion
265IsChildPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
266
267const int IsChildPositionIterator::class_versions_count =
268sizeof(IsChildPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
269
270void IsChildPositionIterator::accept(PlanIterVisitor& v) const {
271 v.beginVisit(*this);
272
273 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
274 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
275 for ( ; lIter != lEnd; ++lIter ){
276 (*lIter)->accept(v);
277 }
278
279 v.endVisit(*this);
280}
281
282IsChildPositionIterator::~IsChildPositionIterator() {}
283
284// </IsChildPositionIterator>
285
286
287// <IsAttributeOfPositionIterator>
288const char* IsAttributeOfPositionIterator::class_name_str = "IsAttributeOfPositionIterator";
289IsAttributeOfPositionIterator::class_factory<IsAttributeOfPositionIterator>
290IsAttributeOfPositionIterator::g_class_factory;
291
292const serialization::ClassVersion
293IsAttributeOfPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
294
295const int IsAttributeOfPositionIterator::class_versions_count =
296sizeof(IsAttributeOfPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
297
298void IsAttributeOfPositionIterator::accept(PlanIterVisitor& v) const {
299 v.beginVisit(*this);
300
301 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
302 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
303 for ( ; lIter != lEnd; ++lIter ){
304 (*lIter)->accept(v);
305 }
306
307 v.endVisit(*this);
308}
309
310IsAttributeOfPositionIterator::~IsAttributeOfPositionIterator() {}
311
312// </IsAttributeOfPositionIterator>
313
314
315// <IsParentPositionIterator>
316const char* IsParentPositionIterator::class_name_str = "IsParentPositionIterator";
317IsParentPositionIterator::class_factory<IsParentPositionIterator>
318IsParentPositionIterator::g_class_factory;
319
320const serialization::ClassVersion
321IsParentPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
322
323const int IsParentPositionIterator::class_versions_count =
324sizeof(IsParentPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
325
326void IsParentPositionIterator::accept(PlanIterVisitor& v) const {
327 v.beginVisit(*this);
328
329 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
330 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
331 for ( ; lIter != lEnd; ++lIter ){
332 (*lIter)->accept(v);
333 }
334
335 v.endVisit(*this);
336}
337
338IsParentPositionIterator::~IsParentPositionIterator() {}
339
340// </IsParentPositionIterator>
341
342
343// <IsPrecedingInDocumentOrderPositionIterator>
344const char* IsPrecedingInDocumentOrderPositionIterator::class_name_str = "IsPrecedingInDocumentOrderPositionIterator";
345IsPrecedingInDocumentOrderPositionIterator::class_factory<IsPrecedingInDocumentOrderPositionIterator>
346IsPrecedingInDocumentOrderPositionIterator::g_class_factory;
347
348const serialization::ClassVersion
349IsPrecedingInDocumentOrderPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
350
351const int IsPrecedingInDocumentOrderPositionIterator::class_versions_count =
352sizeof(IsPrecedingInDocumentOrderPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
353
354void IsPrecedingInDocumentOrderPositionIterator::accept(PlanIterVisitor& v) const {
355 v.beginVisit(*this);
356
357 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
358 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
359 for ( ; lIter != lEnd; ++lIter ){
360 (*lIter)->accept(v);
361 }
362
363 v.endVisit(*this);
364}
365
366IsPrecedingInDocumentOrderPositionIterator::~IsPrecedingInDocumentOrderPositionIterator() {}
367
368// </IsPrecedingInDocumentOrderPositionIterator>
369
370
371// <IsFollowingInDocumentOrderPositionIterator>
372const char* IsFollowingInDocumentOrderPositionIterator::class_name_str = "IsFollowingInDocumentOrderPositionIterator";
373IsFollowingInDocumentOrderPositionIterator::class_factory<IsFollowingInDocumentOrderPositionIterator>
374IsFollowingInDocumentOrderPositionIterator::g_class_factory;
375
376const serialization::ClassVersion
377IsFollowingInDocumentOrderPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
378
379const int IsFollowingInDocumentOrderPositionIterator::class_versions_count =
380sizeof(IsFollowingInDocumentOrderPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
381
382void IsFollowingInDocumentOrderPositionIterator::accept(PlanIterVisitor& v) const {
383 v.beginVisit(*this);
384
385 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
386 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
387 for ( ; lIter != lEnd; ++lIter ){
388 (*lIter)->accept(v);
389 }
390
391 v.endVisit(*this);
392}
393
394IsFollowingInDocumentOrderPositionIterator::~IsFollowingInDocumentOrderPositionIterator() {}
395
396// </IsFollowingInDocumentOrderPositionIterator>
397
398
399// <LevelPositionIterator>
400const char* LevelPositionIterator::class_name_str = "LevelPositionIterator";
401LevelPositionIterator::class_factory<LevelPositionIterator>
402LevelPositionIterator::g_class_factory;
403
404const serialization::ClassVersion
405LevelPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
406
407const int LevelPositionIterator::class_versions_count =
408sizeof(LevelPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
409
410void LevelPositionIterator::accept(PlanIterVisitor& v) const {
411 v.beginVisit(*this);
412
413 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
414 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
415 for ( ; lIter != lEnd; ++lIter ){
416 (*lIter)->accept(v);
417 }
418
419 v.endVisit(*this);
420}
421
422LevelPositionIterator::~LevelPositionIterator() {}
423
424// </LevelPositionIterator>
425
426
427// <IsAttributePositionIterator>
428const char* IsAttributePositionIterator::class_name_str = "IsAttributePositionIterator";
429IsAttributePositionIterator::class_factory<IsAttributePositionIterator>
430IsAttributePositionIterator::g_class_factory;
431
432const serialization::ClassVersion
433IsAttributePositionIterator::class_versions[] ={{ 1, 0x000905, false}};
434
435const int IsAttributePositionIterator::class_versions_count =
436sizeof(IsAttributePositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
437
438void IsAttributePositionIterator::accept(PlanIterVisitor& v) const {
439 v.beginVisit(*this);
440
441 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
442 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
443 for ( ; lIter != lEnd; ++lIter ){
444 (*lIter)->accept(v);
445 }
446
447 v.endVisit(*this);
448}
449
450IsAttributePositionIterator::~IsAttributePositionIterator() {}
451
452// </IsAttributePositionIterator>
453
454
455// <IsCommentPositionIterator>
456const char* IsCommentPositionIterator::class_name_str = "IsCommentPositionIterator";
457IsCommentPositionIterator::class_factory<IsCommentPositionIterator>
458IsCommentPositionIterator::g_class_factory;
459
460const serialization::ClassVersion
461IsCommentPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
462
463const int IsCommentPositionIterator::class_versions_count =
464sizeof(IsCommentPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
465
466void IsCommentPositionIterator::accept(PlanIterVisitor& v) const {
467 v.beginVisit(*this);
468
469 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
470 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
471 for ( ; lIter != lEnd; ++lIter ){
472 (*lIter)->accept(v);
473 }
474
475 v.endVisit(*this);
476}
477
478IsCommentPositionIterator::~IsCommentPositionIterator() {}
479
480// </IsCommentPositionIterator>
481
482
483// <IsDocumentPositionIterator>
484const char* IsDocumentPositionIterator::class_name_str = "IsDocumentPositionIterator";
485IsDocumentPositionIterator::class_factory<IsDocumentPositionIterator>
486IsDocumentPositionIterator::g_class_factory;
487
488const serialization::ClassVersion
489IsDocumentPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
490
491const int IsDocumentPositionIterator::class_versions_count =
492sizeof(IsDocumentPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
493
494void IsDocumentPositionIterator::accept(PlanIterVisitor& v) const {
495 v.beginVisit(*this);
496
497 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
498 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
499 for ( ; lIter != lEnd; ++lIter ){
500 (*lIter)->accept(v);
501 }
502
503 v.endVisit(*this);
504}
505
506IsDocumentPositionIterator::~IsDocumentPositionIterator() {}
507
508// </IsDocumentPositionIterator>
509
510
511// <IsElementPositionIterator>
512const char* IsElementPositionIterator::class_name_str = "IsElementPositionIterator";
513IsElementPositionIterator::class_factory<IsElementPositionIterator>
514IsElementPositionIterator::g_class_factory;
515
516const serialization::ClassVersion
517IsElementPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
518
519const int IsElementPositionIterator::class_versions_count =
520sizeof(IsElementPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
521
522void IsElementPositionIterator::accept(PlanIterVisitor& v) const {
523 v.beginVisit(*this);
524
525 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
526 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
527 for ( ; lIter != lEnd; ++lIter ){
528 (*lIter)->accept(v);
529 }
530
531 v.endVisit(*this);
532}
533
534IsElementPositionIterator::~IsElementPositionIterator() {}
535
536// </IsElementPositionIterator>
537
538
539// <IsProcessingInstructionPositionIterator>
540const char* IsProcessingInstructionPositionIterator::class_name_str = "IsProcessingInstructionPositionIterator";
541IsProcessingInstructionPositionIterator::class_factory<IsProcessingInstructionPositionIterator>
542IsProcessingInstructionPositionIterator::g_class_factory;
543
544const serialization::ClassVersion
545IsProcessingInstructionPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
546
547const int IsProcessingInstructionPositionIterator::class_versions_count =
548sizeof(IsProcessingInstructionPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
549
550void IsProcessingInstructionPositionIterator::accept(PlanIterVisitor& v) const {
551 v.beginVisit(*this);
552
553 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
554 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
555 for ( ; lIter != lEnd; ++lIter ){
556 (*lIter)->accept(v);
557 }
558
559 v.endVisit(*this);
560}
561
562IsProcessingInstructionPositionIterator::~IsProcessingInstructionPositionIterator() {}
563
564// </IsProcessingInstructionPositionIterator>
565
566
567// <IsTextPositionIterator>
568const char* IsTextPositionIterator::class_name_str = "IsTextPositionIterator";
569IsTextPositionIterator::class_factory<IsTextPositionIterator>
570IsTextPositionIterator::g_class_factory;
571
572const serialization::ClassVersion
573IsTextPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
574
575const int IsTextPositionIterator::class_versions_count =
576sizeof(IsTextPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
577
578void IsTextPositionIterator::accept(PlanIterVisitor& v) const {
579 v.beginVisit(*this);
580
581 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
582 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
583 for ( ; lIter != lEnd; ++lIter ){
584 (*lIter)->accept(v);
585 }
586
587 v.endVisit(*this);
588}
589
590IsTextPositionIterator::~IsTextPositionIterator() {}
591
592// </IsTextPositionIterator>
593
594
595// <IsSiblingPositionIterator>
596const char* IsSiblingPositionIterator::class_name_str = "IsSiblingPositionIterator";
597IsSiblingPositionIterator::class_factory<IsSiblingPositionIterator>
598IsSiblingPositionIterator::g_class_factory;
599
600const serialization::ClassVersion
601IsSiblingPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
602
603const int IsSiblingPositionIterator::class_versions_count =
604sizeof(IsSiblingPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
605
606void IsSiblingPositionIterator::accept(PlanIterVisitor& v) const {
607 v.beginVisit(*this);
608
609 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
610 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
611 for ( ; lIter != lEnd; ++lIter ){
612 (*lIter)->accept(v);
613 }
614
615 v.endVisit(*this);
616}
617
618IsSiblingPositionIterator::~IsSiblingPositionIterator() {}
619
620// </IsSiblingPositionIterator>
621
622
623// <InSameTreePositionIterator>
624const char* InSameTreePositionIterator::class_name_str = "InSameTreePositionIterator";
625InSameTreePositionIterator::class_factory<InSameTreePositionIterator>
626InSameTreePositionIterator::g_class_factory;
627
628const serialization::ClassVersion
629InSameTreePositionIterator::class_versions[] ={{ 1, 0x000905, false}};
630
631const int InSameTreePositionIterator::class_versions_count =
632sizeof(InSameTreePositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
633
634void InSameTreePositionIterator::accept(PlanIterVisitor& v) const {
635 v.beginVisit(*this);
636
637 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
638 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
639 for ( ; lIter != lEnd; ++lIter ){
640 (*lIter)->accept(v);
641 }
642
643 v.endVisit(*this);
644}
645
646InSameTreePositionIterator::~InSameTreePositionIterator() {}
647
648// </InSameTreePositionIterator>
649
650
651// <InCollectionPositionIterator>
652const char* InCollectionPositionIterator::class_name_str = "InCollectionPositionIterator";
653InCollectionPositionIterator::class_factory<InCollectionPositionIterator>
654InCollectionPositionIterator::g_class_factory;
655
656const serialization::ClassVersion
657InCollectionPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
658
659const int InCollectionPositionIterator::class_versions_count =
660sizeof(InCollectionPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
661
662void InCollectionPositionIterator::accept(PlanIterVisitor& v) const {
663 v.beginVisit(*this);
664
665 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
666 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
667 for ( ; lIter != lEnd; ++lIter ){
668 (*lIter)->accept(v);
669 }
670
671 v.endVisit(*this);
672}
673
674InCollectionPositionIterator::~InCollectionPositionIterator() {}
675
676// </InCollectionPositionIterator>
677
678
679// <InSameCollectionPositionIterator>
680const char* InSameCollectionPositionIterator::class_name_str = "InSameCollectionPositionIterator";
681InSameCollectionPositionIterator::class_factory<InSameCollectionPositionIterator>
682InSameCollectionPositionIterator::g_class_factory;
683
684const serialization::ClassVersion
685InSameCollectionPositionIterator::class_versions[] ={{ 1, 0x000905, false}};
686
687const int InSameCollectionPositionIterator::class_versions_count =
688sizeof(InSameCollectionPositionIterator::class_versions)/sizeof(struct serialization::ClassVersion);
689
690void InSameCollectionPositionIterator::accept(PlanIterVisitor& v) const {
691 v.beginVisit(*this);
692
693 std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
694 std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
695 for ( ; lIter != lEnd; ++lIter ){
696 (*lIter)->accept(v);
697 }
698
699 v.endVisit(*this);
700}
701
702InSameCollectionPositionIterator::~InSameCollectionPositionIterator() {}
703
704// </InSameCollectionPositionIterator>
705
706
707
708}
709
710
0711
=== added file 'src/runtime/nodes/pregenerated/node_position.h'
--- src/runtime/nodes/pregenerated/node_position.h 1970-01-01 00:00:00 +0000
+++ src/runtime/nodes/pregenerated/node_position.h 2011-11-02 17:26:24 +0000
@@ -0,0 +1,858 @@
1/*
2 * Copyright 2006-2008 The FLWOR Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17// ******************************************
18// * *
19// * THIS IS A GENERATED FILE. DO NOT EDIT! *
20// * SEE .xml FILE WITH SAME NAME *
21// * *
22// ******************************************
23#ifndef ZORBA_RUNTIME_NODES_NODE_POSITION_H
24#define ZORBA_RUNTIME_NODES_NODE_POSITION_H
25
26
27#include "common/shared_types.h"
28
29
30
31#include "runtime/base/narybase.h"
32
33
34namespace zorba {
35
36/**
37 *
38 * Author: Federico Cavalieri
39 */
40class NodePositionIterator : public NaryBaseIterator<NodePositionIterator, PlanIteratorState>
41{
42public:
43 SERIALIZABLE_CLASS(NodePositionIterator);
44
45 SERIALIZABLE_CLASS_CONSTRUCTOR2T(NodePositionIterator,
46 NaryBaseIterator<NodePositionIterator, PlanIteratorState>);
47
48 void serialize( ::zorba::serialization::Archiver& ar)
49 {
50 serialize_baseclass(ar,
51 (NaryBaseIterator<NodePositionIterator, PlanIteratorState>*)this);
52 }
53
54 NodePositionIterator(
55 static_context* sctx,
56 const QueryLoc& loc,
57 std::vector<PlanIter_t>& children)
58 :
59 NaryBaseIterator<NodePositionIterator, PlanIteratorState>(sctx, loc, children)
60 {}
61
62 virtual ~NodePositionIterator();
63
64 void accept(PlanIterVisitor& v) const;
65
66 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
67};
68
69
70/**
71 *
72 * Author: Federico Cavalieri
73 */
74class IsAncestorPositionIterator : public NaryBaseIterator<IsAncestorPositionIterator, PlanIteratorState>
75{
76public:
77 SERIALIZABLE_CLASS(IsAncestorPositionIterator);
78
79 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsAncestorPositionIterator,
80 NaryBaseIterator<IsAncestorPositionIterator, PlanIteratorState>);
81
82 void serialize( ::zorba::serialization::Archiver& ar)
83 {
84 serialize_baseclass(ar,
85 (NaryBaseIterator<IsAncestorPositionIterator, PlanIteratorState>*)this);
86 }
87
88 IsAncestorPositionIterator(
89 static_context* sctx,
90 const QueryLoc& loc,
91 std::vector<PlanIter_t>& children)
92 :
93 NaryBaseIterator<IsAncestorPositionIterator, PlanIteratorState>(sctx, loc, children)
94 {}
95
96 virtual ~IsAncestorPositionIterator();
97
98 void accept(PlanIterVisitor& v) const;
99
100 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
101};
102
103
104/**
105 *
106 * Author: Federico Cavalieri
107 */
108class IsFollowingSiblingPositionIterator : public NaryBaseIterator<IsFollowingSiblingPositionIterator, PlanIteratorState>
109{
110public:
111 SERIALIZABLE_CLASS(IsFollowingSiblingPositionIterator);
112
113 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsFollowingSiblingPositionIterator,
114 NaryBaseIterator<IsFollowingSiblingPositionIterator, PlanIteratorState>);
115
116 void serialize( ::zorba::serialization::Archiver& ar)
117 {
118 serialize_baseclass(ar,
119 (NaryBaseIterator<IsFollowingSiblingPositionIterator, PlanIteratorState>*)this);
120 }
121
122 IsFollowingSiblingPositionIterator(
123 static_context* sctx,
124 const QueryLoc& loc,
125 std::vector<PlanIter_t>& children)
126 :
127 NaryBaseIterator<IsFollowingSiblingPositionIterator, PlanIteratorState>(sctx, loc, children)
128 {}
129
130 virtual ~IsFollowingSiblingPositionIterator();
131
132 void accept(PlanIterVisitor& v) const;
133
134 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
135};
136
137
138/**
139 *
140 * Author: Federico Cavalieri
141 */
142class IsFollowingPositionIterator : public NaryBaseIterator<IsFollowingPositionIterator, PlanIteratorState>
143{
144public:
145 SERIALIZABLE_CLASS(IsFollowingPositionIterator);
146
147 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsFollowingPositionIterator,
148 NaryBaseIterator<IsFollowingPositionIterator, PlanIteratorState>);
149
150 void serialize( ::zorba::serialization::Archiver& ar)
151 {
152 serialize_baseclass(ar,
153 (NaryBaseIterator<IsFollowingPositionIterator, PlanIteratorState>*)this);
154 }
155
156 IsFollowingPositionIterator(
157 static_context* sctx,
158 const QueryLoc& loc,
159 std::vector<PlanIter_t>& children)
160 :
161 NaryBaseIterator<IsFollowingPositionIterator, PlanIteratorState>(sctx, loc, children)
162 {}
163
164 virtual ~IsFollowingPositionIterator();
165
166 void accept(PlanIterVisitor& v) const;
167
168 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
169};
170
171
172/**
173 *
174 * Author: Federico Cavalieri
175 */
176class IsInSubtreeOfPositionIterator : public NaryBaseIterator<IsInSubtreeOfPositionIterator, PlanIteratorState>
177{
178public:
179 SERIALIZABLE_CLASS(IsInSubtreeOfPositionIterator);
180
181 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsInSubtreeOfPositionIterator,
182 NaryBaseIterator<IsInSubtreeOfPositionIterator, PlanIteratorState>);
183
184 void serialize( ::zorba::serialization::Archiver& ar)
185 {
186 serialize_baseclass(ar,
187 (NaryBaseIterator<IsInSubtreeOfPositionIterator, PlanIteratorState>*)this);
188 }
189
190 IsInSubtreeOfPositionIterator(
191 static_context* sctx,
192 const QueryLoc& loc,
193 std::vector<PlanIter_t>& children)
194 :
195 NaryBaseIterator<IsInSubtreeOfPositionIterator, PlanIteratorState>(sctx, loc, children)
196 {}
197
198 virtual ~IsInSubtreeOfPositionIterator();
199
200 void accept(PlanIterVisitor& v) const;
201
202 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
203};
204
205
206/**
207 *
208 * Author: Federico Cavalieri
209 */
210class IsDescendantPositionIterator : public NaryBaseIterator<IsDescendantPositionIterator, PlanIteratorState>
211{
212public:
213 SERIALIZABLE_CLASS(IsDescendantPositionIterator);
214
215 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsDescendantPositionIterator,
216 NaryBaseIterator<IsDescendantPositionIterator, PlanIteratorState>);
217
218 void serialize( ::zorba::serialization::Archiver& ar)
219 {
220 serialize_baseclass(ar,
221 (NaryBaseIterator<IsDescendantPositionIterator, PlanIteratorState>*)this);
222 }
223
224 IsDescendantPositionIterator(
225 static_context* sctx,
226 const QueryLoc& loc,
227 std::vector<PlanIter_t>& children)
228 :
229 NaryBaseIterator<IsDescendantPositionIterator, PlanIteratorState>(sctx, loc, children)
230 {}
231
232 virtual ~IsDescendantPositionIterator();
233
234 void accept(PlanIterVisitor& v) const;
235
236 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
237};
238
239
240/**
241 *
242 * Author: Federico Cavalieri
243 */
244class IsPrecedingSiblingPositionIterator : public NaryBaseIterator<IsPrecedingSiblingPositionIterator, PlanIteratorState>
245{
246public:
247 SERIALIZABLE_CLASS(IsPrecedingSiblingPositionIterator);
248
249 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsPrecedingSiblingPositionIterator,
250 NaryBaseIterator<IsPrecedingSiblingPositionIterator, PlanIteratorState>);
251
252 void serialize( ::zorba::serialization::Archiver& ar)
253 {
254 serialize_baseclass(ar,
255 (NaryBaseIterator<IsPrecedingSiblingPositionIterator, PlanIteratorState>*)this);
256 }
257
258 IsPrecedingSiblingPositionIterator(
259 static_context* sctx,
260 const QueryLoc& loc,
261 std::vector<PlanIter_t>& children)
262 :
263 NaryBaseIterator<IsPrecedingSiblingPositionIterator, PlanIteratorState>(sctx, loc, children)
264 {}
265
266 virtual ~IsPrecedingSiblingPositionIterator();
267
268 void accept(PlanIterVisitor& v) const;
269
270 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
271};
272
273
274/**
275 *
276 * Author: Federico Cavalieri
277 */
278class IsPrecedingPositionIterator : public NaryBaseIterator<IsPrecedingPositionIterator, PlanIteratorState>
279{
280public:
281 SERIALIZABLE_CLASS(IsPrecedingPositionIterator);
282
283 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsPrecedingPositionIterator,
284 NaryBaseIterator<IsPrecedingPositionIterator, PlanIteratorState>);
285
286 void serialize( ::zorba::serialization::Archiver& ar)
287 {
288 serialize_baseclass(ar,
289 (NaryBaseIterator<IsPrecedingPositionIterator, PlanIteratorState>*)this);
290 }
291
292 IsPrecedingPositionIterator(
293 static_context* sctx,
294 const QueryLoc& loc,
295 std::vector<PlanIter_t>& children)
296 :
297 NaryBaseIterator<IsPrecedingPositionIterator, PlanIteratorState>(sctx, loc, children)
298 {}
299
300 virtual ~IsPrecedingPositionIterator();
301
302 void accept(PlanIterVisitor& v) const;
303
304 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
305};
306
307
308/**
309 *
310 * Author: Federico Cavalieri
311 */
312class IsChildPositionIterator : public NaryBaseIterator<IsChildPositionIterator, PlanIteratorState>
313{
314public:
315 SERIALIZABLE_CLASS(IsChildPositionIterator);
316
317 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsChildPositionIterator,
318 NaryBaseIterator<IsChildPositionIterator, PlanIteratorState>);
319
320 void serialize( ::zorba::serialization::Archiver& ar)
321 {
322 serialize_baseclass(ar,
323 (NaryBaseIterator<IsChildPositionIterator, PlanIteratorState>*)this);
324 }
325
326 IsChildPositionIterator(
327 static_context* sctx,
328 const QueryLoc& loc,
329 std::vector<PlanIter_t>& children)
330 :
331 NaryBaseIterator<IsChildPositionIterator, PlanIteratorState>(sctx, loc, children)
332 {}
333
334 virtual ~IsChildPositionIterator();
335
336 void accept(PlanIterVisitor& v) const;
337
338 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
339};
340
341
342/**
343 *
344 * Author: Federico Cavalieri
345 */
346class IsAttributeOfPositionIterator : public NaryBaseIterator<IsAttributeOfPositionIterator, PlanIteratorState>
347{
348public:
349 SERIALIZABLE_CLASS(IsAttributeOfPositionIterator);
350
351 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsAttributeOfPositionIterator,
352 NaryBaseIterator<IsAttributeOfPositionIterator, PlanIteratorState>);
353
354 void serialize( ::zorba::serialization::Archiver& ar)
355 {
356 serialize_baseclass(ar,
357 (NaryBaseIterator<IsAttributeOfPositionIterator, PlanIteratorState>*)this);
358 }
359
360 IsAttributeOfPositionIterator(
361 static_context* sctx,
362 const QueryLoc& loc,
363 std::vector<PlanIter_t>& children)
364 :
365 NaryBaseIterator<IsAttributeOfPositionIterator, PlanIteratorState>(sctx, loc, children)
366 {}
367
368 virtual ~IsAttributeOfPositionIterator();
369
370 void accept(PlanIterVisitor& v) const;
371
372 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
373};
374
375
376/**
377 *
378 * Author: Federico Cavalieri
379 */
380class IsParentPositionIterator : public NaryBaseIterator<IsParentPositionIterator, PlanIteratorState>
381{
382public:
383 SERIALIZABLE_CLASS(IsParentPositionIterator);
384
385 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsParentPositionIterator,
386 NaryBaseIterator<IsParentPositionIterator, PlanIteratorState>);
387
388 void serialize( ::zorba::serialization::Archiver& ar)
389 {
390 serialize_baseclass(ar,
391 (NaryBaseIterator<IsParentPositionIterator, PlanIteratorState>*)this);
392 }
393
394 IsParentPositionIterator(
395 static_context* sctx,
396 const QueryLoc& loc,
397 std::vector<PlanIter_t>& children)
398 :
399 NaryBaseIterator<IsParentPositionIterator, PlanIteratorState>(sctx, loc, children)
400 {}
401
402 virtual ~IsParentPositionIterator();
403
404 void accept(PlanIterVisitor& v) const;
405
406 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
407};
408
409
410/**
411 *
412 * Author: Federico Cavalieri
413 */
414class IsPrecedingInDocumentOrderPositionIterator : public NaryBaseIterator<IsPrecedingInDocumentOrderPositionIterator, PlanIteratorState>
415{
416public:
417 SERIALIZABLE_CLASS(IsPrecedingInDocumentOrderPositionIterator);
418
419 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsPrecedingInDocumentOrderPositionIterator,
420 NaryBaseIterator<IsPrecedingInDocumentOrderPositionIterator, PlanIteratorState>);
421
422 void serialize( ::zorba::serialization::Archiver& ar)
423 {
424 serialize_baseclass(ar,
425 (NaryBaseIterator<IsPrecedingInDocumentOrderPositionIterator, PlanIteratorState>*)this);
426 }
427
428 IsPrecedingInDocumentOrderPositionIterator(
429 static_context* sctx,
430 const QueryLoc& loc,
431 std::vector<PlanIter_t>& children)
432 :
433 NaryBaseIterator<IsPrecedingInDocumentOrderPositionIterator, PlanIteratorState>(sctx, loc, children)
434 {}
435
436 virtual ~IsPrecedingInDocumentOrderPositionIterator();
437
438 void accept(PlanIterVisitor& v) const;
439
440 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
441};
442
443
444/**
445 *
446 * Author: Federico Cavalieri
447 */
448class IsFollowingInDocumentOrderPositionIterator : public NaryBaseIterator<IsFollowingInDocumentOrderPositionIterator, PlanIteratorState>
449{
450public:
451 SERIALIZABLE_CLASS(IsFollowingInDocumentOrderPositionIterator);
452
453 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsFollowingInDocumentOrderPositionIterator,
454 NaryBaseIterator<IsFollowingInDocumentOrderPositionIterator, PlanIteratorState>);
455
456 void serialize( ::zorba::serialization::Archiver& ar)
457 {
458 serialize_baseclass(ar,
459 (NaryBaseIterator<IsFollowingInDocumentOrderPositionIterator, PlanIteratorState>*)this);
460 }
461
462 IsFollowingInDocumentOrderPositionIterator(
463 static_context* sctx,
464 const QueryLoc& loc,
465 std::vector<PlanIter_t>& children)
466 :
467 NaryBaseIterator<IsFollowingInDocumentOrderPositionIterator, PlanIteratorState>(sctx, loc, children)
468 {}
469
470 virtual ~IsFollowingInDocumentOrderPositionIterator();
471
472 void accept(PlanIterVisitor& v) const;
473
474 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
475};
476
477
478/**
479 *
480 * Author: Federico Cavalieri
481 */
482class LevelPositionIterator : public NaryBaseIterator<LevelPositionIterator, PlanIteratorState>
483{
484public:
485 SERIALIZABLE_CLASS(LevelPositionIterator);
486
487 SERIALIZABLE_CLASS_CONSTRUCTOR2T(LevelPositionIterator,
488 NaryBaseIterator<LevelPositionIterator, PlanIteratorState>);
489
490 void serialize( ::zorba::serialization::Archiver& ar)
491 {
492 serialize_baseclass(ar,
493 (NaryBaseIterator<LevelPositionIterator, PlanIteratorState>*)this);
494 }
495
496 LevelPositionIterator(
497 static_context* sctx,
498 const QueryLoc& loc,
499 std::vector<PlanIter_t>& children)
500 :
501 NaryBaseIterator<LevelPositionIterator, PlanIteratorState>(sctx, loc, children)
502 {}
503
504 virtual ~LevelPositionIterator();
505
506 void accept(PlanIterVisitor& v) const;
507
508 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
509};
510
511
512/**
513 *
514 * Author: Federico Cavalieri
515 */
516class IsAttributePositionIterator : public NaryBaseIterator<IsAttributePositionIterator, PlanIteratorState>
517{
518public:
519 SERIALIZABLE_CLASS(IsAttributePositionIterator);
520
521 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsAttributePositionIterator,
522 NaryBaseIterator<IsAttributePositionIterator, PlanIteratorState>);
523
524 void serialize( ::zorba::serialization::Archiver& ar)
525 {
526 serialize_baseclass(ar,
527 (NaryBaseIterator<IsAttributePositionIterator, PlanIteratorState>*)this);
528 }
529
530 IsAttributePositionIterator(
531 static_context* sctx,
532 const QueryLoc& loc,
533 std::vector<PlanIter_t>& children)
534 :
535 NaryBaseIterator<IsAttributePositionIterator, PlanIteratorState>(sctx, loc, children)
536 {}
537
538 virtual ~IsAttributePositionIterator();
539
540 void accept(PlanIterVisitor& v) const;
541
542 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
543};
544
545
546/**
547 *
548 * Author: Federico Cavalieri
549 */
550class IsCommentPositionIterator : public NaryBaseIterator<IsCommentPositionIterator, PlanIteratorState>
551{
552public:
553 SERIALIZABLE_CLASS(IsCommentPositionIterator);
554
555 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsCommentPositionIterator,
556 NaryBaseIterator<IsCommentPositionIterator, PlanIteratorState>);
557
558 void serialize( ::zorba::serialization::Archiver& ar)
559 {
560 serialize_baseclass(ar,
561 (NaryBaseIterator<IsCommentPositionIterator, PlanIteratorState>*)this);
562 }
563
564 IsCommentPositionIterator(
565 static_context* sctx,
566 const QueryLoc& loc,
567 std::vector<PlanIter_t>& children)
568 :
569 NaryBaseIterator<IsCommentPositionIterator, PlanIteratorState>(sctx, loc, children)
570 {}
571
572 virtual ~IsCommentPositionIterator();
573
574 void accept(PlanIterVisitor& v) const;
575
576 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
577};
578
579
580/**
581 *
582 * Author: Federico Cavalieri
583 */
584class IsDocumentPositionIterator : public NaryBaseIterator<IsDocumentPositionIterator, PlanIteratorState>
585{
586public:
587 SERIALIZABLE_CLASS(IsDocumentPositionIterator);
588
589 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsDocumentPositionIterator,
590 NaryBaseIterator<IsDocumentPositionIterator, PlanIteratorState>);
591
592 void serialize( ::zorba::serialization::Archiver& ar)
593 {
594 serialize_baseclass(ar,
595 (NaryBaseIterator<IsDocumentPositionIterator, PlanIteratorState>*)this);
596 }
597
598 IsDocumentPositionIterator(
599 static_context* sctx,
600 const QueryLoc& loc,
601 std::vector<PlanIter_t>& children)
602 :
603 NaryBaseIterator<IsDocumentPositionIterator, PlanIteratorState>(sctx, loc, children)
604 {}
605
606 virtual ~IsDocumentPositionIterator();
607
608 void accept(PlanIterVisitor& v) const;
609
610 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
611};
612
613
614/**
615 *
616 * Author: Federico Cavalieri
617 */
618class IsElementPositionIterator : public NaryBaseIterator<IsElementPositionIterator, PlanIteratorState>
619{
620public:
621 SERIALIZABLE_CLASS(IsElementPositionIterator);
622
623 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsElementPositionIterator,
624 NaryBaseIterator<IsElementPositionIterator, PlanIteratorState>);
625
626 void serialize( ::zorba::serialization::Archiver& ar)
627 {
628 serialize_baseclass(ar,
629 (NaryBaseIterator<IsElementPositionIterator, PlanIteratorState>*)this);
630 }
631
632 IsElementPositionIterator(
633 static_context* sctx,
634 const QueryLoc& loc,
635 std::vector<PlanIter_t>& children)
636 :
637 NaryBaseIterator<IsElementPositionIterator, PlanIteratorState>(sctx, loc, children)
638 {}
639
640 virtual ~IsElementPositionIterator();
641
642 void accept(PlanIterVisitor& v) const;
643
644 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
645};
646
647
648/**
649 *
650 * Author: Federico Cavalieri
651 */
652class IsProcessingInstructionPositionIterator : public NaryBaseIterator<IsProcessingInstructionPositionIterator, PlanIteratorState>
653{
654public:
655 SERIALIZABLE_CLASS(IsProcessingInstructionPositionIterator);
656
657 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsProcessingInstructionPositionIterator,
658 NaryBaseIterator<IsProcessingInstructionPositionIterator, PlanIteratorState>);
659
660 void serialize( ::zorba::serialization::Archiver& ar)
661 {
662 serialize_baseclass(ar,
663 (NaryBaseIterator<IsProcessingInstructionPositionIterator, PlanIteratorState>*)this);
664 }
665
666 IsProcessingInstructionPositionIterator(
667 static_context* sctx,
668 const QueryLoc& loc,
669 std::vector<PlanIter_t>& children)
670 :
671 NaryBaseIterator<IsProcessingInstructionPositionIterator, PlanIteratorState>(sctx, loc, children)
672 {}
673
674 virtual ~IsProcessingInstructionPositionIterator();
675
676 void accept(PlanIterVisitor& v) const;
677
678 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
679};
680
681
682/**
683 *
684 * Author: Federico Cavalieri
685 */
686class IsTextPositionIterator : public NaryBaseIterator<IsTextPositionIterator, PlanIteratorState>
687{
688public:
689 SERIALIZABLE_CLASS(IsTextPositionIterator);
690
691 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsTextPositionIterator,
692 NaryBaseIterator<IsTextPositionIterator, PlanIteratorState>);
693
694 void serialize( ::zorba::serialization::Archiver& ar)
695 {
696 serialize_baseclass(ar,
697 (NaryBaseIterator<IsTextPositionIterator, PlanIteratorState>*)this);
698 }
699
700 IsTextPositionIterator(
701 static_context* sctx,
702 const QueryLoc& loc,
703 std::vector<PlanIter_t>& children)
704 :
705 NaryBaseIterator<IsTextPositionIterator, PlanIteratorState>(sctx, loc, children)
706 {}
707
708 virtual ~IsTextPositionIterator();
709
710 void accept(PlanIterVisitor& v) const;
711
712 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
713};
714
715
716/**
717 *
718 * Author: Federico Cavalieri
719 */
720class IsSiblingPositionIterator : public NaryBaseIterator<IsSiblingPositionIterator, PlanIteratorState>
721{
722public:
723 SERIALIZABLE_CLASS(IsSiblingPositionIterator);
724
725 SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsSiblingPositionIterator,
726 NaryBaseIterator<IsSiblingPositionIterator, PlanIteratorState>);
727
728 void serialize( ::zorba::serialization::Archiver& ar)
729 {
730 serialize_baseclass(ar,
731 (NaryBaseIterator<IsSiblingPositionIterator, PlanIteratorState>*)this);
732 }
733
734 IsSiblingPositionIterator(
735 static_context* sctx,
736 const QueryLoc& loc,
737 std::vector<PlanIter_t>& children)
738 :
739 NaryBaseIterator<IsSiblingPositionIterator, PlanIteratorState>(sctx, loc, children)
740 {}
741
742 virtual ~IsSiblingPositionIterator();
743
744 void accept(PlanIterVisitor& v) const;
745
746 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
747};
748
749
750/**
751 *
752 * Author: Federico Cavalieri
753 */
754class InSameTreePositionIterator : public NaryBaseIterator<InSameTreePositionIterator, PlanIteratorState>
755{
756public:
757 SERIALIZABLE_CLASS(InSameTreePositionIterator);
758
759 SERIALIZABLE_CLASS_CONSTRUCTOR2T(InSameTreePositionIterator,
760 NaryBaseIterator<InSameTreePositionIterator, PlanIteratorState>);
761
762 void serialize( ::zorba::serialization::Archiver& ar)
763 {
764 serialize_baseclass(ar,
765 (NaryBaseIterator<InSameTreePositionIterator, PlanIteratorState>*)this);
766 }
767
768 InSameTreePositionIterator(
769 static_context* sctx,
770 const QueryLoc& loc,
771 std::vector<PlanIter_t>& children)
772 :
773 NaryBaseIterator<InSameTreePositionIterator, PlanIteratorState>(sctx, loc, children)
774 {}
775
776 virtual ~InSameTreePositionIterator();
777
778 void accept(PlanIterVisitor& v) const;
779
780 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
781};
782
783
784/**
785 *
786 * Author: Federico Cavalieri
787 */
788class InCollectionPositionIterator : public NaryBaseIterator<InCollectionPositionIterator, PlanIteratorState>
789{
790public:
791 SERIALIZABLE_CLASS(InCollectionPositionIterator);
792
793 SERIALIZABLE_CLASS_CONSTRUCTOR2T(InCollectionPositionIterator,
794 NaryBaseIterator<InCollectionPositionIterator, PlanIteratorState>);
795
796 void serialize( ::zorba::serialization::Archiver& ar)
797 {
798 serialize_baseclass(ar,
799 (NaryBaseIterator<InCollectionPositionIterator, PlanIteratorState>*)this);
800 }
801
802 InCollectionPositionIterator(
803 static_context* sctx,
804 const QueryLoc& loc,
805 std::vector<PlanIter_t>& children)
806 :
807 NaryBaseIterator<InCollectionPositionIterator, PlanIteratorState>(sctx, loc, children)
808 {}
809
810 virtual ~InCollectionPositionIterator();
811
812 void accept(PlanIterVisitor& v) const;
813
814 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
815};
816
817
818/**
819 *
820 * Author: Federico Cavalieri
821 */
822class InSameCollectionPositionIterator : public NaryBaseIterator<InSameCollectionPositionIterator, PlanIteratorState>
823{
824public:
825 SERIALIZABLE_CLASS(InSameCollectionPositionIterator);
826
827 SERIALIZABLE_CLASS_CONSTRUCTOR2T(InSameCollectionPositionIterator,
828 NaryBaseIterator<InSameCollectionPositionIterator, PlanIteratorState>);
829
830 void serialize( ::zorba::serialization::Archiver& ar)
831 {
832 serialize_baseclass(ar,
833 (NaryBaseIterator<InSameCollectionPositionIterator, PlanIteratorState>*)this);
834 }
835
836 InSameCollectionPositionIterator(
837 static_context* sctx,
838 const QueryLoc& loc,
839 std::vector<PlanIter_t>& children)
840 :
841 NaryBaseIterator<InSameCollectionPositionIterator, PlanIteratorState>(sctx, loc, children)
842 {}
843
844 virtual ~InSameCollectionPositionIterator();
845
846 void accept(PlanIterVisitor& v) const;
847
848 bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
849};
850
851
852}
853#endif
854/*
855 * Local variables:
856 * mode: c++
857 * End:
858 */
0859
=== modified file 'src/runtime/spec/mappings.xml'
--- src/runtime/spec/mappings.xml 2011-09-30 08:08:13 +0000
+++ src/runtime/spec/mappings.xml 2011-11-02 17:26:24 +0000
@@ -22,7 +22,11 @@
2222
23 <zorba:namespace uri="http://www.zorba-xquery.com/modules/node-reference"23 <zorba:namespace uri="http://www.zorba-xquery.com/modules/node-reference"
24 define="ZORBA_NODEREF_FN_NS"24 define="ZORBA_NODEREF_FN_NS"
25 prefix="fn-zorba-ref"/> 25 prefix="fn-zorba-ref"/>
26
27 <zorba:namespace uri="http://www.zorba-xquery.com/modules/node-position"
28 define="ZORBA_NODEPOS_FN_NS"
29 prefix="fn-zorba-pos"/>
2630
27 <zorba:namespace uri="http://www.zorba-xquery.com/modules/schema"31 <zorba:namespace uri="http://www.zorba-xquery.com/modules/schema"
28 define="ZORBA_SCHEMA_FN_NS"32 define="ZORBA_SCHEMA_FN_NS"
2933
=== added file 'src/runtime/spec/nodes/node_position.xml'
--- src/runtime/spec/nodes/node_position.xml 1970-01-01 00:00:00 +0000
+++ src/runtime/spec/nodes/node_position.xml 2011-11-02 17:26:24 +0000
@@ -0,0 +1,439 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3<!--
4/////////////////////////////////////////////////////////////////////////////////
5// //
6/////////////////////////////////////////////////////////////////////////////////
7-->
8<zorba:iterators
9 xmlns:zorba="http://www.zorba-xquery.com"
10 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11 xsi:schemaLocation="http://www.zorba-xquery.com ../runtime.xsd">
12
13 <!--
14/*******************************************************************************
15********************************************************************************/
16-->
17<zorba:iterator name="NodePositionIterator">
18
19 <zorba:description author="Federico Cavalieri"></zorba:description>
20
21 <zorba:function>
22 <zorba:signature localname="node-position" prefix="fn-zorba-pos">
23 <zorba:param>node()</zorba:param>
24 <zorba:output>xs:anyURI</zorba:output>
25 </zorba:signature>
26 </zorba:function>
27
28</zorba:iterator>
29
30 <!--
31/*******************************************************************************
32********************************************************************************/
33-->
34 <zorba:iterator name="IsAncestorPositionIterator">
35
36 <zorba:description author="Federico Cavalieri"></zorba:description>
37
38 <zorba:function>
39 <zorba:signature localname="ancestor-of" prefix="fn-zorba-pos">
40 <zorba:param>xs:anyURI</zorba:param>
41 <zorba:param>xs:anyURI</zorba:param>
42 <zorba:output>xs:boolean</zorba:output>
43 </zorba:signature>
44 </zorba:function>
45
46 </zorba:iterator>
47
48 <!--
49/*******************************************************************************
50********************************************************************************/
51-->
52 <zorba:iterator name="IsFollowingSiblingPositionIterator">
53
54 <zorba:description author="Federico Cavalieri"></zorba:description>
55
56 <zorba:function>
57 <zorba:signature localname="following-sibling-of" prefix="fn-zorba-pos">
58 <zorba:param>xs:anyURI</zorba:param>
59 <zorba:param>xs:anyURI</zorba:param>
60 <zorba:output>xs:boolean</zorba:output>
61 </zorba:signature>
62 </zorba:function>
63
64 </zorba:iterator>
65
66<!--
67/*******************************************************************************
68********************************************************************************/
69-->
70 <zorba:iterator name="IsFollowingPositionIterator">
71
72 <zorba:description author="Federico Cavalieri"></zorba:description>
73
74 <zorba:function>
75 <zorba:signature localname="following-of" prefix="fn-zorba-pos">
76 <zorba:param>xs:anyURI</zorba:param>
77 <zorba:param>xs:anyURI</zorba:param>
78 <zorba:output>xs:boolean</zorba:output>
79 </zorba:signature>
80 </zorba:function>
81
82 </zorba:iterator>
83
84
85 <!--
86/*******************************************************************************
87********************************************************************************/
88-->
89 <zorba:iterator name="IsInSubtreeOfPositionIterator">
90
91 <zorba:description author="Federico Cavalieri"></zorba:description>
92
93 <zorba:function>
94 <zorba:signature localname="in-subtree-of" prefix="fn-zorba-pos">
95 <zorba:param>xs:anyURI</zorba:param>
96 <zorba:param>xs:anyURI</zorba:param>
97 <zorba:output>xs:boolean</zorba:output>
98 </zorba:signature>
99 </zorba:function>
100
101 </zorba:iterator>
102
103
104 <!--
105/*******************************************************************************
106********************************************************************************/
107-->
108 <zorba:iterator name="IsDescendantPositionIterator">
109
110 <zorba:description author="Federico Cavalieri"></zorba:description>
111
112 <zorba:function>
113 <zorba:signature localname="descendant-of" prefix="fn-zorba-pos">
114 <zorba:param>xs:anyURI</zorba:param>
115 <zorba:param>xs:anyURI</zorba:param>
116 <zorba:output>xs:boolean</zorba:output>
117 </zorba:signature>
118 </zorba:function>
119
120 </zorba:iterator>
121
122 <!--
123/*******************************************************************************
124********************************************************************************/
125-->
126 <zorba:iterator name="IsPrecedingSiblingPositionIterator">
127
128 <zorba:description author="Federico Cavalieri"></zorba:description>
129
130 <zorba:function>
131 <zorba:signature localname="preceding-sibling-of" prefix="fn-zorba-pos">
132 <zorba:param>xs:anyURI</zorba:param>
133 <zorba:param>xs:anyURI</zorba:param>
134 <zorba:output>xs:boolean</zorba:output>
135 </zorba:signature>
136 </zorba:function>
137
138 </zorba:iterator>
139
140 <!--
141/*******************************************************************************
142********************************************************************************/
143-->
144 <zorba:iterator name="IsPrecedingPositionIterator">
145
146 <zorba:description author="Federico Cavalieri"></zorba:description>
147
148 <zorba:function>
149 <zorba:signature localname="preceding-of" prefix="fn-zorba-pos">
150 <zorba:param>xs:anyURI</zorba:param>
151 <zorba:param>xs:anyURI</zorba:param>
152 <zorba:output>xs:boolean</zorba:output>
153 </zorba:signature>
154 </zorba:function>
155
156 </zorba:iterator>
157
158 <!--
159/*******************************************************************************
160********************************************************************************/
161-->
162 <zorba:iterator name="IsChildPositionIterator">
163
164 <zorba:description author="Federico Cavalieri"></zorba:description>
165
166 <zorba:function>
167 <zorba:signature localname="child-of" prefix="fn-zorba-pos">
168 <zorba:param>xs:anyURI</zorba:param>
169 <zorba:param>xs:anyURI</zorba:param>
170 <zorba:output>xs:boolean</zorba:output>
171 </zorba:signature>
172 </zorba:function>
173
174 </zorba:iterator>
175
176 <!--
177/*******************************************************************************
178********************************************************************************/
179-->
180 <zorba:iterator name="IsAttributeOfPositionIterator">
181
182 <zorba:description author="Federico Cavalieri"></zorba:description>
183
184 <zorba:function>
185 <zorba:signature localname="attribute-of" prefix="fn-zorba-pos">
186 <zorba:param>xs:anyURI</zorba:param>
187 <zorba:param>xs:anyURI</zorba:param>
188 <zorba:output>xs:boolean</zorba:output>
189 </zorba:signature>
190 </zorba:function>
191
192 </zorba:iterator>
193
194
195 <!--
196/*******************************************************************************
197********************************************************************************/
198-->
199 <zorba:iterator name="IsParentPositionIterator">
200
201 <zorba:description author="Federico Cavalieri"></zorba:description>
202
203 <zorba:function>
204 <zorba:signature localname="parent-of" prefix="fn-zorba-pos">
205 <zorba:param>xs:anyURI</zorba:param>
206 <zorba:param>xs:anyURI</zorba:param>
207 <zorba:output>xs:boolean</zorba:output>
208 </zorba:signature>
209 </zorba:function>
210
211 </zorba:iterator>
212
213 <!--
214/*******************************************************************************
215********************************************************************************/
216-->
217 <zorba:iterator name="IsPrecedingInDocumentOrderPositionIterator">
218
219 <zorba:description author="Federico Cavalieri"></zorba:description>
220
221 <zorba:function>
222 <zorba:signature localname="preceding-in-document-order-of" prefix="fn-zorba-pos">
223 <zorba:param>xs:anyURI</zorba:param>
224 <zorba:param>xs:anyURI</zorba:param>
225 <zorba:output>xs:boolean</zorba:output>
226 </zorba:signature>
227 </zorba:function>
228
229 </zorba:iterator>
230
231 <!--
232/*******************************************************************************
233********************************************************************************/
234-->
235 <zorba:iterator name="IsFollowingInDocumentOrderPositionIterator">
236
237 <zorba:description author="Federico Cavalieri"></zorba:description>
238
239 <zorba:function>
240 <zorba:signature localname="following-in-document-order-of" prefix="fn-zorba-pos">
241 <zorba:param>xs:anyURI</zorba:param>
242 <zorba:param>xs:anyURI</zorba:param>
243 <zorba:output>xs:boolean</zorba:output>
244 </zorba:signature>
245 </zorba:function>
246
247 </zorba:iterator>
248
249 <!--
250/*******************************************************************************
251********************************************************************************/
252-->
253 <zorba:iterator name="LevelPositionIterator">
254
255 <zorba:description author="Federico Cavalieri"></zorba:description>
256
257 <zorba:function>
258 <zorba:signature localname="level" prefix="fn-zorba-pos">
259 <zorba:param>xs:anyURI</zorba:param>
260 <zorba:output>xs:integer</zorba:output>
261 </zorba:signature>
262 </zorba:function>
263
264 </zorba:iterator>
265
266 <!--
267/*******************************************************************************
268********************************************************************************/
269-->
270 <zorba:iterator name="IsAttributePositionIterator">
271
272 <zorba:description author="Federico Cavalieri"></zorba:description>
273
274 <zorba:function>
275 <zorba:signature localname="is-attribute" prefix="fn-zorba-pos">
276 <zorba:param>xs:anyURI</zorba:param>
277 <zorba:output>xs:boolean</zorba:output>
278 </zorba:signature>
279 </zorba:function>
280
281 </zorba:iterator>
282
283 <!--
284/*******************************************************************************
285********************************************************************************/
286-->
287 <zorba:iterator name="IsCommentPositionIterator">
288
289 <zorba:description author="Federico Cavalieri"></zorba:description>
290
291 <zorba:function>
292 <zorba:signature localname="is-comment" prefix="fn-zorba-pos">
293 <zorba:param>xs:anyURI</zorba:param>
294 <zorba:output>xs:boolean</zorba:output>
295 </zorba:signature>
296 </zorba:function>
297
298 </zorba:iterator>
299
300 <!--
301/*******************************************************************************
302********************************************************************************/
303-->
304 <zorba:iterator name="IsDocumentPositionIterator">
305
306 <zorba:description author="Federico Cavalieri"></zorba:description>
307
308 <zorba:function>
309 <zorba:signature localname="is-document" prefix="fn-zorba-pos">
310 <zorba:param>xs:anyURI</zorba:param>
311 <zorba:output>xs:boolean</zorba:output>
312 </zorba:signature>
313 </zorba:function>
314
315 </zorba:iterator>
316
317 <!--
318/*******************************************************************************
319********************************************************************************/
320-->
321 <zorba:iterator name="IsElementPositionIterator">
322
323 <zorba:description author="Federico Cavalieri"></zorba:description>
324
325 <zorba:function>
326 <zorba:signature localname="is-element" prefix="fn-zorba-pos">
327 <zorba:param>xs:anyURI</zorba:param>
328 <zorba:output>xs:boolean</zorba:output>
329 </zorba:signature>
330 </zorba:function>
331
332 </zorba:iterator>
333
334 <!--
335/*******************************************************************************
336********************************************************************************/
337-->
338 <zorba:iterator name="IsProcessingInstructionPositionIterator">
339
340 <zorba:description author="Federico Cavalieri"></zorba:description>
341
342 <zorba:function>
343 <zorba:signature localname="is-processing-instruction" prefix="fn-zorba-pos">
344 <zorba:param>xs:anyURI</zorba:param>
345 <zorba:output>xs:boolean</zorba:output>
346 </zorba:signature>
347 </zorba:function>
348
349 </zorba:iterator>
350
351 <!--
352/*******************************************************************************
353********************************************************************************/
354-->
355 <zorba:iterator name="IsTextPositionIterator">
356
357 <zorba:description author="Federico Cavalieri"></zorba:description>
358
359 <zorba:function>
360 <zorba:signature localname="is-text" prefix="fn-zorba-pos">
361 <zorba:param>xs:anyURI</zorba:param>
362 <zorba:output>xs:boolean</zorba:output>
363 </zorba:signature>
364 </zorba:function>
365
366 </zorba:iterator>
367
368 <!--
369/*******************************************************************************
370********************************************************************************/
371-->
372 <zorba:iterator name="IsSiblingPositionIterator">
373
374 <zorba:description author="Federico Cavalieri"></zorba:description>
375
376 <zorba:function>
377 <zorba:signature localname="sibling-of" prefix="fn-zorba-pos">
378 <zorba:param>xs:anyURI</zorba:param>
379 <zorba:param>xs:anyURI</zorba:param>
380 <zorba:output>xs:boolean</zorba:output>
381 </zorba:signature>
382 </zorba:function>
383
384 </zorba:iterator>
385
386 <!--
387/*******************************************************************************
388********************************************************************************/
389-->
390 <zorba:iterator name="InSameTreePositionIterator">
391
392 <zorba:description author="Federico Cavalieri"></zorba:description>
393
394 <zorba:function>
395 <zorba:signature localname="in-same-tree-of" prefix="fn-zorba-pos">
396 <zorba:param>xs:anyURI</zorba:param>
397 <zorba:param>xs:anyURI</zorba:param>
398 <zorba:output>xs:boolean</zorba:output>
399 </zorba:signature>
400 </zorba:function>
401
402 </zorba:iterator>
403
404 <!--
405/*******************************************************************************
406********************************************************************************/
407-->
408 <zorba:iterator name="InCollectionPositionIterator">
409
410 <zorba:description author="Federico Cavalieri"></zorba:description>
411
412 <zorba:function>
413 <zorba:signature localname="in-collection" prefix="fn-zorba-pos">
414 <zorba:param>xs:anyURI</zorba:param>
415 <zorba:output>xs:boolean</zorba:output>
416 </zorba:signature>
417 </zorba:function>
418
419 </zorba:iterator>
420
421 <!--
422/*******************************************************************************
423********************************************************************************/
424-->
425 <zorba:iterator name="InSameCollectionPositionIterator">
426
427 <zorba:description author="Federico Cavalieri"></zorba:description>
428
429 <zorba:function>
430 <zorba:signature localname="in-same-collection-of" prefix="fn-zorba-pos">
431 <zorba:param>xs:anyURI</zorba:param>
432 <zorba:param>xs:anyURI</zorba:param>
433 <zorba:output>xs:boolean</zorba:output>
434 </zorba:signature>
435 </zorba:function>
436
437 </zorba:iterator>
438
439</zorba:iterators>
0440
=== modified file 'src/runtime/visitors/pregenerated/planiter_visitor.h'
--- src/runtime/visitors/pregenerated/planiter_visitor.h 2011-10-19 15:28:51 +0000
+++ src/runtime/visitors/pregenerated/planiter_visitor.h 2011-11-02 17:26:24 +0000
@@ -303,6 +303,54 @@
303303
304 class FrexpIterator;304 class FrexpIterator;
305305
306 class NodePositionIterator;
307
308 class IsAncestorPositionIterator;
309
310 class IsFollowingSiblingPositionIterator;
311
312 class IsFollowingPositionIterator;
313
314 class IsInSubtreeOfPositionIterator;
315
316 class IsDescendantPositionIterator;
317
318 class IsPrecedingSiblingPositionIterator;
319
320 class IsPrecedingPositionIterator;
321
322 class IsChildPositionIterator;
323
324 class IsAttributeOfPositionIterator;
325
326 class IsParentPositionIterator;
327
328 class IsPrecedingInDocumentOrderPositionIterator;
329
330 class IsFollowingInDocumentOrderPositionIterator;
331
332 class LevelPositionIterator;
333
334 class IsAttributePositionIterator;
335
336 class IsCommentPositionIterator;
337
338 class IsDocumentPositionIterator;
339
340 class IsElementPositionIterator;
341
342 class IsProcessingInstructionPositionIterator;
343
344 class IsTextPositionIterator;
345
346 class IsSiblingPositionIterator;
347
348 class InSameTreePositionIterator;
349
350 class InCollectionPositionIterator;
351
352 class InSameCollectionPositionIterator;
353
306 class NodeReferenceIterator;354 class NodeReferenceIterator;
307355
308 class NodeByReferenceIterator;356 class NodeByReferenceIterator;
@@ -955,6 +1003,78 @@
955 virtual void beginVisit ( const FrexpIterator& ) = 0;1003 virtual void beginVisit ( const FrexpIterator& ) = 0;
956 virtual void endVisit ( const FrexpIterator& ) = 0;1004 virtual void endVisit ( const FrexpIterator& ) = 0;
9571005
1006 virtual void beginVisit ( const NodePositionIterator& ) = 0;
1007 virtual void endVisit ( const NodePositionIterator& ) = 0;
1008
1009 virtual void beginVisit ( const IsAncestorPositionIterator& ) = 0;
1010 virtual void endVisit ( const IsAncestorPositionIterator& ) = 0;
1011
1012 virtual void beginVisit ( const IsFollowingSiblingPositionIterator& ) = 0;
1013 virtual void endVisit ( const IsFollowingSiblingPositionIterator& ) = 0;
1014
1015 virtual void beginVisit ( const IsFollowingPositionIterator& ) = 0;
1016 virtual void endVisit ( const IsFollowingPositionIterator& ) = 0;
1017
1018 virtual void beginVisit ( const IsInSubtreeOfPositionIterator& ) = 0;
1019 virtual void endVisit ( const IsInSubtreeOfPositionIterator& ) = 0;
1020
1021 virtual void beginVisit ( const IsDescendantPositionIterator& ) = 0;
1022 virtual void endVisit ( const IsDescendantPositionIterator& ) = 0;
1023
1024 virtual void beginVisit ( const IsPrecedingSiblingPositionIterator& ) = 0;
1025 virtual void endVisit ( const IsPrecedingSiblingPositionIterator& ) = 0;
1026
1027 virtual void beginVisit ( const IsPrecedingPositionIterator& ) = 0;
1028 virtual void endVisit ( const IsPrecedingPositionIterator& ) = 0;
1029
1030 virtual void beginVisit ( const IsChildPositionIterator& ) = 0;
1031 virtual void endVisit ( const IsChildPositionIterator& ) = 0;
1032
1033 virtual void beginVisit ( const IsAttributeOfPositionIterator& ) = 0;
1034 virtual void endVisit ( const IsAttributeOfPositionIterator& ) = 0;
1035
1036 virtual void beginVisit ( const IsParentPositionIterator& ) = 0;
1037 virtual void endVisit ( const IsParentPositionIterator& ) = 0;
1038
1039 virtual void beginVisit ( const IsPrecedingInDocumentOrderPositionIterator& ) = 0;
1040 virtual void endVisit ( const IsPrecedingInDocumentOrderPositionIterator& ) = 0;
1041
1042 virtual void beginVisit ( const IsFollowingInDocumentOrderPositionIterator& ) = 0;
1043 virtual void endVisit ( const IsFollowingInDocumentOrderPositionIterator& ) = 0;
1044
1045 virtual void beginVisit ( const LevelPositionIterator& ) = 0;
1046 virtual void endVisit ( const LevelPositionIterator& ) = 0;
1047
1048 virtual void beginVisit ( const IsAttributePositionIterator& ) = 0;
1049 virtual void endVisit ( const IsAttributePositionIterator& ) = 0;
1050
1051 virtual void beginVisit ( const IsCommentPositionIterator& ) = 0;
1052 virtual void endVisit ( const IsCommentPositionIterator& ) = 0;
1053
1054 virtual void beginVisit ( const IsDocumentPositionIterator& ) = 0;
1055 virtual void endVisit ( const IsDocumentPositionIterator& ) = 0;
1056
1057 virtual void beginVisit ( const IsElementPositionIterator& ) = 0;
1058 virtual void endVisit ( const IsElementPositionIterator& ) = 0;
1059
1060 virtual void beginVisit ( const IsProcessingInstructionPositionIterator& ) = 0;
1061 virtual void endVisit ( const IsProcessingInstructionPositionIterator& ) = 0;
1062
1063 virtual void beginVisit ( const IsTextPositionIterator& ) = 0;
1064 virtual void endVisit ( const IsTextPositionIterator& ) = 0;
1065
1066 virtual void beginVisit ( const IsSiblingPositionIterator& ) = 0;
1067 virtual void endVisit ( const IsSiblingPositionIterator& ) = 0;
1068
1069 virtual void beginVisit ( const InSameTreePositionIterator& ) = 0;
1070 virtual void endVisit ( const InSameTreePositionIterator& ) = 0;
1071
1072 virtual void beginVisit ( const InCollectionPositionIterator& ) = 0;
1073 virtual void endVisit ( const InCollectionPositionIterator& ) = 0;
1074
1075 virtual void beginVisit ( const InSameCollectionPositionIterator& ) = 0;
1076 virtual void endVisit ( const InSameCollectionPositionIterator& ) = 0;
1077
958 virtual void beginVisit ( const NodeReferenceIterator& ) = 0;1078 virtual void beginVisit ( const NodeReferenceIterator& ) = 0;
959 virtual void endVisit ( const NodeReferenceIterator& ) = 0;1079 virtual void endVisit ( const NodeReferenceIterator& ) = 0;
9601080
9611081
=== modified file 'src/runtime/visitors/pregenerated/printer_visitor.cpp'
--- src/runtime/visitors/pregenerated/printer_visitor.cpp 2011-10-19 15:28:51 +0000
+++ src/runtime/visitors/pregenerated/printer_visitor.cpp 2011-11-02 17:26:24 +0000
@@ -51,6 +51,7 @@
51#include "runtime/indexing/ic_ddl.h"51#include "runtime/indexing/ic_ddl.h"
52#include "runtime/introspection/sctx.h"52#include "runtime/introspection/sctx.h"
53#include "runtime/maths/maths.h"53#include "runtime/maths/maths.h"
54#include "runtime/nodes/node_position.h"
54#include "runtime/nodes/nodes.h"55#include "runtime/nodes/nodes.h"
55#include "runtime/numerics/numerics.h"56#include "runtime/numerics/numerics.h"
56#include "runtime/parsing_and_serializing/parse_fragment.h"57#include "runtime/parsing_and_serializing/parse_fragment.h"
@@ -2013,6 +2014,342 @@
2013// </FrexpIterator>2014// </FrexpIterator>
20142015
20152016
2017// <NodePositionIterator>
2018void PrinterVisitor::beginVisit ( const NodePositionIterator& a) {
2019 thePrinter.startBeginVisit("NodePositionIterator", ++theId);
2020 printCommons( &a, theId );
2021 thePrinter.endBeginVisit( theId );
2022}
2023
2024void PrinterVisitor::endVisit ( const NodePositionIterator& ) {
2025 thePrinter.startEndVisit();
2026 thePrinter.endEndVisit();
2027}
2028// </NodePositionIterator>
2029
2030
2031// <IsAncestorPositionIterator>
2032void PrinterVisitor::beginVisit ( const IsAncestorPositionIterator& a) {
2033 thePrinter.startBeginVisit("IsAncestorPositionIterator", ++theId);
2034 printCommons( &a, theId );
2035 thePrinter.endBeginVisit( theId );
2036}
2037
2038void PrinterVisitor::endVisit ( const IsAncestorPositionIterator& ) {
2039 thePrinter.startEndVisit();
2040 thePrinter.endEndVisit();
2041}
2042// </IsAncestorPositionIterator>
2043
2044
2045// <IsFollowingSiblingPositionIterator>
2046void PrinterVisitor::beginVisit ( const IsFollowingSiblingPositionIterator& a) {
2047 thePrinter.startBeginVisit("IsFollowingSiblingPositionIterator", ++theId);
2048 printCommons( &a, theId );
2049 thePrinter.endBeginVisit( theId );
2050}
2051
2052void PrinterVisitor::endVisit ( const IsFollowingSiblingPositionIterator& ) {
2053 thePrinter.startEndVisit();
2054 thePrinter.endEndVisit();
2055}
2056// </IsFollowingSiblingPositionIterator>
2057
2058
2059// <IsFollowingPositionIterator>
2060void PrinterVisitor::beginVisit ( const IsFollowingPositionIterator& a) {
2061 thePrinter.startBeginVisit("IsFollowingPositionIterator", ++theId);
2062 printCommons( &a, theId );
2063 thePrinter.endBeginVisit( theId );
2064}
2065
2066void PrinterVisitor::endVisit ( const IsFollowingPositionIterator& ) {
2067 thePrinter.startEndVisit();
2068 thePrinter.endEndVisit();
2069}
2070// </IsFollowingPositionIterator>
2071
2072
2073// <IsInSubtreeOfPositionIterator>
2074void PrinterVisitor::beginVisit ( const IsInSubtreeOfPositionIterator& a) {
2075 thePrinter.startBeginVisit("IsInSubtreeOfPositionIterator", ++theId);
2076 printCommons( &a, theId );
2077 thePrinter.endBeginVisit( theId );
2078}
2079
2080void PrinterVisitor::endVisit ( const IsInSubtreeOfPositionIterator& ) {
2081 thePrinter.startEndVisit();
2082 thePrinter.endEndVisit();
2083}
2084// </IsInSubtreeOfPositionIterator>
2085
2086
2087// <IsDescendantPositionIterator>
2088void PrinterVisitor::beginVisit ( const IsDescendantPositionIterator& a) {
2089 thePrinter.startBeginVisit("IsDescendantPositionIterator", ++theId);
2090 printCommons( &a, theId );
2091 thePrinter.endBeginVisit( theId );
2092}
2093
2094void PrinterVisitor::endVisit ( const IsDescendantPositionIterator& ) {
2095 thePrinter.startEndVisit();
2096 thePrinter.endEndVisit();
2097}
2098// </IsDescendantPositionIterator>
2099
2100
2101// <IsPrecedingSiblingPositionIterator>
2102void PrinterVisitor::beginVisit ( const IsPrecedingSiblingPositionIterator& a) {
2103 thePrinter.startBeginVisit("IsPrecedingSiblingPositionIterator", ++theId);
2104 printCommons( &a, theId );
2105 thePrinter.endBeginVisit( theId );
2106}
2107
2108void PrinterVisitor::endVisit ( const IsPrecedingSiblingPositionIterator& ) {
2109 thePrinter.startEndVisit();
2110 thePrinter.endEndVisit();
2111}
2112// </IsPrecedingSiblingPositionIterator>
2113
2114
2115// <IsPrecedingPositionIterator>
2116void PrinterVisitor::beginVisit ( const IsPrecedingPositionIterator& a) {
2117 thePrinter.startBeginVisit("IsPrecedingPositionIterator", ++theId);
2118 printCommons( &a, theId );
2119 thePrinter.endBeginVisit( theId );
2120}
2121
2122void PrinterVisitor::endVisit ( const IsPrecedingPositionIterator& ) {
2123 thePrinter.startEndVisit();
2124 thePrinter.endEndVisit();
2125}
2126// </IsPrecedingPositionIterator>
2127
2128
2129// <IsChildPositionIterator>
2130void PrinterVisitor::beginVisit ( const IsChildPositionIterator& a) {
2131 thePrinter.startBeginVisit("IsChildPositionIterator", ++theId);
2132 printCommons( &a, theId );
2133 thePrinter.endBeginVisit( theId );
2134}
2135
2136void PrinterVisitor::endVisit ( const IsChildPositionIterator& ) {
2137 thePrinter.startEndVisit();
2138 thePrinter.endEndVisit();
2139}
2140// </IsChildPositionIterator>
2141
2142
2143// <IsAttributeOfPositionIterator>
2144void PrinterVisitor::beginVisit ( const IsAttributeOfPositionIterator& a) {
2145 thePrinter.startBeginVisit("IsAttributeOfPositionIterator", ++theId);
2146 printCommons( &a, theId );
2147 thePrinter.endBeginVisit( theId );
2148}
2149
2150void PrinterVisitor::endVisit ( const IsAttributeOfPositionIterator& ) {
2151 thePrinter.startEndVisit();
2152 thePrinter.endEndVisit();
2153}
2154// </IsAttributeOfPositionIterator>
2155
2156
2157// <IsParentPositionIterator>
2158void PrinterVisitor::beginVisit ( const IsParentPositionIterator& a) {
2159 thePrinter.startBeginVisit("IsParentPositionIterator", ++theId);
2160 printCommons( &a, theId );
2161 thePrinter.endBeginVisit( theId );
2162}
2163
2164void PrinterVisitor::endVisit ( const IsParentPositionIterator& ) {
2165 thePrinter.startEndVisit();
2166 thePrinter.endEndVisit();
2167}
2168// </IsParentPositionIterator>
2169
2170
2171// <IsPrecedingInDocumentOrderPositionIterator>
2172void PrinterVisitor::beginVisit ( const IsPrecedingInDocumentOrderPositionIterator& a) {
2173 thePrinter.startBeginVisit("IsPrecedingInDocumentOrderPositionIterator", ++theId);
2174 printCommons( &a, theId );
2175 thePrinter.endBeginVisit( theId );
2176}
2177
2178void PrinterVisitor::endVisit ( const IsPrecedingInDocumentOrderPositionIterator& ) {
2179 thePrinter.startEndVisit();
2180 thePrinter.endEndVisit();
2181}
2182// </IsPrecedingInDocumentOrderPositionIterator>
2183
2184
2185// <IsFollowingInDocumentOrderPositionIterator>
2186void PrinterVisitor::beginVisit ( const IsFollowingInDocumentOrderPositionIterator& a) {
2187 thePrinter.startBeginVisit("IsFollowingInDocumentOrderPositionIterator", ++theId);
2188 printCommons( &a, theId );
2189 thePrinter.endBeginVisit( theId );
2190}
2191
2192void PrinterVisitor::endVisit ( const IsFollowingInDocumentOrderPositionIterator& ) {
2193 thePrinter.startEndVisit();
2194 thePrinter.endEndVisit();
2195}
2196// </IsFollowingInDocumentOrderPositionIterator>
2197
2198
2199// <LevelPositionIterator>
2200void PrinterVisitor::beginVisit ( const LevelPositionIterator& a) {
2201 thePrinter.startBeginVisit("LevelPositionIterator", ++theId);
2202 printCommons( &a, theId );
2203 thePrinter.endBeginVisit( theId );
2204}
2205
2206void PrinterVisitor::endVisit ( const LevelPositionIterator& ) {
2207 thePrinter.startEndVisit();
2208 thePrinter.endEndVisit();
2209}
2210// </LevelPositionIterator>
2211
2212
2213// <IsAttributePositionIterator>
2214void PrinterVisitor::beginVisit ( const IsAttributePositionIterator& a) {
2215 thePrinter.startBeginVisit("IsAttributePositionIterator", ++theId);
2216 printCommons( &a, theId );
2217 thePrinter.endBeginVisit( theId );
2218}
2219
2220void PrinterVisitor::endVisit ( const IsAttributePositionIterator& ) {
2221 thePrinter.startEndVisit();
2222 thePrinter.endEndVisit();
2223}
2224// </IsAttributePositionIterator>
2225
2226
2227// <IsCommentPositionIterator>
2228void PrinterVisitor::beginVisit ( const IsCommentPositionIterator& a) {
2229 thePrinter.startBeginVisit("IsCommentPositionIterator", ++theId);
2230 printCommons( &a, theId );
2231 thePrinter.endBeginVisit( theId );
2232}
2233
2234void PrinterVisitor::endVisit ( const IsCommentPositionIterator& ) {
2235 thePrinter.startEndVisit();
2236 thePrinter.endEndVisit();
2237}
2238// </IsCommentPositionIterator>
2239
2240
2241// <IsDocumentPositionIterator>
2242void PrinterVisitor::beginVisit ( const IsDocumentPositionIterator& a) {
2243 thePrinter.startBeginVisit("IsDocumentPositionIterator", ++theId);
2244 printCommons( &a, theId );
2245 thePrinter.endBeginVisit( theId );
2246}
2247
2248void PrinterVisitor::endVisit ( const IsDocumentPositionIterator& ) {
2249 thePrinter.startEndVisit();
2250 thePrinter.endEndVisit();
2251}
2252// </IsDocumentPositionIterator>
2253
2254
2255// <IsElementPositionIterator>
2256void PrinterVisitor::beginVisit ( const IsElementPositionIterator& a) {
2257 thePrinter.startBeginVisit("IsElementPositionIterator", ++theId);
2258 printCommons( &a, theId );
2259 thePrinter.endBeginVisit( theId );
2260}
2261
2262void PrinterVisitor::endVisit ( const IsElementPositionIterator& ) {
2263 thePrinter.startEndVisit();
2264 thePrinter.endEndVisit();
2265}
2266// </IsElementPositionIterator>
2267
2268
2269// <IsProcessingInstructionPositionIterator>
2270void PrinterVisitor::beginVisit ( const IsProcessingInstructionPositionIterator& a) {
2271 thePrinter.startBeginVisit("IsProcessingInstructionPositionIterator", ++theId);
2272 printCommons( &a, theId );
2273 thePrinter.endBeginVisit( theId );
2274}
2275
2276void PrinterVisitor::endVisit ( const IsProcessingInstructionPositionIterator& ) {
2277 thePrinter.startEndVisit();
2278 thePrinter.endEndVisit();
2279}
2280// </IsProcessingInstructionPositionIterator>
2281
2282
2283// <IsTextPositionIterator>
2284void PrinterVisitor::beginVisit ( const IsTextPositionIterator& a) {
2285 thePrinter.startBeginVisit("IsTextPositionIterator", ++theId);
2286 printCommons( &a, theId );
2287 thePrinter.endBeginVisit( theId );
2288}
2289
2290void PrinterVisitor::endVisit ( const IsTextPositionIterator& ) {
2291 thePrinter.startEndVisit();
2292 thePrinter.endEndVisit();
2293}
2294// </IsTextPositionIterator>
2295
2296
2297// <IsSiblingPositionIterator>
2298void PrinterVisitor::beginVisit ( const IsSiblingPositionIterator& a) {
2299 thePrinter.startBeginVisit("IsSiblingPositionIterator", ++theId);
2300 printCommons( &a, theId );
2301 thePrinter.endBeginVisit( theId );
2302}
2303
2304void PrinterVisitor::endVisit ( const IsSiblingPositionIterator& ) {
2305 thePrinter.startEndVisit();
2306 thePrinter.endEndVisit();
2307}
2308// </IsSiblingPositionIterator>
2309
2310
2311// <InSameTreePositionIterator>
2312void PrinterVisitor::beginVisit ( const InSameTreePositionIterator& a) {
2313 thePrinter.startBeginVisit("InSameTreePositionIterator", ++theId);
2314 printCommons( &a, theId );
2315 thePrinter.endBeginVisit( theId );
2316}
2317
2318void PrinterVisitor::endVisit ( const InSameTreePositionIterator& ) {
2319 thePrinter.startEndVisit();
2320 thePrinter.endEndVisit();
2321}
2322// </InSameTreePositionIterator>
2323
2324
2325// <InCollectionPositionIterator>
2326void PrinterVisitor::beginVisit ( const InCollectionPositionIterator& a) {
2327 thePrinter.startBeginVisit("InCollectionPositionIterator", ++theId);
2328 printCommons( &a, theId );
2329 thePrinter.endBeginVisit( theId );
2330}
2331
2332void PrinterVisitor::endVisit ( const InCollectionPositionIterator& ) {
2333 thePrinter.startEndVisit();
2334 thePrinter.endEndVisit();
2335}
2336// </InCollectionPositionIterator>
2337
2338
2339// <InSameCollectionPositionIterator>
2340void PrinterVisitor::beginVisit ( const InSameCollectionPositionIterator& a) {
2341 thePrinter.startBeginVisit("InSameCollectionPositionIterator", ++theId);
2342 printCommons( &a, theId );
2343 thePrinter.endBeginVisit( theId );
2344}
2345
2346void PrinterVisitor::endVisit ( const InSameCollectionPositionIterator& ) {
2347 thePrinter.startEndVisit();
2348 thePrinter.endEndVisit();
2349}
2350// </InSameCollectionPositionIterator>
2351
2352
2016// <NodeReferenceIterator>2353// <NodeReferenceIterator>
2017void PrinterVisitor::beginVisit ( const NodeReferenceIterator& a) {2354void PrinterVisitor::beginVisit ( const NodeReferenceIterator& a) {
2018 thePrinter.startBeginVisit("NodeReferenceIterator", ++theId);2355 thePrinter.startBeginVisit("NodeReferenceIterator", ++theId);
20192356
=== modified file 'src/runtime/visitors/pregenerated/printer_visitor.h'
--- src/runtime/visitors/pregenerated/printer_visitor.h 2011-10-19 15:28:51 +0000
+++ src/runtime/visitors/pregenerated/printer_visitor.h 2011-11-02 17:26:24 +0000
@@ -457,6 +457,78 @@
457 void beginVisit( const FrexpIterator& );457 void beginVisit( const FrexpIterator& );
458 void endVisit ( const FrexpIterator& );458 void endVisit ( const FrexpIterator& );
459459
460 void beginVisit( const NodePositionIterator& );
461 void endVisit ( const NodePositionIterator& );
462
463 void beginVisit( const IsAncestorPositionIterator& );
464 void endVisit ( const IsAncestorPositionIterator& );
465
466 void beginVisit( const IsFollowingSiblingPositionIterator& );
467 void endVisit ( const IsFollowingSiblingPositionIterator& );
468
469 void beginVisit( const IsFollowingPositionIterator& );
470 void endVisit ( const IsFollowingPositionIterator& );
471
472 void beginVisit( const IsInSubtreeOfPositionIterator& );
473 void endVisit ( const IsInSubtreeOfPositionIterator& );
474
475 void beginVisit( const IsDescendantPositionIterator& );
476 void endVisit ( const IsDescendantPositionIterator& );
477
478 void beginVisit( const IsPrecedingSiblingPositionIterator& );
479 void endVisit ( const IsPrecedingSiblingPositionIterator& );
480
481 void beginVisit( const IsPrecedingPositionIterator& );
482 void endVisit ( const IsPrecedingPositionIterator& );
483
484 void beginVisit( const IsChildPositionIterator& );
485 void endVisit ( const IsChildPositionIterator& );
486
487 void beginVisit( const IsAttributeOfPositionIterator& );
488 void endVisit ( const IsAttributeOfPositionIterator& );
489
490 void beginVisit( const IsParentPositionIterator& );
491 void endVisit ( const IsParentPositionIterator& );
492
493 void beginVisit( const IsPrecedingInDocumentOrderPositionIterator& );
494 void endVisit ( const IsPrecedingInDocumentOrderPositionIterator& );
495
496 void beginVisit( const IsFollowingInDocumentOrderPositionIterator& );
497 void endVisit ( const IsFollowingInDocumentOrderPositionIterator& );
498
499 void beginVisit( const LevelPositionIterator& );
500 void endVisit ( const LevelPositionIterator& );
501
502 void beginVisit( const IsAttributePositionIterator& );
503 void endVisit ( const IsAttributePositionIterator& );
504
505 void beginVisit( const IsCommentPositionIterator& );
506 void endVisit ( const IsCommentPositionIterator& );
507
508 void beginVisit( const IsDocumentPositionIterator& );
509 void endVisit ( const IsDocumentPositionIterator& );
510
511 void beginVisit( const IsElementPositionIterator& );
512 void endVisit ( const IsElementPositionIterator& );
513
514 void beginVisit( const IsProcessingInstructionPositionIterator& );
515 void endVisit ( const IsProcessingInstructionPositionIterator& );
516
517 void beginVisit( const IsTextPositionIterator& );
518 void endVisit ( const IsTextPositionIterator& );
519
520 void beginVisit( const IsSiblingPositionIterator& );
521 void endVisit ( const IsSiblingPositionIterator& );
522
523 void beginVisit( const InSameTreePositionIterator& );
524 void endVisit ( const InSameTreePositionIterator& );
525
526 void beginVisit( const InCollectionPositionIterator& );
527 void endVisit ( const InCollectionPositionIterator& );
528
529 void beginVisit( const InSameCollectionPositionIterator& );
530 void endVisit ( const InSameCollectionPositionIterator& );
531
460 void beginVisit( const NodeReferenceIterator& );532 void beginVisit( const NodeReferenceIterator& );
461 void endVisit ( const NodeReferenceIterator& );533 void endVisit ( const NodeReferenceIterator& );
462534
463535
=== modified file 'src/store/api/item.h'
--- src/store/api/item.h 2011-10-05 17:49:48 +0000
+++ src/store/api/item.h 2011-11-02 17:26:24 +0000
@@ -662,6 +662,12 @@
662 *662 *
663 */663 */
664 virtual bool664 virtual bool
665 isInSubtreeOf(const store::Item_t&) const;
666
667 /**
668 *
669 */
670 virtual bool
665 isDescendant(const store::Item_t&) const;671 isDescendant(const store::Item_t&) const;
666672
667 /**673 /**
@@ -686,17 +692,95 @@
686 *692 *
687 */693 */
688 virtual bool694 virtual bool
695 isAttribute(const store::Item_t&) const;
696
697 /**
698 *
699 */
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches