Web Hosting Talk







View Full Version : XML Question


kmb999
11-22-2001, 02:47 PM
Well, if you've seen some of my recent posts you know I'm learning a few different languages at once. Suprisingly it's working out well, actually. Now my question...

I'm running MSIE 5.5, and I made an XML page to test out how XML works with MSIE 5.5, but I can't get the <br> tag to work. I tried <br>, <br />, <br/>, and <br></br>, but nothing has worked yet. What should I do?

kmb999
11-22-2001, 02:57 PM
Here is what I was trying (my first attempt at a test xml document :rolleyes::stickout)...

<?xml version="1.0" standalone="yes"?>

<font face="arial" color="#000000" size="+1">

Title

</font>

<br/>
<br/>

<font face="arial" color="blue">

XML Test

</font>

Did I do something wrong with defining that it is xml?

kmb999
11-22-2001, 05:48 PM
C'mon, someone here must know a little bit of xml. :eek:

:bawling:

getweb
11-22-2001, 06:50 PM
Methinks it wants a parent object tag, otherwise the XML doc contains more than one top-level object. I just added a BODY tag around your example. That fixed the syntax errors. Then for completeness I added the HTML tags too. Try this:


<?xml version="1.0" standalone="yes"?>
<html>
<head>
</head>
<body>
<font face="arial" color="#000000" size="+1">
Title
</font>
<br/>
<br/>
<font face="arial" color="blue">
XML Test
</font>
</body>
</html>

getweb
11-22-2001, 06:53 PM
(Just making sure) Remember, the browser won't try to render this, since it's an XML document and not an HTML document.

kmb999
11-22-2001, 07:15 PM
Ok, thank you! :)

kmb999
11-22-2001, 07:31 PM
/Me wonders if it is possible to embed xml into cgi.

/Me attempts.

/Me finds out that the answer is no.

getweb
11-22-2001, 07:39 PM
Me assumes you mean have a CGI output XML

Me sees no problem with that!

[Me guesses you may need to adjust your headers. Intead of "Content-type: text/html" you may need something like "Content-type: text/xml" but I do not know the header type for sure. Try that or some variations, otherwise do a search.]

The Prohacker
11-22-2001, 09:32 PM
/me thinks you've been in IRC way to long.....

kmb999
11-22-2001, 10:07 PM
/Me says lol. :stickout

kmb999
11-22-2001, 10:10 PM
/Me wants to know how to use &nbsp; in XML without it giving me an error. :(

kmb999
11-22-2001, 10:14 PM
Grr...

& nbsp; doesn't a show even in the code tags. It only shows a space. :(

How can I use & nbsp; (without the space before the n) in XML without getting an error?

getweb
11-22-2001, 10:20 PM
I don't really follow what you are intending to do. What is this XML code for? If you're trying to do a webpage in XML is seems foolish to me, they are not really interchangeable. HTML is just kind of a subset of XML. Since XML isn't a layout-definition language spaces are irrelevant. (While I'm being so condenscending ;-) whatever happened to "never use spaces for formatting" anyway? That was like Web Design 101 when I was little)

All the XML coding I've done is for machine-to-machine data exchanges. But perhaps I'm just showing my ignorance/incompetence...?

kmb999
11-22-2001, 10:54 PM
Err... all I know is I'm trying to learn xml because I understand (at least from its supporters) that it's faster and more specific than html (better than html). Whenever I enter & nbsp; in xml though, I get an error. (I can't type it without the space because the forum turns the entire thing into a space.) What do I use for space(s) in xml?

getweb
11-22-2001, 11:17 PM
But XML is not HTML, as you're discovering with the "space" tag. You can complement HTML with custom XML tags that are defined by your particular application. But this is simply not what XML is intended to do or will do. I worry you are being led astray.

Here's a great resource to check out, "the source" can teach it better than I can:

http://www.w3.org/XML/1999/XML-in-10-points

kmb999
11-23-2001, 08:33 AM
Well, I guess you're right.

Maybe XHTML is what I want? :confused: