1

I am beginner in PHP, XSLT. Found solution for transform XML using XSLT:

$xml = Array2XML::createXML('Document', $result);
$xsl = new DOMDocument;
$xsl->load('Teema.xsl');
$processor = new XSLTProcessor();
$processor->importStyleSheet($xsl);
$results=$processor->transformToXML($xml);
$results=$processor->transformToUri($xml,"NewTeema.xml" );

But, what to do if I have 2 or more XMLs? This $xml is not file, and I dont want to save each xml, like file on server (because it is was converted response json). Any ideas?

2 Answers 2

1

In the XSLT you can load additional document using the document() function.

Another possibility is to register a PHP function that loads the file and returns the value or DOM node.

Sign up to request clarification or add additional context in comments.

Comments

0

Good solution, but I decided to merge 2 json, like this: json_encode(array_merge(json_decode($result, true),json_decode($resultProducts, true))); And the use = Array2XML::createXML('Document', $result);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.