"Joe Price" <jo*****@hotmail.com> wrote in message
news:e0**************************@posting.google.c om
I've formatted one of my xml files for viewing through a web browser
using xsl.
It works fine in Internet Explorer, however when I use Netscape6 or
Opera to view the same page the disable-output-escaping function does
not work and it is displaying html tags as text rather than code.
Can anyone enlighten me as to why this is happening?
Not every XSL processor implements this feature, because it (obviously)
has the potential to produce malformed output. XSLT is meant to be a
side-effects-free programming language, so disable-output-escaping is
not a required part of an XSLT processor.
The favoured alternative for your case is to use well-formed XHTML as
part of the XML tree, so that you can avoid putting your code in CDATA
sections.
Am i using the wrong namespace?
No.
i'm currently using:
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
Correct.
Can anyone explain to me a bit more about namespaces? why is there
different ones?
Namespaces in XML are just what they are everywhere else - a method to
collate names in such way that their semantic meaning cannot be
misunderstood. You need namespaces as soon as there is the remote
possibility that someone chooses a name for something already existent
in the current scope. Like files in a file system. You cannot have two
files with the same name, they must at least be different in their path.
Think of a telephone book, or of DNS.
The namespace declaration
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" has three parts:
- the prefix "xmlns:"
- the name of your namespace, "xsl" in this case
- the URI of that namespace (every namespace needs a unique URI)
By prefixing the elements with their approriate namespace, like
<xsl:for-each>
you give them their meaning. Nothing keeps you from using <my:for-each>
elements, if you like. If you have declared it, of course:
xmlns:my=http://my.namespace.com
For more on namespaces:
http://www.google.com/search?q=XML+namespace+tutorial ;-)
HTH
Martin