php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13872 Sablotron scheme handler does not work
Submitted: 2001-10-30 10:33 UTC Modified: 2001-11-13 05:23 UTC
From: flex at city dot ee Assigned: derick (profile)
Status: Closed Package: XSLT related
PHP Version: 4.1.0RC1 OS: Debian/Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: flex at city dot ee
New email:
PHP Version: OS:

 

 [2001-10-30 10:33 UTC] flex at city dot ee
Can't get scheme handler to work.
Seems it gets never called. Instead I get:

Sablotron error on line 1: unknown encoding ''

Example script:

<?php
  function scheme_handler($xslt, $scheme, $rest) {
    echo "*";
    return '<?xml version="1.0" encoding="UTF-8"?><doc>fish</doc>';
  }

  $xslt = xslt_create();
  xslt_set_scheme_handlers($xslt, array("get_all" => "scheme_handler"));
  $args = array(
    "/_xml" => '<?xml version="1.0" encoding="UTF-8"?><test>TestValue</test>',
    "/_xsl" => '<?xml version="1.0" encoding="UTF-8"?>
                <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                  <xsl:template match="test">
                    <xsl:value-of select="."/>: <xsl:value-of select="document('. "'test:/val'" .')/doc"/>
                  </xsl:template>
                </xsl:stylesheet>'
  );

  $data = xslt_process($xslt, "arg:/_xml", "arg:/_xsl", NULL, $args);

  // expect: TestValue: fish
  echo $data;

  xslt_free($xslt);
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-30 13:08 UTC] flex at city dot ee
Tried to debug this and found that

XSLT_SCHEME(handle).get_all for example doesn't get set so
it returns at the start of scheme_getall function (sablot.c)
without doing anything useful.

The same error appears with xslt_set_sax_handlers when
using handler type which needs handler pair (element, document).

Seems that register_sax_handler_pair() doesn't work the way it should. I don't fully understand how the code works so
I do not know why exactly this fails. But I hope
you got better starting point now.

 [2001-11-13 04:56 UTC] derick@php.net
This should be fixed in CVS now. Can you try it? (This fix is also applied to the PHP-4.1.0 tree).

Derick
 [2001-11-13 05:03 UTC] flex at city dot ee
Yes, it works, at least for me.
No problems with scheme nor sax handlers now.
Thanks.

Lenar

 [2001-11-13 05:06 UTC] derick@php.net
Ok, another bug bites the dust!

Derick
 [2001-11-13 05:22 UTC] derick@php.net
This should be fixed in CVS now. Can you try it? (This fix is also applied to the PHP-4.1.0 tree).

Derick
 [2001-11-13 05:23 UTC] derick@php.net
grrr, closed it is :)

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 22:01:28 2024 UTC