thekid/rfc — Issue #160: RFC 0160: xml.IXSLProcessor::setXMLTree() / setXSLTree()
Author: thekid
Created: 2011-10-09 15:29:43+00:00
State: open

Scope of Change
====
Two new methods will be added to the xml.IXSLProcessor interface and
implementing classes: setXMLTree() and setXSLTree().

Rationale
====
Allow for a separate implementation.

Functionality
====

New methods
----

```php

```

Example
----

```php
setOutputMethod('text');

// Add template
$t= $s->addChild(new Node('xsl:template', NULL, array('match' => '/document')));
$t->addChild(new Node('xsl:value-of', NULL, array('select' => 'name')));

// Create a tree
$t= new Tree();
$t->addChild(new Node('name', 'Timm'));

// Pass them to the processor
$proc->setXSLTree($s); // instead of $proc->setXSLBuf($s->getDeclaration().$s->getSource());
$proc->setXMLTree($t); // instead of $proc->setXMLBuf($t->getDeclaration().$t->getSource());

// Run transformation
$proc->run();
$result= $proc->output();
}
?>
```

Security considerations
====
None.

Speed impact
====
Neglectible.

Dependencies
====
- xml.DomXSLProcessor changes

Related documents
====
- http://xp-framework.net/rfc/contrib/rfc0160.diff
Implementing patch

Comments
====
- friebe, Sat Apr 12 14:03:42 2008
The above class a patch to the scriptlet.xml.XMLScriptletResponse class
which makes it use the new API.