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
|
|
43 |
! !
|
|
44 |
|
|
45 |
!RenameCommand methodsFor:'renaming'!
|
|
46 |
|
|
47 |
renameNode: node to: name
|
|
48 |
|
|
49 |
node documentAdaptor
|
|
50 |
updRename: node nodeId to: name item
|
|
51 |
! !
|
|
52 |
|
|
53 |
!RenameCommand class methodsFor:'documentation'!
|
|
54 |
|
|
55 |
version
|
|
56 |
^ '$Header: /opt/data/cvs/stx/goodies/xmlsuite/xquery/XQuery__RenameCommand.st,v 1.4 2008-01-02 14:09:00 wrobll1 Exp $'
|
|
57 |
! !
|