Month: July 2004

XSLT 2.0

The xml summer school is over. i attended talks by jenni tennison and michael kay on xslt 2.0. herewith my rough notes. hopefully they prove useful for someone, even in their rough form.
jenni tennison on xslt 2.0

grouping in sequence: paging in xslt
<xsl:for-each select=”paper” group-starting-with=”paper[position() mod10= 1]”>
<xsl:result-document href=”papers{position()}.html”>
result-element for writing multiple documents
it is possible to access these documents via the href URI (say, from another stylesheet)
stored relative to “base output URI”
implications: no more muenchian grouping!
easier to create indexes, summaries, pagination
xsl functions can be replacements for named templates.
functions for atomic values, named templates for mixed content
xslt 2.0 supports xml 1.1 namespace undeclarations
character substitution to create non-wellformed output. map <%@ mapping to unicode
private area:
@ page language =
unfortunately, all this won’t matter so much since microsoft will not support xslt 2.0
what is xsl:sequence??
squences in xpath 2.0
everything is a sequence, like nodeset() but ordered
implication: much less need for recursive templates, less need for temporary elements
xslt 2.0 doesn’t need the result set extension anymore, results are temporary trees
this means complex transformations can be broken up into multiple steps
create a text node from a sequence:
<xsl:value-of select=”author/surname” separator=”, “/> thomson, tobin
xsl:unparsed-text() similar to document(), but for text nodes.. interesting for includes
parameter changes:
tunnel params: set param high up in the call stack, us it low down, without passing it through explicitly
required param: error if value isnt provided
xsl:next-match calls template that would have matched if the current wouldn’t have been there
match=”a[@id=

xsl:next-match
match=”a”
…¨
using schemas / types may make things easier, not using them may make things harder.

michael kay on schema support in xslt 2.0

much more robust code. put validation into xslt
sequence of strings: multiple lines of text, is not an xml document
for-each select=$lines
“find it useful to always declare types” for debugging
performance?
4 different grouping functions:
group-by
group-adjacent
group-starting-with
group-ending-with
eq was introduced as a simplified = for performance reasons (it only matches once)
, in select? -> , concatenates sequences. is not an OR
select=”current-group() except .” selects the current group except the context node.
except is new in xpath 2.0
this serves as terminating condition for recursive templates too 🙂
<xsl:result-document validation=”strict”> produces the output
concept of output-driven stylesheet versus input-driven. “how should the output look?” -> pull. “how does the input look?” -> push
new: union within xpath: /book/chapter|section/p
–> xsl validation points straight at the source of validation errors, no guesswork which
template produced the wrong output
-> but, when you build up, you want bigger picture. sometimes, turn validation off
input and output schemas
tip: use xsl:key for inverse relationships
“xsl functions are quite object oriented. they operate on the data structure”
if (data($date) instance of StandardDate)
-> convert to ISO. this allows to check for types. allows for fallback!!
standard date would be something like 200-05-03
there could also be: 200? may ??
or even “in the year the jakal ruled”
-> all are valid, but fallback

XML summer school

I will be speaking at XML summer school (wadham college, oxford, 30th july 2004) about the state of xml for end users. i will look at XML authoring and blogging as 2 areas where end users get in contact with XML. the talk will be followed by a panel discussion with andrew orlowski (the register), peter rodgers (1060.com) and steve pepper (ontopia.net), chaired by lauren wood (textuality). it’s bound to be interesting with panelists like these 🙂
2004-09-02:

I pulled together and chaired a day on “What’s Hot and What’s Not? which was extremely thought-provoking. I certainly came back with lots of ideas from it, and others who attended said the same.

Androscoggin


sarah has the details:

I met up with Gregor in the square, went to Falafel Palace for dinner, and retrieved Tabor’s car from his driveway. Thankfully, it was not blocked in. 4 hours later, we finally arrived at the Inn. High points of the drive: my gigantic iced mocha latte at the Dunkin Donuts off Exit 57 and getting stopped by a cop on a deserted stretch of Route 26.

“You ever been pulled over before in Maine?”
“Nope. Actually, this is my first time ever getting pulled over. Thanks! It’s pretty exciting.”

Not even a lie. He didn’t give me a ticket.

I slept very soundly. That’s a lot of driving for a non-driver. We got up for breakfast, looked at the 2-week-old (very expensive) puppies, and promptly went back to sleep until 2pm. I imagine we would have slept longer, had Mark not called my cell phone.

The original plan was to go kayaking, but we didn’t leave until 15:30 so that was right out. We went to Grafton Notch State Park instead, where I learned a valuable lesson: Never agree to a hike a section of the Appalachian Trail without reading a brochure. You don’t want to be 1 hour into into it before realizing, “Hey! It says ‘steeply climbs 300m,’ no wonder I’m so tired!” We let a family from Delaware pass us just short of the summit, and I made a lot of Stephen King references.

Thank god we stopped for road pie on the way. Sweet, delicious blueberry road pie.
After the hike, we met up with our hosts and went into Bethel to eat Korean/Japanese fusion. I got the curried duck with wasabi mashed potatoes and felt very Special and Important that we were seated after closing because aforementioned hosts know the owners. The chef’s girlfriend left him and went to Florida 3 months ago, but he claims to be over it.

During dinner, I heard the Greatest News That Ever There Was, namely: They’re transitioning from a straight B&B to a spa. Can’t hardly wait.

After dinner I had an unfortunate experience trying to light a fire in the stove outside (didn’t happen), so we spent some time in the hottub instead. Boy, Maine sure does have a lot of stars.

I slept very soundly that evening.

Sunday we managed to wake up at a reasonable hour, ate breakfast, packed and made it to the kayak rental shop by 12:45. This gave us just enough time to talk to one of the owners, get the discount Mr. Host so kindly arranged, get paddles and life vests and make it onto the 13:00 shuttle. We were deposited several km up the Androscoggin River and enjoyed 4 hours of paddling.

No moose were spotted.

Then back to the Inn for a homemade dinner. Thankfully Jordan is much better at lighting fires than I am, so I did get to enjoy s’mores before the long drive home, during which we accidentally managed to stop at the exact same Dunkin Donuts we hit on the way up.

Emailcrew

my friend doug is easing into his new role at MGM Mirage as technology coordinator for permission-based email campaigns. to this end, he created emailcrew.

EmailCrew.com aspires to be to email marketing professionals what A List Apart (ALA) is to web design professionals; a forward-thinking resource for the responsible yet effective design and distribution of content. Where ALA focuses on the browser, EmailCrew will focus on the email client and the tools and techniques used to deliver opt-in, permission-based, rich-media email campaigns.

it will be interesting to watch this one unfold with pundits declaring the death of email.

almost

i bought a ticket zrh-bos-zrh today only to learn that i will miss michi (who is coming to the us as i leave) when he comes back from australia on august 4th. i will leave on the same day.