I use php DOMDocument for XSLT transforming one XML to another and i need to use additional tag – mytag in resulting document tag like
<mytag:full-text>...</mytag:full-text>
to define this tag i tryed construction like this:
<xsl:namespace-alias stylesheet-prefix="mytag" result-prefix="mytag"/>
and so i get an error
Warning: DOMDocument::load() [domdocument.load]: Namespace prefix mytag on full-text is not defined
what’s i am doing wrong?
Here is a complete code example how to do this:
When this transformation is applied on the following XML document:
the wanted, correct result (the new element added under
b) is produced: