By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,562 Members | 1,282 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,562 IT Pros & Developers. It's quick & easy.

XSLT, document() function, filename, read non-standard/English characters (like )

P: 88
Hi!

I am trying to load files that contain non-standard (and non-English) characters (e.g. ), and need some help in understanding how the XSLT document() function interprets non-standard (and non-English) characters (e.g. ).

The problem is that I can't load files with such names.

The xslt is saved and declared as UTF-8.

E.g. the xml file has an in its name.

This
Expand|Select|Wrap|Line Numbers
  1. <xsl:value-of select="'.xml'"/>
Shows the file name as a string correctly.


This however
Expand|Select|Wrap|Line Numbers
  1. <xsl:value-of select="document('/.xml')"/>
Gives no response. No error, no warning, no nothing. And, of course, it doesn't load the file. This is a bit strange, because normally if the document function fails to find a file it will give a warning. This could mean that the file is found, but not opened.

I transform the xslt documents with PHP 5.2 libxml library, and thus have not access to Xpath 2.0 (and its uri escape functions). However, I do not think that function will help me, I have tried replacing the with "%C2%B5", resulting only in a error (file not found).

Any help, pointers and directions is gratefully appreciated!
Jan 22 '08 #1
Share this Question
Share on Google+
3 Replies


P: 88
I tried using

& #956; (HTML 4.01 Symbol Entities)


& #181; (ISO 8859-1 Symbol Entities)


With no success. The result was the same as described above: no error, warning etc.
Jan 22 '08 #2

P: 88
I have now tried

& #xB5; (Hexadecimal NCRs:)

With no success. The result was the same as described above: no error, warning etc.

I also noted that I can't use code points -- xpath 2.0 function, unfortunately.

There are no more character sets variations I am aware of that I cold try out. I'm at a complete loss here...
Jan 22 '08 #3

P: 88
I have confirmed that Apache does find the path correctly, i.e. the request for the /.xml file by XSLT document() function is successful. (I used filemon)

Then why isn't the XML being processed?

I can currently only think of one possibility: after the document is loaded it has to be processed by PHP, perhaps the fault lies there?

I know PHP has problems with non-English characters, and that you can't run an UTF-8 supported character in most PHP functions.

When I send data from PHP to XML it must be converted to UTF-8. I would guess then, if data is sent back to PHP (for processing) it must be converted back to PHP character standard (I believe it's ISO-8859-1).

This is more a PHP question now, and I will start a new thread in the appropriate forum.

If anyone, however, have had similar problems with the xslt document() function, please comment! Thank you.
Jan 22 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.