Re: [TFUI] XML -> XSLT -> XHTML Nirvana
Cory Foy <Cory.Foy-3E03uoa5e7nqlBn2x/[email protected]>
| Newsgroups | gmane.comp.programming.test-first-user-interfaces |
|---|---|
| Message-ID | <[email protected]> |
Phlip wrote:
> Cory Foy wrote:
>>Forgive me for being a little naive - but what does creating an if
>>statement inside XSLT look like to you? I agree that when you want an
>>*else* - therefore you have to use the monolithic xsl:choose - it is
>>nasty, but if has always seemed fairly straightforward to me.
>
> A wooden sailing ship uses several miles of rope. Some of that rope is
> "fixed rigging". You are not supposed to untie or move it during normal
> operations. The rest is "running rigging", which you untie, pull, and retie
> to change your sails' configurations.
>
> Maybe what I'm looking at is the idea of putting all the fixed HTML markup
> into XSLT, and the running HTML, which changes under logic, into encoded
> fields in the XML.
I personally like the idea of having business logic not be in the XSLT.
The only gotcha I can see is the situation I'm in where I have to
dual-develop for HTML and WAP, so I have to make sure that my business
logic does not push any presentation logic at all, or else my (WAP
mostly) views will not be happy at all.
I'll admit, I haven't had a chance to read the book yet, and no one
around here has it, so I'll have to order it off Amazon. And also, my
XML is a bit rusty. But my objection would be that you are actually
outputting a /span/ tag into your XML (data), instead of something that
signifies that you need to do something with it in your XSLT.
So maybe, using your fictitious Perl again:
set($myNode,
'my_data_name',
'<highlight color="hotpink">my data value</highlight>');
Which is where something like that probably belongs, and makes me see
exactly why you moved it up to your app. You are specifying that this
data is special, and should be treated as such when processed.
Again, I don't know your XSLT, but you could either then have a function
or have a preprocessing XSL that transforms all of the /highlight/s to
/span/s inserting the background-color: string as well, keeping your
view logic where it belongs, your XSLT.
This way, if you ever did need to transform for WAP pages, or whatever,
you could simply have your preprocessor XSL strip all the /highlight/s
since they may not be relevant on the phone.
Cory
To unsubscribe, email:
TestFirstUserInterfaces-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/TestFirstUserInterfaces/
<*> To unsubscribe from this group, send an email to:
TestFirstUserInterfaces-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/