To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Code Critique

Code Critique Having someone critique your code is always a great way to hone the skills. Stop in and post your code to see what your peers may have done differently.

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-28-2003, 09:32 AM   #1
dennebom
Junior Member
 
Join Date: Sep 2003
Location: Netherlands
Posts: 6
XML-XSL parser

Hey,

I've made a simple php parser to parse xml and xsl into a nice webpage.

PHP Code:

<?

// include variable's
include("CONST.php");


// Set location XML and XSL file
$XMLfile = "" . $DB_DIRECTORY . "/data.xml";
$XSLfile = "" . $XSL_DEFAULT_PATH . "/page.xsl";

// Load xml and xsl in DOM
$xmldoc = domxml_open_file($XMLfile);
$xsldoc = domxml_xslt_stylesheet_file($XSLfile);


// Parse XML and XSL
$result =  $xsldoc->process($xmldoc);

// Show HTML file in browser
print $result->dump_mem();

?>
Let me know what you think.

Last edited by dennebom; 10-28-2003 at 09:35 AM.
dennebom is offline   Reply With Quote
Old 10-28-2003, 11:59 AM   #2
LordShryku
kung foo code monkey
 
LordShryku's Avatar
 
Join Date: Aug 2002
Location: Occupational Hypnotherapy
Posts: 7,473
I think you should add a disclaimer

The DOM XML extension is considered experimental. It makes use of the Gnome XML Library, and you will at least need libxml-2.4.14 to use it. To use the XSL functions shown here, you will also need the libxslt library
LordShryku is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 05:32 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.