Re: xslt_process

From: Date: Tue, 13 Apr 2004 19:06:52 +0000
Subject: Re: xslt_process
References: 1  Groups: php.install 
Request: Send a blank email to php-install+get-13235@lists.php.net to get a copy of this message
hi. it seems as if this is no install-error, but your xml/xsl is not valid or has some conflicts with how the php-extensions except the code to be. couple of things changed (specially in the xslt-extension). try error-traping first. maybe this helps: // define error-traping-function function xslt_trap_error($parser, $number, $level, $messages) { if(is_array($messages)) { $data = array(); foreach ($messages as $key => $value) { $data[$key] = $value; } echo sprintf("%s in %s on line %d", $data['msg'], $data['URI'], $data['line']); } else { echo $messages; } } // create xslt-processor $xProc = xslt_create(); // set error handler xslt_set_error_handler($xProc, 'xslt_trap_error'); // define $args and $params as you're used to it // ... // do transforming $out = @xslt_process($xProc, 'arg:/_xml', 'arg:/_xsl', null, $args, $params); if($out) { return $out; } else { echo '<h2>Error using sablotron</h2>'.$this->debug(); trigger_error('parsing did not work: <pre>'.xslt_error($xProc), E_USER_ERROR); } there is also another alternative: as it seems from your script you do not need xsl-parameters. so you can alternatively use expat (which is used by the DomXML-extension) as parser instead of sablotron (which is used by the xslt-extension). hth - ma # life would be easier if i knew the source code... > Von: ½Bî¶ §ºµth£Ñ½ <southen@pipeline.com> > Antworten an: php-install-return-13234-grillen=abendstille.at@lists.php.net > Datum: Tue, 13 Apr 2004 11:50:57 -0700 > An: php-install@lists.php.net > Betreff: [PHP-INSTALL] xslt_process > > I'm trying to use Sablotron to server-side parse my XML. I've used an RPM > of php 4.3.4 on RH9. I'm using also Plesk 6, a virtual hosting environment. > > After installing this RPM, I run the www.domain.com/phpfile.php?x=file.xml > > and I get the warning XML parser error 3: no element found in ......... on > line 85 > > My line 85 says: > > xslt_process($this->processor, 'arg:/_xml', 'arg:/_xsl', NULL, > $arguments) > > so I assume xslt_process is the problem (don't know why, worked in php 4 > .3.3). All different XML & XSL files cause the same error. I would really > appreciate it if someone could give me some pointers on a workaround for > this, I'm desperate!! > > THANKS!!!!!!!!!!!!! > > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.657 / Virus Database: 422 - Release Date: 4/13/2004 >

« previous php.install (#13235) next »