D
Don Adams
Is XHTML really format free? Here's what I'm
struggling with...
I am switching my structured FrameMaker documentation from
docbook-based SGML to XHTML1.1-based XML.
In SGML, I used the following to define a section:
<section>
<title>Section Title</title>
<para>First paragraph under the section.</para>
</section>
This allowed me to nest sections and the format of
the heading (the <title> element) would change based on
the nested level of the section. For example, a <section>
nested under a parent <section> would use a second-level heading
format for the <title> element (using FrameMaker's EDD to
control the format -- similar to style sheets).
In XHTML1.1, I am using the following:
<div class="section">
<h1>Section Title</h1>
<p>First paragraph under the section.</p>
</div>
This still allows me to nest sections and the format of the
heading (the <h1> element) changes based on the nested level
of the <div class="section"> element. For example, a <div class="section">
nested under a parent <div class="section"> uses a second-level heading
format for the <h1> element (using stylesheets to control the format).
But, is this "proper" use of the <h1> XHTML element? If it is the
proper use, why have other heading elements (<h2>, <h3>, etc.) defined in
XHTML?
If it is not the proper use, how would you make the headings change based
on their nested level in the document structure?
(Note: changing all the <h3> elements to <h2> elements in a moved section
"by hand" is not an option.)
I understand the need/desire to have XHTML backward compatible with HTML,
but shouldn't a generic <h> element have been created to support format-free
XHTML?
struggling with...
I am switching my structured FrameMaker documentation from
docbook-based SGML to XHTML1.1-based XML.
In SGML, I used the following to define a section:
<section>
<title>Section Title</title>
<para>First paragraph under the section.</para>
</section>
This allowed me to nest sections and the format of
the heading (the <title> element) would change based on
the nested level of the section. For example, a <section>
nested under a parent <section> would use a second-level heading
format for the <title> element (using FrameMaker's EDD to
control the format -- similar to style sheets).
In XHTML1.1, I am using the following:
<div class="section">
<h1>Section Title</h1>
<p>First paragraph under the section.</p>
</div>
This still allows me to nest sections and the format of the
heading (the <h1> element) changes based on the nested level
of the <div class="section"> element. For example, a <div class="section">
nested under a parent <div class="section"> uses a second-level heading
format for the <h1> element (using stylesheets to control the format).
But, is this "proper" use of the <h1> XHTML element? If it is the
proper use, why have other heading elements (<h2>, <h3>, etc.) defined in
XHTML?
If it is not the proper use, how would you make the headings change based
on their nested level in the document structure?
(Note: changing all the <h3> elements to <h2> elements in a moved section
"by hand" is not an option.)
I understand the need/desire to have XHTML backward compatible with HTML,
but shouldn't a generic <h> element have been created to support format-free
XHTML?