W3C home > Mailing lists > Public > public-uwa@w3.org > December 2007

RE: URIs, content adaptation, DISelect and XSLT

From: Dave Raggett <dsr@w3.org>
Date: Tue, 11 Dec 2007 18:10:31 +0000 (GMT)
To: "Smith, Kevin, VF-Group" <Kevin.Smith@vodafone.com>
Cc: public-uwa@w3.org
Message-ID: <alpine.DEB.0.99.0712111801530.11214@ivy>

Comments inline

  Dave Raggett <dsr@w3.org> http://www.w3.org/People/Raggett

On Tue, 11 Dec 2007, Smith, Kevin, VF-Group wrote:

> A couple of observations:
> 1- identifiers. It appears that the author would still need to 
> indicate which selection expressions were appropriate for which 
> content. In the example:
>
>   <p>The flooding was quite extensive.</p>
>   <p sel:expr="dcn:cssmq-width('px') > 200">
>     <object src="image1" sel:selid="artimg42"/>
>   </p>
>   <p>Many people were evacuated from their homes.</p>
>
> Would be expressed in XSLT as
>
> <!-- leaving out the dcn function definition for brevity-->
> ...
> 1 <xsl:template match="p">
> 2  <xsl:copy><xsl:apply-templates /></xsl:copy>
> 3 <xsl:if test="dcn:cssmq-width('px') > 200">
> 4   <p sel:expr="dcn:cssmq-width('px') > 200">
> 5     <object src="image1" sel:selid="artimg42"/>
> 6   </p>
> 7 </xsl:if>
> 8 </xsl:template match="p">
> ...
>
> Line 1 matches on the context node for the paragraph, but in a 
> document with many paragraphs then we need to be more specific:
>
> By position -
> <xsl:template match="p[3]">
> ...but what if this is mutable, e.g. the content is aggregated 
> from multiple sources?

A simple approach is to use classes in the markup and select on 
those. The XHTML role attribute would be even better suited for this 
purpose. This assumes that people can come up with a vocabulary that 
matches their needs. It needn't be standardized, although there 
would be definite advantages for that, and perhaps we can think of 
it as a kind of microformat.

> 2- HTML well-formedness. XSLT requires the source infoset to be 
> well-formed, so there may be some minor tidy up needed by the 
> author. Of course, that's a good thing!

Yes that is a general problem when aggregating content and why it is 
better for your content management system to insist on XML rather 
than arbitrary tag soup. :)

HTML Tidy or an equivalent can be used to help when dealing with 
external input.

> I'll have a go at writing some tests and post to the group. Of course,
> we can continue with DIAL which has great merits when aligned with the
> IDEAL datatypes, but I can see that now becoming more of a CMS/device
> aware engine language, with this XSLT approach providing a quick,
> modular add-on to existing content markup.

Great, I will look forward to reading your posts.

All the best,

  Dave
Received on Tuesday, 11 December 2007 18:09:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 6 April 2009 12:37:21 GMT