View Full Version : Random XML in the document....

04-24-2004, 08:28 PM
Can i just randomly define a new tag in my document, which i associate a css to, even if the rest of my document is in XHTML....?


04-24-2004, 11:18 PM
I think the answer is that if your document has an XHTML DOCTYPE then it is restricted to the tags and attributes which are defined in the HTML 4.01 specification.


04-25-2004, 03:54 AM
You can do it if you define your elements and attributes in addition to the XHTML DTD, although there are practical issues with that - http://www.codingforums.com/showthread.php?t=11384

But stupid-IE problems aside, yeah of course you can - that's what the "X" in "XHTML" is all about :)

04-25-2004, 09:12 AM
You don't need to change the DTD:
<mymarkup:rootel xmlns:mymarkup="http://any.uri.will.do.here/">
<mymarkup:childel />
<mymarkup:childel />
</mymarkup:rootel>You can then apply some CSS:
@namespace mymarkup "http://any.uri.will.do.here/";

rootel { border: 1px solid blue }
childel::after { content "hey there!" }
/*if you've used @namespace to declare a namespace, you can then do this:*/
mymarkup|rootel { /* rules */ }

04-25-2004, 02:37 PM
Thanks alot, LOL, im not really that much into xml yet, I hardly know what it is yet.... But thanks, all I was refering to is add a random tag like:


and then format it in css:

font-size: 44px;

thanks again..