homepage Welcome to WebmasterWorld Guest from 50.16.112.199
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
Sabotron xslt_process
Snookered

10+ Year Member



 
Msg#: 127 posted 9:37 am on Mar 25, 2005 (gmt 0)

Hi

I'm trying to run the following:

<?php

$xml="<station>
<id>23</id>
<location>19,25</location>
<conds>Sunny</conds>
<url>http://fdsfdsfds.com/fdf</url>
<path>images/23.jpg</path>
<ref>6565</ref>
</station>";

$xsl = file_get_contents ('test.xsl') ;

$arguments = array( '/_xml' => $xml,'/_xsl' => $xsl);

$xp = xslt_create();
$res = xslt_process($xp, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments);

echo $res;
xslt_free($xp);

?>

..and it outputs the actual raw generated html to the browser. However, if I swap 'arg:/_xml, for the name of a 'test.xml', it works fine (so it's not the .xsl file at fault). But I need it to be the $xml fragment, as that will eventually be the results of a query.

I've tried many combinations, including inserting <?xml version="1.0" encoding="utf-8"?> at the top of the fragment but no success.

Can anybody see how to handle the fragment properly?

Thanks

 

Snookered

10+ Year Member



 
Msg#: 127 posted 6:17 pm on Mar 26, 2005 (gmt 0)

I've solved it.

If anyone else is using Sablotron lots of links at the creator:

[gingerall.com ]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved