WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
UNCONFIRMED
95608
xslt fn:document uri fails load external files if relative URI contains characters "[ ] ' "
https://bugs.webkit.org/show_bug.cgi?id=95608
Summary
xslt fn:document uri fails load external files if relative URI contains chara...
Timur Junussov
Reported
2012-08-31 14:08:08 PDT
I've reposted this issue
https://code.google.com/p/chromium/issues/detail?id=146039&thanks=146039&ts=1346446842
here When you want to try include external document by relative path (ex: document('../data/one.xml')) and if your files placed inside directory which contains sequence of characters such as "[ Test ]" (rectangular brackets and space between them) or "Test '"(some text and apostroph sign and space between them) it fails to load If you specify full path with escaped characters when it works fine <xsl:value-of select="count(document('file:///C:/%5B%20test%20%5D/data/one.xml')/one/child)"/> P.s I think Chrome is providing wrong formatted file path to XSLT engine. It doesnt escapes charactes [], it should be %5B%5D What steps will reproduce the problem? 1. Create folder with name containing space and bracket ex: "My Folder ]" or "[ My Folder ]" or "My Folder '" 2. Extract into this folder zip archive ( text xml+xsl files ) 3. Open in Chrome browser file index.xml What is the expected result? It should load external document Count <xsl:value-of select="count(document('../data/one.xml')/one/child)"/> show 3 What happens instead? It fails to load, even if path is relative. Count <xsl:value-of select="count(document('../data/one.xml')/one/child)"/> shows 0 Folder Structure example C:\\[ Test ]\index.xml C:\\[ Test ]\data\one.xml C:\\[ Test ]\template\template.xsl if you change folder name to just Test it works fine C:\\Test\index.xml C:\\Test\data\one.xml C:\\Test\template\template.xsl -------file index.xml <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="template/template.xsl"?> <root/> -------file template.xsl <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform
" xmlns="
http://www.w3.org/1999/xhtml
"> <xsl:output method="html"/> <xsl:template match="/"> Count <xsl:value-of select="count(document('../data/one.xml')/one/child)"/> </xsl:template> </xsl:stylesheet> -------file one.xml <?xml version="1.0"?> <one> <child/> <child/> <child/> </one>
Attachments
not working example, just extract it and open index.xml in chrome browser, counter will show 0, but it should show 3
(1.21 KB, application/octet-stream)
2012-08-31 14:09 PDT
,
Timur Junussov
no flags
Details
working example, just extract it and open index.xml in chrome browser, counter will show 3
(1.16 KB, application/octet-stream)
2012-08-31 14:09 PDT
,
Timur Junussov
no flags
Details
Not work in chrome. Firefox output "Count 3 test"
(1.55 KB, application/x-zip-compressed)
2020-08-09 09:22 PDT
,
ivan386
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Timur Junussov
Comment 1
2012-08-31 14:09:23 PDT
Created
attachment 161769
[details]
not working example, just extract it and open index.xml in chrome browser, counter will show 0, but it should show 3
Timur Junussov
Comment 2
2012-08-31 14:09:50 PDT
Created
attachment 161770
[details]
working example, just extract it and open index.xml in chrome browser, counter will show 3
ivan386
Comment 3
2020-08-09 09:22:31 PDT
Created
attachment 406269
[details]
Not work in chrome. Firefox output "Count 3 test" Test for document function and include instruction. Both not work in chrome(78.0.3904.70) if full path contains spaces and other char that must be escaped in URL.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug