Display XML file with XSL on an existing web page

I am trying to get an html page to display an XML file formatted using an XSL stylesheet. No matter what examples I see, either they appear on a new page and in the XSL stylesheet in which the tags are stored, but there are no examples where I can clearly see that it displays as part of an existing web page ...

I am using a PHP script to generate HTML. And the XML data is generated by another PHP function (not under my control). The XSL file is uploaded to the server and stored at: /xsl/1234567890.xsl

Here are some php outputs:

<html>
...
<body>
...
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/xsl/1234567890.xsl"?>
...
<xml tags>
...

What am I doing wrong?

+3
source share
1 answer

XML:

1 XSLT-. :

<iframe src="xml-source.xml"/>

(, xml, xsl), , Javascript iframe.

2 XSLT- XML. : PHP. - , XSLT- (, ).

+4

Source: https://habr.com/ru/post/1716961/


All Articles