File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
exist-core/src/main/java/org/exist/stax Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 29
29
public class StaXUtil {
30
30
31
31
public static int streamType2Type (final int type ) {
32
- int xpathType = switch (type ) {
32
+ return switch (type ) {
33
33
case XMLStreamConstants .START_ELEMENT -> Type .ELEMENT ;
34
34
case XMLStreamConstants .PROCESSING_INSTRUCTION -> Type .PROCESSING_INSTRUCTION ;
35
- case XMLStreamConstants .CHARACTERS -> Type .TEXT ;
35
+ case XMLStreamConstants .CHARACTERS , XMLStreamConstants . CDATA -> Type .TEXT ;
36
36
case XMLStreamConstants .COMMENT -> Type .COMMENT ;
37
37
case XMLStreamConstants .START_DOCUMENT -> Type .DOCUMENT ;
38
38
case XMLStreamConstants .ATTRIBUTE -> Type .ATTRIBUTE ;
39
- case XMLStreamConstants .CDATA -> Type .TEXT ;
40
39
default -> Type .UNTYPED ;
41
40
};
42
- return xpathType ;
43
41
}
44
42
45
43
public static short streamType2DOM (final int type ) {
46
- short domType = switch (type ) {
44
+ return switch (type ) {
47
45
case XMLStreamConstants .START_ELEMENT -> Node .ELEMENT_NODE ;
48
46
case XMLStreamConstants .PROCESSING_INSTRUCTION -> Node .PROCESSING_INSTRUCTION_NODE ;
49
47
case XMLStreamConstants .CHARACTERS -> Node .TEXT_NODE ;
@@ -56,6 +54,5 @@ public static short streamType2DOM(final int type) {
56
54
case XMLStreamConstants .ENTITY_DECLARATION -> Node .ENTITY_NODE ;
57
55
default -> -1 ;
58
56
};
59
- return domType ;
60
57
}
61
58
}
You can’t perform that action at this time.
0 commit comments