RE: [xsl] Embed XSL in XML

Subject: RE: [xsl] Embed XSL in XML
From: "Américo Albuquerque" <aalbuquerque@xxxxxxxxxxxxxxxx>
Date: Fri, 18 Oct 2002 18:44:28 +0100
That's because your template displays text, not markup tags and that's
what is shown by the browser.
(I think that the disable-output-escaping method is in the archives and
is a method to be avoid if possible, try searching in the archives by
'd-o-e' or 'disable-output-escaping')
You could try this instead:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="#stylesheet"?>
<!DOCTYPE responses [
 <!ATTLIST xsl:stylesheet
 id ID #REQUIRED
>
]>
<responses>
 <xsl:stylesheet id="stylesheet" version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
 <xsl:template match="response">
  <xsl:copy-of select="//content/*"/>
 </xsl:template>
 </xsl:stylesheet>
 <response>
  <request>
   <ID>101</ID>
   <content>
<HTML>
 <HEAD>
  <TITLE>Test Info</TITLE>
  <LINK MEDIA="screen, print" REL="StyleSheet" TYPE="text/css"
HREF="http://link/to/the/default.css"/>
 </HEAD>
 <BODY BGCOLOR="#FFFFFF">

   <table WIDTH="690" ALIGN="center" BORDER="0"
CELLSPACING="0" CELLPADDING="0">
   <tr align="left">
    <td COLSPAN="2" ALIGN="RIGHT" WIDTH="690">
     <BR/><SPAN
class="dl"><a href="javascript:window.close();">Close</a></SPAN>
    </td>
   </tr>
   </table>
   <b>Test text here</b>
 </BODY>
</HTML></content>
  </request>
 </response>
</responses>

Hope that this helps you.

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Maulik Modi
Sent: Friday, October 18, 2002 6:11 PM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: RE: [xsl] Embed XSL in XML


I am sorry, I should have mentioned all the possible options I have
tried. I had tried this also and it only presents the XML document in
the browser. It does not 'render' the result-set(html) in the browser
like I want it to.

Here is the effect I want. If you were to reference a separate XSL file,
then it works.
<?xml-stylesheet type="text/xsl" href="test.xsl"?>

However, if the XSL is in the same file as the XML doc, then according
to the spec, you have to use the "ID" for the embedded stylesheet. At
least thats what I understood from the documentation. Anyway, in the
end, it seems to me that I am following the spec, but not getting the
result it proposes or I am missing something and need you help.

Any thoughts?

-Maulik
-----Original Message-----
From: Américo Albuquerque [mailto:aalbuquerque@xxxxxxxxxxxxxxxx]
Sent: Friday, October 18, 2002 11:45 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Embed XSL in XML


<?xml-stylesheet type="text/xml" href="#stylesheet"?>
-----------------------------^ Try changing this to 'type="text/xsl"'
and it should work. Hope that this helps you


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Maulik Modi
Sent: Friday, October 18, 2002 5:22 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] Embed XSL in XML


I have researched this topic in the FAQ and also on the w3c site. And
based on what I have found, the following code should work. However, it
does not! I am using IE6 as the client. Here is an example of the code.
Note that if I take the same XSLT code and put it in a separate file and
reference the xsl directly and use IE6 as a client or do a standalone
transformation with my favorite transformer like Saxon, it works just
fine.

Any help is appreciated.

<?xml-stylesheet type="text/xml" href="#stylesheet"?>
<!DOCTYPE responses [
	<!ATTLIST xsl:stylesheet
	id ID #REQUIRED
>
]>
<responses>
	<xsl:stylesheet id="stylesheet" version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
	<xsl:template match="response">
		<xsl:value-of select="//content"
disable-output-escaping="yes"/>
	</xsl:template>
	</xsl:stylesheet>
	<response>
		<request>
			<ID>101</ID>
			<content>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD
HTML 3.2//EN"&gt; &lt;HTML&gt;
	&lt;HEAD&gt;
		&lt;TITLE&gt;Test Info&lt;/TITLE&gt;
	&lt;LINK MEDIA="screen, print" REL="StyleSheet" TYPE="text/css"
HREF="http://link/to/the/default.css"&gt;
	&lt;/HEAD&gt;
	&lt;BODY BGCOLOR=#FFFFFF&gt;

			&lt;table WIDTH=690 ALIGN=center BORDER=0
CELLSPACING=0 CELLPADDING=0&gt;
			&lt;tr align="left"&gt;
				&lt;td COLSPAN=2 ALIGN=RIGHT
WIDTH=690&gt;
					&lt;BR&gt;&lt;SPAN
class="dl"&gt;&lt;a
href="javascript:window.close();"&gt;Close&lt;/a&gt;&lt;/SPAN&gt;
				&lt;/td&gt;
			&lt;/tr&gt;
			&lt;/table&gt;
			&lt;b&gt;Test text here&lt;/b&gt;
	&lt;/BODY&gt;
&lt;/HTML&gt;</content>
		</request>
	</response>
</responses>

TIA,

Maulik

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread