@@ -36,28 +36,22 @@ public abstract class Parse extends StandardFunc {
36
36
final Item unparsedText (final QueryContext qc , final boolean check , final boolean encoding )
37
37
throws QueryException {
38
38
39
- final byte [] path = toTokenOrNull (exprs [0 ], qc );
40
- if (path == null ) return check ? Bln .FALSE : Empty .VALUE ;
39
+ final byte [] token = toTokenOrNull (exprs [0 ], qc );
40
+ if (token == null ) return check ? Bln .FALSE : Empty .VALUE ;
41
+ final String path = string (token );
41
42
42
43
String enc ;
43
44
IO io ;
44
45
try {
45
46
enc = encoding ? toEncodingOrNull (1 , ENCODING_X , qc ) : null ;
46
47
47
- final String p = string (path );
48
- if (p .indexOf ('#' ) != -1 ) throw FRAGID_X .get (info , p );
49
- final Uri uri = Uri .uri (p );
50
- if (!uri .isValid ()) throw INVURL_X .get (info , p );
51
-
52
- if (uri .isAbsolute ()) {
53
- io = IO .get (p );
54
- } else {
55
- if (sc .baseURI () == Uri .EMPTY ) throw STBASEURI .get (info );
56
- io = sc .resolve (p );
57
- }
48
+ if (contains (token , '#' )) throw FRAGID_X .get (info , path );
49
+ if (sc .baseURI () == Uri .EMPTY ) throw STBASEURI .get (info );
50
+ if (!Uri .uri (path ).isValid ()) throw INVURL_X .get (info , path );
51
+ io = sc .resolve (path );
58
52
59
53
// overwrite path with global resource files
60
- String [] rp = qc .resources .text (p );
54
+ String [] rp = qc .resources .text (path );
61
55
if (rp == null ) rp = qc .resources .text (io .path ());
62
56
if (rp != null && rp .length > 0 ) {
63
57
io = IO .get (rp [0 ]);
0 commit comments