xp-framework/rfc — Issue #160: xml.IXSLProcessor::setXMLTree() / setXSLTree()
Author: thekid
Created: 2011-10-17 16:01:45+00:00
State: closed
Labels: framework, implemented

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