File tree 1 file changed +11
-13
lines changed
1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -178,23 +178,18 @@ register-codec [
178
178
decode : function [
179
179
"Parses XML code and returns a tree of blocks"
180
180
data [binary! string! ] "XML code to parse"
181
- /no- trim "Don't removes whitespaces"
181
+ /trim "Removes whitespaces (from head of strings) "
182
182
] [
183
183
if binary? data [data: to string! data]
184
- do bind [
185
- xmlTrimSpace: either any [
186
- no-trim
187
- all [
188
- block? options
189
- find options 'no-trim
190
- ]
191
- ] [none][[any xmlSpace]]
192
- parse-xml data
193
- ] parser
184
+ parser/xmlTrimSpace: any [
185
+ trim
186
+ select options 'trim
187
+ ]
188
+ parser/parse-xml data
194
189
]
195
190
196
191
verbose: 0 ;not used so far, but could be later
197
- options: none
192
+ options: object [ trim: false]
198
193
199
194
200
195
;-- follows content of the original xml-parse object:
@@ -988,7 +983,7 @@ register-codec [
988
983
(element-q-name: element-ns-prefix: "" )
989
984
]
990
985
]
991
- xmlTrimSpace: none
986
+ xmlTrimSpace: none ;- no trim by default
992
987
;
993
988
;
994
989
; Private XML Parser Methods
@@ -1038,6 +1033,9 @@ register-codec [
1038
1033
xml-string [string! ]
1039
1034
/local parse-result
1040
1035
] [
1036
+
1037
+ if true? xmlTrimSpace [xmlTrimSpace: [any xmlSpace]]
1038
+
1041
1039
;
1042
1040
; Parse the document and capture the return code from the REBOL
1043
1041
; parse.
You can’t perform that action at this time.
0 commit comments