Web Development with XML Workshop Day 2
May 23rd, 2007 by Karen
Day 2 of this workshop had us spending the morning focusing on XML-Schemas some more. We had the opportunity to markup a document in light of a particular schema, which was enlightening but not something I’d likely do as part of my job.
The afternoon session focused on XSLTs. Most of this was review for me. However, there were a few little tricks that I learned. One of them involved how to get data into an HTML attribute. Let’s say you want to create an email link.
You can’t do this: <a href=”mailto:<xsl:value-of select=”email”/>”><xsl:value-of select=”email”/></a> - it isn’t valid. You can’t put angle brackets within angle brackets.
The way I was taught to solve this was quite cumbersome. So I’m not going to show it. Instead, what I learned in the class is that you can solve this problem by doing this: <a href=”mailto:{email}”><xsl:value-of select=”email”/></a> . This is a simple slick way to get the job done. For more information about it check out section 5.6 of the XSLT 2.0 specification (it is section 7.6.2 in the XSLT 1.0 spec).
The refresher on predicates was also helpful to me because I often have a need for this type of node selection but it is something that my previous XML class didn’t focus enough on.
Today is more advanced XSLT in the morning and then XML in Libraries, eXist, and the beginnings of XQuery in the afternoon. I’ve super excited about the next two days because these topics are the ones I know the least about.

