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 extend the content model of <b> element in XHTML1.1

Status
Not open for further replies.

desamsetty

Programmer
Mar 16, 2007
7
US
Hi,
Nice to have XML 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.
 
Cannot give you a 100% certain solution, but I think this gives you a good direction to search further.

[1] Make an internal doctype declaration something like this.
[tt]
<!DOCTYE html [
<!ENTITY % u.qname "u">
<!ENTITY % u.content "( #PCDATA )">
<!ELEMENT %u.qname; %u.content;>
<!ENTITY % b.content "( #PCDATA | %Inline.mix; | %u.qname; )*" >
<!ENTITY % xhtml11.dtd PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"%xhtml11.dtd;
]>
[/tt]
[2] The proceed as normal (xhtml default namespace etc...) and check if it validates. (I like to know too.)

[3] If you're serious about and determinate to develop the extension, you should consult the module file.
[tt]xhtml-inlpres-1.mod[/tt]
It's available at w3c. It would definitely be one of the must-have document on hand to extend inline element of the presentation module.

[4] Cannot guarantee the above would work, far from it. It is pure brain code written according to the logic of the thing. xhtml modulization is such a big elephant; and to extend it, I am seriously worried about its going bust... A lot of hypocracy around without really understanding it. But, don't quote me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top