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:#ReplaceValueOfCommand |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'XQuery-Update Facility' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!ReplaceValueOfCommand class methodsFor:'priorities'! |
|
14 |
||
15 |
priority |
|
16 |
"Superclass says that I am responsible to implement this method" |
|
17 |
||
18 |
^10 |
|
19 |
! ! |
|
20 |
||
21 |
!ReplaceValueOfCommand methodsFor:'checks'! |
|
22 |
||
23 |
checkSourceSequence:anXQuerySequence |
|
24 |
||
25 |
||
26 |
self |
|
27 |
assert: anXQuerySequence containsSingleTextOrAtomicValue |
|
28 |
description: 'target must be a single text node (see section 2.3.3.2.)'. |
|
29 |
||
30 |
"Modified: / 21-11-2007 / 12:23:15 / janfrog" |
|
31 |
! |
|
32 |
||
33 |
checkTargetSequence:anXQuerySequence |
|
34 |
self |
|
35 |
assert: (anXQuerySequence containsSingleNode) |
|
36 |
description:'Target sequence must contain one node (see section 2.3.3.2)'. |
|
37 |
||
38 |
"Modified: / 14-11-2007 / 11:31:24 / janfrog" |
|
39 |
! ! |
|
40 |
||
41 |
!ReplaceValueOfCommand methodsFor:'executing'! |
|
42 |
||
43 |
execute |
|
44 |
"Superclass says that I am responsible to implement this method" |
|
45 |
||
46 |
self replaceValueOf: self targetSequence first with: self sourceSequence first. |
|
47 |
||
48 |
"Created: / 14-11-2007 / 10:55:16 / janfrog" |
|
49 |
"Modified: / 14-11-2007 / 14:00:40 / janfrog" |
|
50 |
! ! |
|
51 |
||
274 | 52 |
!ReplaceValueOfCommand methodsFor:'replacing'! |
53 |
||
54 |
replaceValueOf:referenceNode with:newValueNode |
|
55 |
|importedNewValueNodeId| |
|
56 |
||
57 |
importedNewValueNodeId := referenceNode documentAdaptor |
|
58 |
importForeignNode:newValueNode "nodeId" |
|
59 |
"adaptor:newValueNode documentAdaptor". |
|
60 |
referenceNode documentAdaptor updReplaceValueOf:referenceNode |
|
61 |
with:importedNewValueNodeId |
|
62 |
||
63 |
"Modified: / 05-12-2007 / 14:26:29 / janfrog" |
|
64 |
"Modified: / 07-02-2012 / 18:53:26 / Adam Senk <senkadam@gmail.com>" |
|
65 |
! ! |
|
0 | 66 |
|
67 |
!ReplaceValueOfCommand class methodsFor:'documentation'! |
|
68 |
||
232
9d8fd28b99b0
branch datatypes reintegrated
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
0
diff
changeset
|
69 |
version_SVN |
9d8fd28b99b0
branch datatypes reintegrated
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
0
diff
changeset
|
70 |
^ '$Id$' |
0 | 71 |
! ! |