[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: InnerXml is like printf (WAS: Underwhelmed)


innerxml
Arjun Ray wrote,
> My main concern has always been well-formedness.  Validation is an
> extra which I'm willing to forego in some circumstances, e.g. where
> the coders do have familiarity with the vocabulary/ies.

Cool. So take a closer look at my strawman. Using an XPath-derived 
string template syntax it ought to be possible to ensure well- 
formedness.

InnerXml _is_ printf ... but that doesn't mean we couldn't have 
something analogous to printf which has its nice features (domain- 
specific little language) without the risk of non-well-formedness.

And that's likely to be a win, even in comparison with,

>     hf.aHtml(
>         hf.aHead(
>             hf.aTitle( "Example 3" )).add(
>             hf.aLink( )
>                 .wRel( "stylesheet" )
>                 .wType( "text/css" )
>                 .wHref( new Uri( "/ss/style.css" )))).add(
>         hf.aBody(
>             hf.aP( "Hello World!" ))).accept( printer ) ;

because we don't have to fight with Java's syntax. How about this 
mish-mash of XPath and s-exprs,

  Element e =
    new Element(
      "html/("+
        "head/("+
          "title/text(%0),"+
          "link[@rel='stylesheet',@type='text/css',@uri=%1]),"+
        "body/text(%2))",
      { "Example 3", "/ss/style.css", "Hello World" } );

  (again assuming concise array literals).

It's not clear to me that an HTML-specific library provides any great 
benfits in either safety or readability. And if it supports all of HTML 
4.01 it's going to be large ... and obviously applicable only to HTML.

Oh, and BTW: Hungarian notation is an abomination ;-)

Cheers,


Miles

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.