author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 02 Jul 2018 08:46:01 +0200 | |
changeset 305 | bad21c4f64bf |
parent 296 | ea3dbc023c80 |
permissions | -rw-r--r-- |
0 | 1 |
"{ Package: 'stx:goodies/xmlsuite/xquery' }" |
2 |
||
3 |
"{ NameSpace: XQuery }" |
|
4 |
||
5 |
UpdateCommand subclass:#RenameCommand |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'XQuery-Update Facility' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!RenameCommand class methodsFor:'priorities'! |
|
14 |
||
15 |
priority |
|
16 |
"Superclass says that I am responsible to implement this method" |
|
17 |
||
18 |
^10 |
|
19 |
! ! |
|
20 |
||
21 |
!RenameCommand methodsFor:'checks'! |
|
22 |
||
23 |
checkSourceSequence: anXQuerySequence |
|
24 |
||
25 |
self |
|
26 |
assert: anXQuerySequence containsSingleString |
|
27 |
description:'Sequence must contain excatly one item with type QNAME (see section 2.3.4)' |
|
28 |
! |
|
29 |
||
30 |
checkTargetSequence: anXQuerySequence |
|
31 |
||
32 |
self |
|
33 |
assert: (anXQuerySequence containsSingleElement or:[anXQuerySequence containsSingleAttribute]) |
|
34 |
description:'Only elements or attributes can be renamed (see section 2.3.4)'. |
|
35 |
! ! |
|
36 |
||
37 |
!RenameCommand methodsFor:'executing'! |
|
38 |
||
39 |
execute |
|
40 |
"Superclass says that I am responsible to implement this method" |
|
41 |
||
42 |
self renameNode: self targetSequence first to: self sourceSequence first |
|
247 | 43 |
|
44 |
"Modified: / 18-04-2010 / 22:18:00 / Martin Hevera <>" |
|
0 | 45 |
! ! |
46 |
||
274 | 47 |
!RenameCommand methodsFor:'renaming'! |
48 |
||
49 |
renameNode: node to: name |
|
50 |
||
51 |
node documentAdaptor |
|
52 |
updRename: node nodeId to: name nodeId |
|
53 |
||
54 |
"Modified: / 05-02-2012 / 18:47:27 / Adam Senk <senkadam@gmail.com>" |
|
55 |
! ! |
|
0 | 56 |
|
57 |
!RenameCommand class methodsFor:'documentation'! |
|
58 |
||
232
9d8fd28b99b0
branch datatypes reintegrated
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
0
diff
changeset
|
59 |
version_SVN |
9d8fd28b99b0
branch datatypes reintegrated
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
0
diff
changeset
|
60 |
^ '$Id$' |
0 | 61 |
! ! |