Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add new content to <b> element in XHTML1.1

Status
Not open for further replies.

desamsetty

Programmer
Mar 16, 2007
7
US
Hi,
Nice to have XHTML forum. I tried alot and I coundn't find a solution to my problem. Any help is greatly appreciated. The problem is, I have downloaded the default 'XHTML11.dtd' driver from w3c to a folder in my project(.NET project) and I am validating my XHTML docs i.e. .aspx pages against this dtd. When my page is rendered in 'application/xhtml+xml' content I am getting an error "Content model of element 'b' disallows element 'u'". I know content model for element <b> which is in 'xhtml-pres-1.mod' (this module further references "xhtml-inlpres-1.mod") disallows element <u>. So, I want to add element <u> to element <b>'s content model to underline some text in my rendered document. For example, like this '<b><u>some text</u></b>'. But I want to do this by referencing element <b> in my 'My-XHTML11.dtd'. So, the actual element wil be in public 'xhtml-pres-1.mod' but I want to extend it's default content model.

Thanks for your time and help.
 
Modifying the .dtd file is an XML question. You'd most likely have better luck posting there.

[monkey][snake] <.
 
Hi monksnake,
Thanks for your reply. I will post it there also.
 
I don't get it. If all you want to do is underline or bold some text, what's wrong with just using CSS? For something so simple, modifying the DTD seems like overkill to me.
 
Hi AdaHacker,
Thansk for your reply. It sounds good to me. Yes, I can do that and may be I will do that. But I want to find a solution for my problem. It will help me great in future if I want to extend any other element's content model.
 
The xhtml 1.1 dtd says you can't put a <u> inside a <b> element.

Sure you could over-ride it, but the point of the dtd is to ensure you are following a defined standard and a browser knows what that standard is.

I guess you could make your custom dtd publically available, but it does seem kind of pointless when you can just follow the spec and achieve what you wanted with the 'standard' dtd.

<honk>*:O)</honk>

Earl & Thompson Marketing - Marketing Agency Services in Gloucestershire
 
Hi Foamcow,
Thanks for your reply. For this specific problem I can use the css as mentioned by AdaHacker. But w3c documentation on XHTML1.1 says we can extend the content model of any element. I unable to do that in this scenario. I just want to know how I can do that.
 
Oh I know you can create any DTD that you want. But what I claim sounds crazy is W3C saying you can extend the content model on XHTML1.1, therefore stating that it's still XHTML1.1. I don't see how it's possible that it would still be XHTML1.1 [!]valid[/!].

[monkey][snake] <.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top