By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,276 Members | 2,063 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,276 IT Pros & Developers. It's quick & easy.

disable-output-escaping="yes" not working in Netscape or Opera ??

P: n/a
Hi all

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?
Am i using the wrong namespace? i'm currently using:
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"

Can anyone explain to me a bit more about namespaces? why is there
different ones?

Many thanks for your input!
Jul 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Joe Price wrote:
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.
From the XSLT 1.0 spec (16.4):
An XSLT processor is not required to support disabling output escaping.
Can anyone enlighten me as to why this is happening?
Am i using the wrong namespace? i'm currently using:
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"

Can anyone explain to me a bit more about namespaces? why is there
different ones?


Currently, there's only XSLT 1.0 with the namespace you are using. Well,
some old msxml versions use another namespace.

A better alternative would be, not to have HTML code inside CDATA
sections, but use XHTML embedded in your XML.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Jul 20 '05 #2

P: n/a
"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
Jul 20 '05 #3

P: n/a
In article <e0**************************@posting.google.com >,
Joe Price <jo*****@hotmail.com> wrote:
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.


You can only really expect disable-output-escaping to work when the
XSLT processor outputs XML. Output escaping is something that happens
when the tree resulting from the transform is converted into text, and
that doesn't happen in a web browser: the tree is interpreted as
[X]HTML, not output as text.

I'm surprised it worked in Internet Explorer.

-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!
Jul 20 '05 #4

P: n/a
Many thanks for your responses as they were really useful

Could you please point me in the right direction for tutorials on
embedding xhtml within an xml document?

many thanks
Jul 20 '05 #5

P: n/a
> Could you please point me in the right direction for tutorials on
embedding xhtml within an xml document?


XHTML is XML, so you are talking about embedding XML from one source into
another XML document. There are various ways to go about it, from slapping
together strings (with careful attention paid to encoding issues, if they're
not both Unicode) to DOM's importNode().

You are probably wondering how to first convert HTML to XHTML. For that, see
http://tidy.sourceforge.net/
Jul 20 '05 #6

P: n/a
This XML file i'm displaying through a web browser, I also load into
Flash.

If i was to write xhtml within my xml document - so that it would
display properly in netscape / opera etc - it would confuse the flash
parser as you have to specify which tag you want to extract content
from.

So, for example, just by adding a <p></p> tag to my xml file will mess
up the existing references to the xml tags within flash.

Any suggestions, solutions? Has anyone come across this problem
before?
Jul 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.