shea wrote:
I have an XML data type which I would like to display in my HTML.
The data type looks somthing like this:
<package name="helloworld">
<description>
This is a program which prints hello world to a terminal.
</description>
<file uri="hellos.zip" name="source code" size="100bytes"/>
<file uri="hellob.zip" name="binaries" size="300bytes"/>
<package>
I would like to embed these <packages> at various location in my
formatted text (html). Then use XSLT's to do the transforms.
I have used XSLT's which XML only documents before, but I am not sure
how to get started doing it in a mixed mode file.
What is the simplest way to acomplish this.
Well, in theory the proper way to mix your XML data markup with your
HTML document markup is to use XHTML and then embed your XML data in a
separate namespace. Then you can write an XSLT transformation which is
namespace aware and does an identity transformation on the elements in
the XHTML namespace and transforms your XML data to the XHTML markup you
want the data rendered with.
In practice you might encounter problems if you can't use XHTML instead
of HTML as your input and you might encounter problems with XHTML output
as browsers like IE are not yet up to deal with real XHTML. But the last
problem is easily solved with XSLT as that also allows you to transform
XHTML to plain HTML so that is not such a big deal.
What remains is your HTML input and whether you want/can transform that
to XHTML. Tidy is a tool that can help with that.
--
Martin Honnen
http://JavaScript.FAQTs.com/