17
17
import org .sirix .axis .visitor .VisitorDescendantAxis ;
18
18
import org .sirix .node .immutable .xdm .ImmutableElement ;
19
19
import org .sirix .node .immutable .xdm .ImmutableText ;
20
+ import org .slf4j .Logger ;
21
+ import org .slf4j .LoggerFactory ;
20
22
21
23
import java .nio .file .Path ;
22
24
import java .nio .file .Paths ;
26
28
27
29
public final class CreateVersionedXmlResourceAndQueryIntegrationTest {
28
30
31
+ private static Logger log = LoggerFactory .getLogger (CreateVersionedXmlResourceAndQueryIntegrationTest .class );
32
+
29
33
@ Rule
30
34
public TemporaryFolder tempDirectory = new TemporaryFolder ();
31
35
@@ -71,7 +75,7 @@ public MyXmlNodeVisitor(final ResourceManager<XmlNodeReadOnlyTrx, XmlNodeTrx> ma
71
75
72
76
@ Override
73
77
public VisitResult visit (ImmutableElement node ) {
74
- System . out . println ("Element (most recent revision " + trx .getRevisionNumber () + "): " + node .getName ());
78
+ log . info ("Element (most recent revision " + trx .getRevisionNumber () + "): " + node .getName ());
75
79
76
80
if (node .getNodeKey () == 14L ) {
77
81
final var pastAxis = new PastAxis <>(manager , trx );
@@ -89,18 +93,18 @@ public VisitResult visit(ImmutableElement node) {
89
93
// Axis to iterate over the node in past revisions (if the node existed back then).
90
94
final var pastAxis = new PastAxis <>(manager , trx );
91
95
pastAxis .forEachRemaining ((trx ) ->
92
- System . out . println ("Element in the past (revision " + trx .getRevisionNumber () + "): " + trx .getName ()));
96
+ log . info ("Element in the past (revision " + trx .getRevisionNumber () + "): " + trx .getName ()));
93
97
94
98
for (int i = 0 , attributes = trx .getAttributeCount (); i < attributes ; i ++) {
95
99
trx .moveToAttribute (i );
96
100
97
- System . out . println ("Attribute (most recent revision " + trx .getRevisionNumber () + "):"
101
+ log . info ("Attribute (most recent revision " + trx .getRevisionNumber () + "):"
98
102
+ trx .getName () + " ='" + trx .getValue () + "'" );
99
103
100
104
// Axis to iterate over the node in past revisions (if the node existed back then).
101
105
final var pastAttributeAxis = new PastAxis <>(manager , trx );
102
106
pastAttributeAxis .forEachRemaining ((trx ) ->
103
- System . out . println ("Attribute in the past (revision " + trx .getRevisionNumber () + "): "
107
+ log . info ("Attribute in the past (revision " + trx .getRevisionNumber () + "): "
104
108
+ trx .getName () + " ='" + trx .getValue () + "'" ));
105
109
106
110
trx .moveToParent ();
@@ -111,12 +115,12 @@ public VisitResult visit(ImmutableElement node) {
111
115
112
116
@ Override
113
117
public VisitResult visit (ImmutableText node ) {
114
- System . out . println ("Text (most recent revision " + trx .getRevisionNumber () + "): " + node .getValue ());
118
+ log . info ("Text (most recent revision " + trx .getRevisionNumber () + "): " + node .getValue ());
115
119
116
120
// Axis to iterate over the node in past revisions (if the node existed back then).
117
121
final var pastAxis = new PastAxis <>(manager , trx );
118
122
pastAxis .forEachRemaining ((trx ) ->
119
- System . out . println ("Text in the past (revision " + trx .getRevisionNumber () + "): " + trx .getValue ()));
123
+ log . info ("Text in the past (revision " + trx .getRevisionNumber () + "): " + trx .getValue ()));
120
124
121
125
return VisitResultType .CONTINUE ;
122
126
}
0 commit comments