Click to See Complete Forum and Search --> : XML via XSL to XML with XSL finished HTML


lepi
03-22-2008, 11:44 AM
i have problem with it
i have XML1 and with XSL1 (PI) i want to have fictive (in browser) XML2 which calls XSL2 which make HTML :)
simple as that,but i have problem with viewing in browser
so,code is here and i dont know why browsers doesnt show it when i directly call XML1 (http://www.some-domain.com/xml1.xml)

XML1 (xml1.xml)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#x00A0;">
]><?xml-stylesheet href="xsl1.xsl" type="text/xsl"?>
<element>text1</element>


XSL1 (xsl1.xsl)
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method='xml' version='1.0'/>
<xsl:template match="/">
<xsl:processing-instruction name="xml-stylesheet">
<xsl:text>type="text/xsl" href="xsl2.xsl"</xsl:text>
</xsl:processing-instruction>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="@* | *">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template></xsl:stylesheet>

output from XSL1 should be (and i think is)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#x00A0;">
]><?xml-stylesheet href="xsl2.xsl" type="text/xsl"?>
<element>text1</element>

XSL2 (xsl2.xsl)
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
<HTML>
<xsl:apply-templates select="."/>
</HTML>
</xsl:template>
</xsl:stylesheet>


i try it with red,and without red,but there is no result,accept first transformation (XML2),but that XML2 (fictive in browser) doesnt call XSL2 (xsl2.xsl)

any one could help,pls?
i dont see where i mistake or what is wrong

lepi
03-23-2008, 11:38 AM
no one has idea? :(

Alain COUTHURES
03-23-2008, 12:06 PM
Sorry but I've already read, somewhere else, that a second transformation is currently not supported by browsers...

lepi
03-23-2008, 12:15 PM
as i thought,thnx
i mean,i saw that first transformation give right XML document to browsers,and browsers knows it is XML document,but browsers just doesnt execute it
pitty :(
i guess reason for that could be that they doesnt have defnse against infitinity loop (xml call xsl wich make first xml)
can u give me url on priv,pls? :D

jkmyoung
03-31-2008, 01:47 PM
Browsers treat all output from the first transformation as HTML.

It is actually possible to create an infinite loop, if in your source xml, you have some javascript which calls another transformation..

This is also another way to transform twice, but it isn't as efficient.