Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 09:26 PM
xyz
Guest
 
Posts: n/a
Default How do I color text with XML tags?

I am trying to display some XML-tagged text in a web page. The
following example works well in Netscape 7.1, but only the H2 heading
is colored in MSIE. It seems that MSIE only applies style attributes
to tags that it recognizes.

Is there a way in which this can be done? Is it possible to format
the XML part (from <azTagger> to </azTagger>) with XLS? If so, how?

Thanks
xyz


======== START OF HTML FILE ===========
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>test</title>
<style type="text/css">
<!--
azsent {margin-left: 40px; margin-right: 40px;}
h2 {color: green }
azphr.n {color: green }
azphr.v { color: #ff0000 }
azphr.p {color: blue }
azpos.r {font-weight: bold }
-->
</style>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080"
alink="#ff0000">
<h2>Test of colored Text</h2>

<azTagger>
<azParag>
<azsent><azphr class="n"><azPOS p="N">Albert </azPOS><azPOS
p="N">Einstein </azPOS></azPhr><azPhr class="V"><azPOS p="X">was
</azPOS></azPhr><azPhr class="N"><azPOS p="N#" o="JN#">one
</azPOS></azPhr><azphr class="p"><azPOS class="R">of
</azPOS><azPOS p="T">the </azPOS><azPOS p="J" o="AJ">greatest
</azPOS><azPOS p="N">scientists
</azPOS></azPhr><azPhr class="P"><azPOS class="R">of </azPOS><azPOS
p="D">all </azPOS><azPOS p="N" o="NV">time</azPOS></azPhr>.
</azSent><azsent> <azPhr class="N"><azPOS p="P">He
</azPOS></azPhr><azPhr class="V"><azPOS p="X">is
</azPOS><azPOS p="A" o="AJNV">best </azPOS><azPOS p="V" o="NV">known
</azPOS></azPhr><azPhr class="P"><azPOS class="R">for
</azPOS><azPOS p="P">his </azPOS><azPOS p="N">theory
</azPOS></azPhr><azPhr class="P"><azPOS class="R">of
</azPOS><azPOS p="N">relativity</azPOS></azPhr>.</azSent>
</azParag>
</azTagger>

</body>
</html>
======== END OF HTML FILE ====
  #2  
Old July 20th, 2005, 09:26 PM
David Dorward
Guest
 
Posts: n/a
Default Re: How do I color text with XML tags?

xyz wrote:
[color=blue]
> I am trying to display some XML-tagged text in a web page.[/color]
[color=blue]
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>[/color]

If you want to use an XML file, then don't give it an SGML Doctype (that it
doesn't conform to anyway), and send it with a content type of
application/xml, not text/html.

--
David Dorward http://dorward.me.uk/
  #3  
Old July 20th, 2005, 09:27 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: How do I color text with XML tags?

David Dorward <dorward@yahoo.com> wrote:
[color=blue]
> If you want to use an XML file, then don't give it an SGML Doctype
> (that it doesn't conform to anyway), and send it with a content
> type of application/xml, not text/html.[/color]

And, of course, if you present something as XML, then, for example, h2
is just another tag, with no defined meaning or implied default
presentation. It's not bigger, it's not bold, it's not even a block.
That is, you need to style everything.

Moreover, you need to write at least "well-formed" XML, which means
that start and end tags match exactly (in case, too), and you the exact
tag names in CSS too.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
 

Bookmarks

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles