homepage Welcome to WebmasterWorld Guest from 54.197.147.90
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
XML or Xhtml
Quick questions.
miles




msg:701526
 4:42 pm on Aug 5, 2002 (gmt 0)

A friend asked me if I knew xml or xhtml, at the moment I am having a senior moment. I am fairly sure it was xhtml. What is the difference and the advantages?

 

Knowles




msg:701527
 5:17 pm on Aug 5, 2002 (gmt 0)

xhtml is built off xml, the advantage right now is xhtml is much closer (read that as is the same) to html than xml is. Thats the one main thing I see we gonna end up having to learn each one of them anyways.

korkus2000




msg:701528
 5:34 pm on Aug 5, 2002 (gmt 0)

xhtml is an xml complient version of html. Really xhtml is not that much different than html. If you know html moving to xhtml is a snap. XML a stripped down version of SGML. It is the framework for all these web markup languages like html and xhtml. You use xml to create your own unique markup. You create the tags and and attributes.

miles




msg:701529
 5:35 pm on Aug 5, 2002 (gmt 0)

How close is xhtml to html. I have not seen too much by way of xhtml pages.

Would it be wise for me to learn xhtml or should I stick to html?

Is there an editor for xhtml so I can see how it is set up or should I get the book for dummies?

Does xhtml require any thing special as far a programs go?

korkus2000




msg:701530
 5:38 pm on Aug 5, 2002 (gmt 0)

Here is a good overview of xhtml.
[w3schools.com...]

they also have some good reading on xml. I would highly suggest learning and beginning a switch to xhtml. It is where the web is going. Better to learn it now. Most editors can handle xhtml. Like I said it isn't that much different. It's case sensitive, all attributes must be quoted and you need doc type declarations. Thats about it. It really is an easy step fron html to xhtml.

joshie76




msg:701531
 6:40 pm on Aug 5, 2002 (gmt 0)

I have not seen too much by way of xhtml pages.

In most cases you wouldn't know you were looking at an xhtml page unless you opened the source. They tend to carry the same .htm or .html file extension.

rewboss




msg:701532
 6:52 am on Aug 6, 2002 (gmt 0)

XML is sort of a blank canvas; you start from scratch.

Basically, you write a document with tags -- and you can call the tags anything you like, as long as they are properly nested etc. So I might create an XML document to describe a book, and it would look like this:

<?xml version="1.0"?>
<book>
<title>Pyramids</title>
<author>Terry Pratchett</author>
<genre>Comic fantasy</genre>
<isbn>0-552-13461-9</isbn>
<blurb>Being trained by the Assassin's Guild in Ankh-Morpork... (etc)</blurb>
</book>

As it stands, I have only described the structure. A browser like MSIE will display a heirarchical tree which can be collapsed, showing how everything is nested (or an error message if they aren't).

To make proper sense of it, I'd need a document type definition (DTD), which is where the <!doctype> declaration comes in, and a stylesheet. The DTD defines what tags are allowed, what attributes they may have, how they can be nested and so forth. The stylesheet defines how the different elements are to be rendered.

XHTML, basically, is an XML application that uses an XHTML DTD and stylesheet. (In practice, if you don't include the <!doctype> declaration, most browsers will assume you want an XHTML DTD.) It is one of many XML applications: some others include PGML (Precision Graphics Markup Language), VML (Vector Markup Language), CML (Chemical Markup Language) and so on.

fintan




msg:701533
 2:17 pm on Aug 22, 2002 (gmt 0)

In xml do you need to have a seperate document stating what each tag means or will the browser pick it up. How do you define xml tags.

korkus2000




msg:701534
 2:23 pm on Aug 22, 2002 (gmt 0)

In xml you need either a schema or a dtd(doc type definition). The browser will never know what they mean. You either use css like normal html or use an xml parser with xsl (eXtensible Stylesheet Language). xslt (eXstensive Stylesheet Language Transformations) is the stylesheet language that will translate xml documents into xhtml that the browser can read.

here some more info
[w3schools.com...]
[w3schools.com...]

There are some great places on the web to check out. Just do a google search for learning xml or xslt.

If you are running IE and have msxml 4.0 you can do translations from your browser without any serverside parsers.
[msdn.microsoft.com...]
[msdn.microsoft.com...]

moonbiter




msg:701535
 4:07 pm on Aug 22, 2002 (gmt 0)

Would it be wise for me to learn xhtml or should I stick to html?

It would be wise for you to learn XHTML. If you already know HTML, it is not hard to make the switch [nypl.org].

Nicu_Alecu




msg:701536
 8:18 am on Aug 26, 2002 (gmt 0)

Like I said it isn't that much different. It's case sensitive, all attributes must be quoted and you need doc type declarations. Thats about it. It really is an easy step fron html to xhtml.

Well, there are a few more things that I can think of: all tags have to be closed with the appropiate closing tag; for instance if u have a <li> tag, in XHTML having a </li> is mandatory; on the other hand, in HTML 4.01 there are tags that have NO closing tag, like <BR>; in XHTML they have to be converted to "self-closed" tags, in this case <br />; yet another interesting thing is making <input>s validate as XHTML; suppose you have something like this:

<input type="Radio" name="subject" value="JOIN" checked>
which is perfectly valid in HTML, but not valid in XHTML; in order to make it validate in XHTML, it will have to look like this:
<input type="Radio" name="subject" value="JOIN" checked="checked" />

Please note both de "self-closing" string at the end of the tag AND the checked="checked" string.

I'm not sure I mentioned all "alterations" needed, but when migrating to XHTML, the W3C's validator [validator.w3.org] is a very handy tool to use, outlining every "mistake" you could have done. This along with the other very usefull links posted here should help you do the transition. Is it necessary? well, I'd rather think of it as a recommendation, but there will be a time when it will become a necessity.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved