473,325 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

How do I color text with XML tags?

xyz
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 ====
Jul 20 '05 #1
2 2183
xyz wrote:
I am trying to display some XML-tagged text in a web page. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>


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/
Jul 20 '05 #2
David Dorward <do*****@yahoo.com> wrote:
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.


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/
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sandman | last post by:
I am splitting a text block into paragraphs, to be able to add images and stuff like that to a specific paragraph in a content management system. Well, right now I'm splittin on two or more...
7
by: jennyw | last post by:
I'm trying to parse a product catalog written in HTML. Some of the information I need are attributes of tags (like the product name, which is in an anchor). Some (like product description) are...
2
by: Macsicarr | last post by:
Hi All Wonder if you could help me. I have created a CMS system that allows the user to enter text and pic 'tags' for their own About us page, eg text.... text.... text.... text.......
0
by: a | last post by:
Save text file as html kloepper 17:42 23 Jul '04 I'm using httpwebresponse and a StringBuilder to return a stream that originates as a file with the .txt suffix (My download code converts the html...
10
by: tshad | last post by:
I have a problem setting the background color of textbox on the fly. I tried using: applicantID.backcolor = "F6F6F6" and applicantID.backcolor = "#F6F6F6"
3
by: Baquanb | last post by:
I need to get some text between font tags but I only need the text in the last table. The code i'm using below will get text between all font tags anyone know how I can just get whats in TABLE3...
13
by: DH | last post by:
Hi, I'm trying to strip the html and other useless junk from a html page.. Id like to create something like an automated text editor, where it takes the keywords from a txt file and removes them...
1
by: Jerry John | last post by:
I am working in ASP.NET with C#. I have a text file which contains datas with delimiters. For example:- MSH|^~\$|DISCHARGE|CLAY COUNTY MEMORIAL|||200502110939| I also have an XML file created...
8
by: Jeff | last post by:
ASP.NET 2.0 I'm wondering how to set the color of a visited HyperLinkField (the link text) in a GridView?? Here is the markup of the HyperLinkField I have problems with: <asp:HyperLinkField...
4
by: html | last post by:
Hello all, I need to change the colour of my text. For the paragraph I do document.fgColor ="blue" ; but how do I do this for the select tags? ....and I prefer it to apply to all select tags...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.