0
|
1 |
"{ Package: 'stx:goodies/xmlsuite/xquery' }"
|
|
2 |
|
|
3 |
"{ NameSpace: XQuery }"
|
|
4 |
|
|
5 |
UpdateCommand subclass:#ReplaceElementContentCommand
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'XQuery-Update Facility'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
|
13 |
!ReplaceElementContentCommand class methodsFor:'priorities'!
|
|
14 |
|
|
15 |
priority
|
|
16 |
"Superclass says that I am responsible to implement this method"
|
|
17 |
|
|
18 |
^40
|
|
19 |
! !
|
|
20 |
|
|
21 |
!ReplaceElementContentCommand 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 |
!ReplaceElementContentCommand 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 |
|
|
52 |
!ReplaceElementContentCommand methodsFor:'replacing'!
|
|
53 |
|
|
54 |
replaceValueOf:referenceNode with:newValueNode
|
|
55 |
|importedNewValueNodeId|
|
|
56 |
|
|
57 |
importedNewValueNodeId := referenceNode documentAdaptor
|
|
58 |
importForeignNode:newValueNode asXQueryConstructedNode nodeId
|
|
59 |
adaptor:newValueNode asXQueryConstructedNode documentAdaptor.
|
|
60 |
referenceNode documentAdaptor updReplaceValueOf:referenceNode item nodeId
|
|
61 |
with:importedNewValueNodeId
|
|
62 |
|
|
63 |
"Modified: / 05-12-2007 / 14:26:29 / janfrog"
|
|
64 |
! !
|
|
65 |
|
|
66 |
!ReplaceElementContentCommand class methodsFor:'documentation'!
|
|
67 |
|
|
68 |
version
|
|
69 |
^ '$Header: /opt/data/cvs/stx/goodies/xmlsuite/xquery/XQuery__ReplaceElementContentCommand.st,v 1.1 2008-01-02 14:05:59 wrobll1 Exp $'
|
|
70 |
! !
|