php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17425 domxml_xslt_process - Warning = Fatal Error
Submitted: 2002-05-25 04:31 UTC Modified: 2002-07-01 10:09 UTC
From: mk at lrn dot ru Assigned:
Status: Closed Package: DOM XML related
PHP Version: 4.0CVS-2002-05-25 OS: Linux, 2.4.18, ALTLinux (Mandrak
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mk at lrn dot ru
New email:
PHP Version: OS:

 

 [2002-05-25 04:31 UTC] mk at lrn dot ru
I try using domxml extension's XSLT processor. But I don't succeed in it. I get a warning like this:

domxml_xslt_process(): underlying object missing in /home/mk/www/tests/xslt/xslt_test2.php on line 6

I would like to note, that this transformation goes fine with xsltproc --novalid routine.

phpinfo() says:
===============
DOM/XML enabled
DOM/XML API Version 20020516
libxml Version 2.4.21
HTML Support enabled
XPath Support enabled
XPointer Support enabled
DOM/XSLT enabled
libxslt Version 1.0.17
DOM/EXSLT enabled
libexslt Version 1.0.17

XML file
<?xml version="1.0"?>
<expense-report>
    <total month="Jan">20 000, 41</total>
    <total month="Feb">22 020, 00</total>
    <total month="Mar">30 200, 44</total>
    <total month="Apr">29 000, 44</total>
    <total month="May">22 200, 44</total>
</expense-report>

XSLT file
-----
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" encoding="utf-8" version="1.0" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="DTD/xhtml1-strict.dtd" omit-xml-declaration="no" indent="yes"/>
  <xsl:template match="/">
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
         <head>
            <title>Expense report - TEST</title>
         </head>
         <body>
            <p><h3>Expenses 01/2002 - 05/2002, in USD</h3></p>
            <xsl:apply-templates/>
        </body>
      </html>
  </xsl:template>
  <xsl:template match="total">
    <p><h5><xsl:value-of select="@month"/> of 2002: <u><xsl:value-of select="."/></u></h5></p>
  </xsl:template>
</xsl:stylesheet>

PHP script
----------
<?php

            $xslt = domxml_xslt_stylesheet_file("/home/mk/www/tests/xslt/test-2.3-1a.xsl");

            $doc = domxml_open_file("/home/mk/www/tests/xslt/test-2.3-1.xml");
            $newDoc = domxml_xslt_process($xslt, $doc);
            print($newDoc->dump_mem());
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-01 10:09 UTC] chregu@php.net
try it with the following syntax

$newDoc = $xslt->process($doc);

if this does not work either, reopen the bug.

chregu
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 05:01:33 2025 UTC