Geeks Talk

Prepare for your Next Interview




requset for answer

This is a discussion on requset for answer within the PHP forums, part of the Web Development category; 1. how to integrated php to xml. 2. how to use in xsl,css in php....


Go Back   Geeks Talk > Web Development > PHP

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 12-18-2007
Junior Member
 
Join Date: Dec 2007
Location: delhi
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
amarbhanu is on a distinguished road
requset for answer

1. how to integrated php to xml.
2. how to use in xsl,css in php.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-18-2007
Junior Member
 
Join Date: Dec 2007
Location: Mumbai
Posts: 13
Thanks: 1
Thanked 2 Times in 2 Posts
daiveet is on a distinguished road
Re: requset for answer

You can use css as below in php.
echo '<head><link rel="css.css" type="text/css"></head>';
OR

echo '<head><style type="text/css">' . include('css.css') . '</style></head>';

For using xsl, you can use Saxon XSLT Processor as below:
1. Install the JavaBridge for PHP

2. Download the freeware (B) Saxon distribution from http://saxon.sourceforge.net/

3. Put the jar files in a directory whre you have access

4. Use this sample of code

// Directory where the jar files are located
define("SAXON_DIR", $_SERVER['DOCUMENT_ROOT']."/saxonb8.9.0/");

// include the jars
java_require(SAXON_DIR."saxon8.jar;".SAXON_DIR."saxon8-dom.jar");


$sXslFile = $_SERVER['DOCUMENT_ROOT']."/myfirst.xsl"; // The xsl file
$sXmlFile = $_SERVER['DOCUMENT_ROOT']."/myfirst.xml"; // The xml file

try
{
$oXslSource = new java("javax.xml.transform.stream.StreamSource", "file://".$sXslFile);
$oXmlSource = new java("javax.xml.transform.stream.StreamSource", "file://".$sXmlFile);

$oFeatureKeys = new JavaClass("net.sf.saxon.FeatureKeys");

// Create the Factory
$oTransformerFactory = new java("net.sf.saxon.TransformerFactoryImpl");

//Disable source document validation
$oTransformerFactory->setAttribute($oFeatureKeys->SCHEMA_VALIDATION, 4);

// Create a new Transformer
$oTransFormer = $oTransformerFactory->newTransformer($oXslSource);

// Create a StreamResult to store the output
$oResultStringWriter = new java("java.io.StringWriter");
$oResultStream = new java("javax.xml.transform.stream.StreamResult", $oResultStringWriter);

// Transform
$oTransFormer->transform($oXmlSource, $oResultStream);

// Echo the output from the transformation
echo java_cast($oResultStringWriter->toString(), "string");

}
catch(JavaException $e){
echo java_cast($e->getCause()->toString(), "string");
exit;
}

5. Enjoy
Reply With Quote
  #3 (permalink)  
Old 12-18-2007
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,330
Thanks: 7
Thanked 117 Times in 106 Posts
debasisdas will become famous soon enoughdebasisdas will become famous soon enough
Re: requset for answer

Please find the details here.
Reply With Quote
  #4 (permalink)  
Old 12-27-2007
Junior Member
 
Join Date: Dec 2007
Location: aloksoft2004@gmail.com
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
AlokKumarMishra is on a distinguished road
Re: requset for answer

<?php
<applet> hi i me</applet>
?>
Reply With Quote
Reply

  Geeks Talk > Web Development > PHP


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
What will be the answer kanchhana MainFrame 0 06-25-2007 05:01 AM
can i get answer for this gujjar Oracle Certification 12 02-26-2007 07:52 AM
can i get answer for this gujjar Oracle Certification 6 02-23-2007 07:17 AM
what is the answer ? psuresh1982 Brainteasers 3 01-12-2007 02:02 AM
Think and Answer fred Brainteasers 1 08-08-2006 03:22 PM


All times are GMT -4. The time now is 10:11 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved