D
Dan H
I'm trying to apply CSS to an XML file and interject a JavaScript
function into the page. I have the following source code:
foo.xml
======
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="foo.css" type="text/css"?>
<doc>
<element1>
my text
</element1>
</doc>
foo.css
======
element1 {
display: block;
height: 100px;
border: 1px solid Black;
This works great for me when I load that page in IE and Firefox. Now, I
want to add a JavaScript file into the mix.
foo.js
=====
alert( "Hello, World from foo.js");
When I try to include it into the XML as a <script> tag, I don't get
the desired behavior. I've seen suggestions where people are using XSLT
to transform the XML into HTML, but I'd prefer to leave HTML and all
it's legacy behind. Is this possible?
function into the page. I have the following source code:
foo.xml
======
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="foo.css" type="text/css"?>
<doc>
<element1>
my text
</element1>
</doc>
foo.css
======
element1 {
display: block;
height: 100px;
border: 1px solid Black;
This works great for me when I load that page in IE and Firefox. Now, I
want to add a JavaScript file into the mix.
foo.js
=====
alert( "Hello, World from foo.js");
When I try to include it into the XML as a <script> tag, I don't get
the desired behavior. I've seen suggestions where people are using XSLT
to transform the XML into HTML, but I'd prefer to leave HTML and all
it's legacy behind. Is this possible?