PDA

View Full Version : no, i still dont get it!


Tjobbe
January 11th, 2005, 00:17
Xhtml.

<ido>
<thisbit>I understand</thisbit>
<yes>i do</yes>
</ido>

I get that part where you can make your own tags.

But thats it. I have not been able to find yet a decent xhtml tutorial that explains it to me,

If that bit of code above stores in understand in <thisbit>, then how do i refer to it in future use?

or in simple terms, ho

[bang]


* tjobbe's head has just exploded



-----edit


Voice from the dead.



I understand how to write the tags and that you can make your own, but thats about all, how does xhtml store data and how then can you call the data in the future from that source?

Really confused as to what it is. need a good tutorial I think, but I've found a few and learn't little more than I wrote above, just before my head exploded.

sonicgroup
January 11th, 2005, 00:29
I think you are confusing XHTML with XML. XML allows you to create a library of tags that you've defined. XHTML is the next version of the HTML spec (a set library of elements - though it's going towards the XML route).

You store the data between your elements, or as properties of those elements. Then you save it as a file on a system somewhere. That is your datastore.

As for accessing the information in it, there's about as many ways of retrieving it as there are element names. There are client side solutions (Javascript), and many, many solutions in server-side languages (PHP, ASP, Perl, etc.).

PHP has some built-in functionality for reading and traversing XML documents, but they are woefully underpowered. Some of the external solutions available in PHP are Sablotron, SAX, PHP XML (by Keith Devens), PEAR's XML_Transformer, not to mention a few dozen other odd classes and function libraries.

There's no real easy way to do it (yet), so I'd check out some of the ones I listed. Most have examples or tutorials available alongside them.

the_pm
January 11th, 2005, 00:31
You're mixing up XML and XHTML. You wrote XML above (actually, according to a browser, you wrote jibberish, because you need to write an XML Schema to browsers will be able to interpret it).

XHTML is no more than a confined set of HTML tags, used appropriately (all are closed, no uppercase, quotes around everything, etc.). XHTML is very easy to learn and use, because it simply gets rid of unwanted HTML tags (such as <font>) and practices (such as using a combination of quoted and unquoted attributes).

Take a valid HTML4.01 page and run it through an XHTML validator, after switching doctypes, of course (start with XHTML Trans, then XHTML Strict). You might find your code validates to XHTML. You might find you need to apply the /> ending to unclosed tags. You might find you have tags/attributes that are no longer in use. You might find you need additional header information. When you clear those items up, you've written XHTML.

Alex
January 12th, 2005, 12:15
Take a look at this: http://www.topxml.com/
it might help you. :)