W3C home > Mailing lists > Public > www-html@w3.org > December 2004

XHTML: Combine p and section?

From: Daniel Kraft <d@daniel-kraft.net>
Date: Tue, 21 Dec 2004 15:52:21 +0000
To: <www-html@w3.org>
Message-ID: <MABBLAOFFNCEOGJECJIECENGDEAA.d@daniel-kraft.net>




Dear XHTML-Working-Group,
first, I think it was a very important change to allow paragraphs to contain, for instance, lists.
But as the semantics of paragraphs are to form the lowest-level-grouping in the structure of a document, I'd like to see the p and section elements combined to only one element (called 'ps' later on).

ps-elements which don't contain ps-children represent a paragraph as the current p-element. If they have nested ps's, they act as a "super-paragraph", which groups its children (as the current section-element (or eventually the div-element) does).

Look at the following piece of a XSLT-stylesheet which transforms ps into p and section (default-namespace is bound to http://www.w3.org/1999/XSL/Transform", and prefix html is bound to "http://www.w3.org/1999/xhtml"):

<!-- Super-Paragraphs -->
<template match="html:ps[.//html:ps]" priority="2">
 <html:section>
  <copy-of select="@*" />
  <apply-templates />
 </html:section>
</template>

<!-- Ordinary Paragraphs -->
<template match="html:ps" priority="1">
 <html:p>
  <copy-of select="@*" />
  <apply-templates />
 </html:p>
</template>

<!-- Copy all other elements -->
<template match="*" priority="-1">
 <copy>
  <copy-of select="@*" />
  <apply-templates />
 </copy>
</template>

Yours,
Daniel Kraft
Received on Tuesday, 21 December 2004 21:45:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:16:01 GMT