Online
 
Friday, 09 January 2009
 
 
More article:
Related Content:

PHP5 and XSLT
 
Article Index
PHP5 and XSLT
Page 2
Page 3
 

PHP5 Functions and Properties of Note for XSLT Users

In addition to the tools discussed in , several additional functions or properties may be useful to PHP users needing to access XML documents and XSLT transformations in PHP5. These are shown in and .

Table 9.8. DOM Extension Properties of Note

Function

Description

load()

Loads a well-formed XML tree from the passed XML input file into a DomDocument object.

loadXML()

Loads a well-formed XML tree from the passed string (containing XML-formatted data) into a DomDocument object.

save()

Saves the XML tree stored in a DomDocument object back into a text file under the passed path name.

validate()

Validates the document tree stored in a DomDocument object based on the document's declared XML Document Type Definition (DTD).


Table 9.9. XSL Extension Properties of Note

Function

Description

importStyleSheet()

Parses the passed XML object tree as an XSL stylesheet to be used in transforming the XML document.

transformToXML()

Uses an already imported XSL stylesheet to transform the passed XML document. Returns a string containing the transformed XML (for this book's purposes, THML) output, suitable for echo to and subsequent rendering in a Web browser.


Additional details on these and other functions and properties related to the PHP5 DOM, XML, and XSL modules can be found by visiting the documentation for each extension at these links:

Including XSL Support in PHP5

The DOM and XML extension modules are built and included by default with PHP5. If you find that you are unable to use the XSL functions or properties in conjunction with these extensions, you will need to recompile your PHP5 installation to add support for XSL processing and transformations. To do so, follow these steps:

1.
Obtain the latest PHP5 source code from its home at .

2.
Ensure that you have the XSLT library (libxslt) from .

3.
Compile the PHP5 binary using the additional configuration option --with-xsl=xslt_library_path, where xslt_library_path is the location of the XSLT library.

For more information on PHP5, DOM, XML, and XSL, refer to individual extension documentation and the PHP5 migration documentation and notes, all available at the official PHP website via the link at .



Tags: Add more tags...,
This entry was posted on . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a comment. Tags: Simple PHP, Pear, Easy PHP, PHP Tutorial, PHP MySQL, XSLT, Sap Tutorial, CSS Tutorial, XSL FO Java, SQL Tutorial.
Users' Comments (0)

Comment an article
  Name
  E-mail
   Title
Available characters: 4000
 Notify me of follow-up comments
This image contains a scrambled text, it is using a combination of colors, font size, background, angle in order to disallow computer to automate reading. You will have to reproduce it to post on my homepage
Enter what you see:

No comment posted

Your Ad Here
Naruto 6
Statistic


Last Post

 
Top! Top!