This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Newbie question cont--transformation chokes on img tag


Hi all,

I've come across a new glitch in transforming my xhtml file.  It was doing
fine until I added an img tag (right before </body>)--then the
transformation resulted in a blank screen.  Files appear below.  Can anyone
tell me why this is happening and how to fix it?  

By the way, when I run the transformation at the command line using msxsl,
the image tag is converted to <img src="image85.gif"></img>.  But that
shouldn't be a problem, should it?  Also, when I view the xhtml file in the
browser before transformation, the image shows up fine.

Thanks in advance,
Kathryn

--------------------xhtml file-------------------------------
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en">

<head>
<title>Testing Title</title>
</head>
<body>
	<div class="mgronly">
		<p>The first paragraph applies only to managers.</p>
	</div>
	<div class="both">
		<p>Paragraph 2 applies to both investigators and
managers.</p>
		<p>The third paragraph to both.</p>
	</div>
	<div class="mgronly">
		<p>The last paragraph applies only to managers.</p>
	</div>

<img src="image85.gif" />

</body>
</html>
-------------------end xhtml file-----------------------------

---------------------xsl file---------------------------------
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:xhtml="http://www.w3.org/1999/xhtml";
    version="1.0">

<xsl:output method="xml" encoding="UTF-8"/>

	<xsl:template match="*|@*|text()|comment()">
		<xsl:copy>
			<xsl:apply-templates
select="*|@*|text()|comment()"/>
		</xsl:copy>
	</xsl:template>

	<xsl:template match="xhtml:div[@class='mgronly']"/>

</xsl:stylesheet>
--------------------- end xsl file------------------------------

On the outside chance the problem is with msxml, here's the transformation
code I'm using:

<script type="text/javascript">
var xml = new ActiveXObject("MSXML2.DOMDocument")
xml.async = false
xml.load("test-xhtml.htm")

var xsl = new ActiveXObject("MSXML2.DOMDocument")
xsl.async = false
xsl.load("test-xhtml-investigator.xsl")

document.write(xml.transformNode(xsl))
</script>


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]