[xslt] RE: Encoding



It might help to replace '%' with '%%' since you seem to be using the printf() function; '%' is used for formatting purposes in all ..printf() functions.

   Roeland


Date: 26 Jul 2005 09:35:30 -0000
From: spinmar interfree it
Subject: [xslt] Encoding
To: xml gnome org
Cc: xslt gnome org
Message-ID: <20050726093530 29088 qmail community22 interfree it>


Hi all,
I'm seeing a strange error which I can't understand.
I'm writing a C cgi which use libxml2 and libxslt.
In my xsl I use exslt and then before calling xsltApplyStylesheet, I call
xmlSubstituteEntitiesDefault(1);
exsltRegisterAll();
The exslt function I use is str:encode-uri, because I have some urls which have a parameter which is a url too.
My cgi does:


xmlSubstituteEntitiesDefault(1);
exsltRegisterAll();
xsltParseStylesheetFile
xsltApplyStylesheet
xsltSaveResultToString

and then
printf("Content-Type: text/html; charset=iso-8859-1\n\n");
printf(bufptr);

If I print to stderr the result of trasformation the content of url is ok. For example:
<a href="http://server/cgi-bin/x?idm=1&amp;ids=13&amp;tmdg=1&amp;uc=http%3A%2F%2Fserver%2Fcgi-bin%2Ftest_content";>Link</a>


but when the page is displayed in the browser the url is:

<a href="http://server/cgi-bin/x?idm=1&amp;ids=13&amp;tmdg=1&amp;uc=http0X1.6ACE80804AA36P-89527.686218-1.997822server0.000000cgi-bin0.000000test_content";>Link</a>

As if the print or browser change the content of href. The behaviour is the same for explorer and firefox.

Any hints or idea?

Thanks for the help

--Marco


-------------------------------------------------------------------------
Visita http://domini.interfree.it, il sito di Interfree dove trovare
soluzioni semplici e complete che soddisfano le tue esigenze in Internet,
ecco due esempi di offerte:


- Registrazione Dominio: un dominio con 1 MB di spazio disco + 2 caselle
email a soli 18,59 euro
- MioDominio: un dominio con 20 MB di spazio disco + 5 caselle email
a soli 51,13 euro


Vieni a trovarci!

Lo Staff di Interfree
-------------------------------------------------------------------------



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]