BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
PHP XML
PHP XSLT Function xslt_free
PHP XSLT Function xslt_error
PHP XSLT Function xslt_create
PHP SimpleXML Function New_Doc
PHP SimpleXML Function Save
PHP SimpleXML Function load_string
PHP SimpleXML Function Load_File
PHP SimpleXML Function LoadXML
PHP SimpleXML Function Load
PHP SimpleXML Function Open_File
PHP SimpleXML Function xml_parser_create
PHP SimpleXML Create an XML Document
PHP XML RPC Function Server Call method
PHP XML RPC Parse Method Descriptions
PHP XML RPC Function ServerCreate
PHP XML RPC Function GetType
PHP XML RPC Function EncodeRequest
PHP XML RPC Function Encode
PHP XML RPC Function DecodeRequest
PHP DOMXPath Function registerNamespace
 
 

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :206

 

PHP XSLT Function xslt_getopt

PHP Version: PHP 4 >= 4.0.3

Description

This function returns the option on the given xslt processor.

Usage:

Int xslt_getopt ( processor xh)

This function returns option on the xslt processor. Sometimes you need to get the option that is already set on the processor and change the option to something else. E.g. Most of the time I used to check whether option of parsing public entities is set or not. If it is not set the I used set it

Example:

Content of employee.xml file:

<?xml version="1.0" encoding="UTF-8"?>

<employee>

            <employeename>test</employeename>

            <employeeaddress>test123</employeeaddress>

            <SSN>12343456</SSN>

            <company>XYZ Corporation</company>

</employee>

Content of xsl file:

<?xml version='1.0'?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

<html>

<head><title>XSLT in PHP</title></head>

<body>

     <xsl:for-each select="//employee">

          <BR><B>Employee Name:<xsl:value-of select="employeename"/></B></BR>

          <BR><B>Employee Address:<xsl:value-of select="employeeaddress"/></B></BR>

          <BR><B>SSN:<xsl:value-of select="SSN"/></B></BR>

          <BR><B>Company:<xsl:value-of select="company"/></B></BR>

     </xsl:for-each>

</body>

</html>

</xsl:template>

</xsl:stylesheet>

PHP Code:

  <?php

$processor = xslt_create();

xslt_setopt($processor,XSLT_SABOPT_DISABLE_ADDING_META);

$option = xslt_getopt($processor);

echo "Option is :".$option;

$transformed = xslt_process($processor, 'employee.xml', 'employee.xsl');

if ($option = XSLT_SABOPT_DISABLE_ADDING_META) {

    echo "XSLT_SABOPT_DISABLE_ADDING_META option is set on the processor";

}

echo $transformed;

xslt_free($processor);

?>

Output

XSLT_SABOPT_DISABLE_ADDING_META option is set on the processor

Employee Name:test

Employee Address:test123

SSN:12343456

Company:XYZ Corporation


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

An immediate job opportunity as a B
Software Developers Needed in Charl
Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C

View all Jobs (Add yours)
View all CV (Add yours)



answering service
online fax
swimming pool contractor
United Kingdom Conference Calling
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP