Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > disable-output-escaping="yes" not working in Netscape or Opera ??

Reply
Thread Tools

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

 
 
Joe Price
Guest
Posts: n/a
 
      09-25-2003
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:
xmlnssl="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!
 
Reply With Quote
 
 
 
 
Johannes Koch
Guest
Posts: n/a
 
      09-25-2003
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:
> xmlnssl="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.)

 
Reply With Quote
 
 
 
 
Martin Boehm
Guest
Posts: n/a
 
      09-25-2003
"Joe Price" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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:
> xmlnssl="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
xmlnssl="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


 
Reply With Quote
 
Richard Tobin
Guest
Posts: n/a
 
      09-25-2003
In article <(E-Mail Removed) >,
Joe Price <(E-Mail Removed)> 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!
 
Reply With Quote
 
Joe Price
Guest
Posts: n/a
 
      09-25-2003
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
 
Reply With Quote
 
Mike Brown
Guest
Posts: n/a
 
      09-26-2003
> 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/


 
Reply With Quote
 
Joe Price
Guest
Posts: n/a
 
      09-26-2003
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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Form works in IE and Opera, not Firefox nor Netscape Bob Javascript 3 07-14-2006 05:09 AM
newbie: This CSS works in IE but not in FireFox, Opera, Netscape Jeff HTML 3 06-23-2006 01:42 PM
Opera 7.53 vs Opera 6.0 ? Hockey Buff Computer Support 3 08-17-2004 08:53 PM
Script is working in IE, but not working in Netscape 7 - trouble with document.selection.createRange(); lawrence Javascript 8 05-05-2004 01:43 AM
Opera 6 and Netscape 6 not playing ball MV Javascript 2 02-26-2004 02:09 AM



Advertisments