XML - XLTS

352 views
Skip to first unread message

Jens Kjelsbak

unread,
Oct 3, 2012, 4:18:06 PM10/3/12
to f3-fra...@googlegroups.com
Hello Everybody

It's pretty easy to render simple XML (e.g. echo Template::serve('template.xml','application/xml'); ), I can't figure out how to make transformation on a XML file with an XSLT-stylesheet. I can't get a normal processing instruction to work. Tried a number of things with href, so I don't think that's the problem.

<?xml-stylesheet type="text/xsl" href="/xliff/ui/en-ru.xsl"?>

Help will be highly appreciated :-)

Very best regards,
Jens



xfra35

unread,
Oct 4, 2012, 2:51:01 AM10/4/12
to f3-fra...@googlegroups.com
Hi Jens,

I don't think it has anything to do with the template engine, unless you expect F3 to render the xsl stylecheet as well. Otherwise, the xslt is just a file served by your web server, like any static file and not processed by F3.

In that case, the only issue I can imagine would occur if you were running the application in a subfolder (www.mysite.tld/subfolder) and forgot to prefix the xsl location with @BASE:
<?xml-stylesheet type="text/xsl" href="{{@BASE}}/xliff/ui/en-ru.xsl"?>

Jens Kjelsbak

unread,
Oct 5, 2012, 3:29:49 AM10/5/12
to f3-fra...@googlegroups.com
Hi xfra35,

Thanks for your reply. I've played around with the href. Both by variable substitition and absolute path. I don't think it's the href which are causing the problem. Somehow I think it got something to do with the way the file is handed to the browser (btw I tested in Safari, Firefox and Chrome). E.g. if the URL in the browsers is pointing directly to xml file the browser will only make the transformation if the file have the extension of 'xml' 

Very best regards,
Jens

Jens Kjelsbak

unread,
Oct 5, 2012, 3:37:10 AM10/5/12
to f3-fra...@googlegroups.com
Hi All,

Solved:

My communication with xfra35 raised an idea for a simple solution (reroute):

                                F3::reroute('http://localhost/xliff/ui/62319.xml');

Very best regards
Jens Kjelsbak

Reply all
Reply to author
Forward
0 new messages