Results 1 to 4 of 4

Thread: requset for answer

  1. #1
    Junior Member
    Join Date
    Dec 2007
    Answers
    1

    requset for answer

    1. how to integrated php to xml.
    2. how to use in xsl,css in php.


  2. #2
    Junior Member
    Join Date
    Dec 2007
    Answers
    13

    Re: requset for answer

    You can use css as below in php.
    echo '';
    OR

    echo '';

    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


  3. #3
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: requset for answer

    Please find the details here.


  4. #4

    Re: requset for answer

    hi i me
    ?>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact