future meetings, more on XSL

Darren Duncan darren at DarrenDuncan.net
Fri Sep 20 00:48:04 CDT 2002


Hello.  I have a few follow-up tidbits after today's meeting.

First of
all, I wanted to let you know that thursdays work best for me for future
meetings (today it was a coincidence), transportation-wise.  That is,
since I normally travel by bus and I would take a 70 to somewhere near the
Swartz Bay ferry terminal, I would have to leave down-town at 8:40 or
earlier, meaning leaving UVIC at about 8:00pm or earlier.  If we had a
meeting some other day of the week than thursday we would need to have it
an hour earlier (6-8), or I would leave half-way through at 8:00pm.  But
on thursday a family member who drives has their own event to attend that
is also at UVIC and between 7 and 9.  So if we meet thursday I can ride
with them in and out as I did today.  So as long as this is the case I
recommend we keep to thursdays where possible.

On the second issue, regarding my recommendation about using XSL and DOMs
to solve a problem and have it last for the long term, let me also add
that besides the normal control structures like conditionals and loops,
XSL also supports function-like reusable constructs called templates.  But
templates don't just have to be called by name.  They can also be called
automatically when certain data is encountered.  For example, if you have
a set of DOM nodes representing form fields, you can simply say
"call-templates" on the node list, and appropriate templates would be
called automatically.  The trick is just to define a template as saying
"match on varname having value or matching pattern".  So you could define
a template for each form field type and it is automatically called when a
field of that type is to be made, as defined in your field metadata node
list.  Yes, XSL is quite powerful.  And you're saved having to parse the
XSL/XML yourself.  As for the DOM, given its tree structure, nodes keep
the best of arrays and hashes rolled into one.  Any node can have any
number of node children; the node names are like hash keys, but you can
have multiple siblings with the same name; all nodes have an order with a
first child/sibling and subsequent ones in order.  DOMs are also easy to
serialize and deserialize (they are simply parsed XML), without any manual
work from you.  Each node can have any number of attributes.

That's all for now.

-- Darren Duncan




More information about the Victoria-pm mailing list