- From: T. V. Raman <tvraman@us.ibm.com>
- Date: Tue, 21 Dec 2004 08:23:17 -0800
- To: Rotan.Hanrahan@MobileAware.com
- Cc: Norman.Walsh@Sun.COM, public-xml-core-wg@w3.org
In general, having the ability to use AVTs (Attribute Value Templates) anywhere in XML -- rather than just in XSLT would be a huge win for a lot of use cases. >>>>> "Rotan" == Rotan Hanrahan <Rotan.Hanrahan@MobileAware.com> writes: Rotan> Thank you Norman. I am copying to DIWG. Your mention Rotan> of XSLT is in keeping with a recent update to this Rotan> issue in which "Attribute Value Templates" is proposed Rotan> for consideration. I'm sure we shall return to this Rotan> complex issue after the holidays. Rotan> Rotan> Regards, ---Rotan. Rotan> Rotan> -----Original Message----- From: Norman Walsh Rotan> [mailto:Norman.Walsh@Sun.COM] Sent: 21 December 2004 Rotan> 16:01 To: public-xml-core-wg@w3.org Cc: Rotan Hanrahan Rotan> Subject: Re: FW: XInclude use case for Device Rotan> Independence Rotan> Rotan> Rotan> / Paul Grosso <pgrosso@arbortext.com> was heard to Rotan> say: | With permission, I am forwarding this to the Rotan> XML Core WG | mailing list. Please include Rotan Rotan> Hanrahan on the cc line | in any replies. Rotan> Rotan> Sigh. This is really a question of the processing Rotan> model which has no home since it was removed from the Rotan> Core WGs charter. Rotan> Rotan> | I'm reporting on an idea and a "difficulty" related Rotan> to XInclude from the | DIWG, and I'm seeking some Rotan> comments from people more familiar with the | use and Rotan> direction of XInclude, which I will subsequently Rotan> report to DIWG. | | At a DIWG face-to-face some weeks Rotan> ago, the possibility of using XInclude | with DISelect Rotan> [1] was discussed. This presents an interesting use Rotan> case | whereby DISelect provides a content negotiation Rotan> function, and XInclude | acquires the content selected Rotan> via DISelect. | | Among the many illustrative cases, Rotan> we considered the following: | | <?xml version='1.0'?> Rotan> | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Rotan> Strict//EN" | Rotan> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | Rotan> <html | xmlns="http://www.w3.org/1999/xhtml" Rotan> xml:lang="en" lang="en" | Rotan> xmlns:xi="http://www.w3.org/2001/XInclude"> | Rotan> xmlns:sel="http://www.w3.org/2004/CSelection"> | Rotan> <head><title>News</title></head> | <body> | <h1>Top Rotan> Story</h1> | <sel:select> | <sel:when Rotan> sel:expr="dc:cssmq-width('px') > 200"> | Rotan> <xi:include Rotan> href="/full_story.xyz?date=EXPRESSION_GOES_HERE"/> | Rotan> </sel:when> | <sel:otherwise> | <xi:include Rotan> href="/small_story.xyz?date=EXPRESSION_GOES_HERE"/> | Rotan> </sel:otherwise> | </sel:select> | </body> | </html> | Rotan> | In this case we used DISelect to choose a suitable Rotan> version of a news | story. The selection is based on Rotan> the pixel width of the screen similar | to the Rotan> approach used in CSS Media Queries. This is a simple Rotan> template | mechanism. However, the href of the Rotan> XInclude requires a parameter to be | passed to the Rotan> process. We have illustrated this as a "date" value | Rotan> determined by an expression. We have considered the Rotan> possibility of using | XPath expressions within the Rotan> href attribute, but currently the XInclude | proposal Rotan> only supports escaping of characters. It does not Rotan> support any | form of "evaluation" of the href. | | Rotan> Can you advise on any alternative strategy that might Rotan> be adopted to | facilitate the passing of evaluated Rotan> parameters to URLs referenced by | XInclude markup? Rotan> Rotan> I don't think there's anything you can do to get Rotan> XInclude to perform any evaluation for you. That's Rotan> just a URI as far as its concerned. Rotan> Rotan> It seems to me that you need some other step in your Rotan> processing model to perform the evaluation and that Rotan> step can finess XInclude. Rotan> Rotan> Consider the following: Rotan> Rotan> <?xml version='1.0'?> <!DOCTYPE html PUBLIC Rotan> "-//W3C//DTD XHTML 1.0 Strict//EN" Rotan> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Rotan> <html xmlns="http://www.w3.org/1999/xhtml" Rotan> xml:lang="en" lang="en" Rotan> xmlns:xi="http://www.w3.org/2001/XInclude"> Rotan> xmlns:sel="http://www.w3.org/2004/CSelection" Rotan> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" Rotan> xmlns:fn="http://www.w3.org/2004/10/xpath-functions" Rotan> xsl:version="2.0"> <head><title>News</title></head> Rotan> <body> <h1>Top Story</h1> <sel:select> <sel:when Rotan> sel:expr="dc:cssmq-width('px') > 200"> <xsl:element Rotan> name="xi:include"> <xsl:attribute name="href" Rotan> select="concat('/full_story.xyz?date=', Rotan> fn:current-date())"/> </xsl:element> </sel:when> Rotan> <sel:otherwise> <xsl:element name="xi:include"> Rotan> <xsl:attribute name="href" Rotan> select="concat('/small_story.xyz?date=', Rotan> fn:current-date())"/> </xsl:element> </sel:otherwise> Rotan> </sel:select> </body> </html> Rotan> Rotan> If you run that through an XSLT processor then run the Rotan> result document through an XInclude processor, you'll Rotan> get the result you want. Rotan> Rotan> Alternatively, you could invent an expression language Rotan> and say that your processing model is: load the Rotan> document with XInclude suppressed, evaluate the Rotan> expressions, and then apply an XInclude processor. Rotan> Rotan> | One alternative proposed at the meeting was an Rotan> extension to DISelect | that would mimic (or map to) Rotan> XInclude but would permit XPath expressions | to Rotan> create the href attribute value. This would, however, Rotan> create a new DI | variant of XInclude and we would Rotan> need to keep the DI version of XInclude | in step with Rotan> the official version of XInclude. This idea does not | Rotan> attract much support, so we are seeking advice on how Rotan> to proceed. Rotan> Rotan> If you decide to go that route, I think you should Rotan> probably define the semantics along these lines: AVTs Rotan> in the di:include element are evaluated and then the Rotan> element is renamed xi:include and processed per normal Rotan> XInclude processing. But it's definitely ugly. Rotan> Rotan> | Any advice or guidance you can offer us would be Rotan> most welcome, and feel | free to share this request Rotan> with whoever you deem may be best suited to | offer Rotan> support. Rotan> Rotan> As near as I can tell, you're going to have to come to Rotan> grips with some sort of processing model that allows Rotan> you to either create xi:include elements or load them Rotan> without processing them and then process them. Rotan> Rotan> Be seeing you, Rotan> norm Rotan> Rotan> -- Norman.Walsh@Sun.COM / XML Standards Architect / Rotan> Sun Microsystems, Inc. NOTICE: This email message is Rotan> for the sole use of the intended recipient(s) and may Rotan> contain confidential and privileged information. Any Rotan> unauthorized review, use, disclosure or distribution Rotan> is prohibited. If you are not the intended recipient, Rotan> please contact the sender by reply email and destroy Rotan> all copies of the original message. -- Best Regards, --raman ------------------------------------------------------------ T. V. Raman: PhD (Cornell University) IBM Research: Human Language Technologies Architect: RDC --- Conversational And Multimodal WWW Standards Phone: 1 (408) 927 2608 T-Line 457-2608 Fax: 1 (408) 927 3012 Cell: 1 650 799 5724 Email: tvraman@us.ibm.com WWW: http://almaden.ibm.com/u/tvraman AIM: TVRaman GPG: http://www.almaden.ibm.com/cs/people/tvraman/raman-almaden.asc Snail: IBM Almaden Research Center, 650 Harry Road San Jose 95120
Received on Tuesday, 21 December 2004 16:23:46 UTC