473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

PHP5 XML/XSL - Rendering strings?

The following code is what I am trying to achieve:

<?php
$data = '
<?xml version="1.0"?>
<page title="Simple XML">
<content>
<table>
<row>
<col>Row 1 Col 1</col>
<col>Row 1 Col 2</col>
</row>
<row>
<col>Row 2 Col 1</col>
<col>Row 2 Col 2</col>
</row>
</table>
</content>
</page>
';

$dom = new domDocument();
$dom->load("../include/styles/master-html.xsl");
$proc = new xsltprocessor;
$xsl = $proc->importStylesheet($dom);

$document = new DomDocument();
// $document->load('simple.xml'); // This works
$document->load($data); // This doesn't appear to work
print $proc->transformToXml($document);
?>

I can verify that the xsl transforms the $data if it is in a flatfile
(simple.xml). I am trying to render the data as a string into html,
however, and it doesn't appear to be working.

Can I even do a transform in this manner, or am I missing a critical step?

Thanks,
Brian "bojo" Jones
bojo at gvea dot com
Jul 17 '05 #1
1 1918
I found what I wanted. $document->loadXML($data);

Brian "bojo" Jones wrote:
Can I even do a transform in this manner, or am I missing a critical step?

Thanks,
Brian "bojo" Jones
bojo at gvea dot com

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chung Leong | last post by:
Help me here. I've become a bitconfused about how PHP4 deals with objects after reading this description of PHP5: "PHP's handling of objects has been completely rewritten, allowing for better...
28
by: mikel | last post by:
Hello, php5 is in everybodies mouth - but what are the *real* advantages and plus' compared to php4? mikel
8
by: Rob Ristroph | last post by:
I have tried out PHP 5 for the first time (with assistance from this group -- thanks!). The people I was working with have a site that uses lots of php objects. They are having problems with...
4
by: Daniel Andersen | last post by:
Hey, We are in the process of rewriting our internal management system (which was written in PHP4), and figured this would be a good time to migrate to PHP5 to get all the OO goodness it has to...
8
by: Dorthe Luebbert | last post by:
Hi, we have to convert a quite large ISO-application (Mysql4, PHP5) to UTF8. We found out so far that there is no collation for MySQL which is able to sort all character sets correctly. So this...
6
by: David Opstad | last post by:
I have a question about text rendering I'm hoping someone here can answer. Is there a way of doing linguistically correct rendering of Unicode strings in Python? In simple cases like Latin or...
19
by: McKirahan | last post by:
I am working in two environments neither configuration of which I can change; one's my Web host the other a client. My Web host requires the use of the ".php5" extension to use PHP v5.1.4; where...
3
by: xhe | last post by:
I have just upgraded my php version form php4 to php5. and I met this problem, and don't know if you know the solution. My site was written in PHP4, and most parts can be running smoothly in PHP5,...
2
by: Roberto | last post by:
When will PHP get Unicode support for PHP5? I realize that English is what everyone speaks when they want to do business, but I potentially could be not getting clients for my freelancing work...
3
by: SAL | last post by:
Hello, I did google this issue and found some stuff related to BrowserCaps section of either web.config or machine.config but it didn't work. It seems that most pages in my webapp are okay but a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.