11/4 I'm having a problem formatting inline elements in xsl-- I have to
handle the situation where
<school>I graduated from
<link href="<DEAD>www.berkeley.edu"<DEAD>Cal</link> in 1998.
</school>
My current template is like this:
<xsl:template match="school">
<xsl:apply-templates/>
</xsl:template>
But the this causes the space after "Cal" to be ignored, rendering
"I graduated from Calin 1998." (with Cal appropriately hyperlinked)
How do I solve this? -mjm
\_ Don't know how well this would work, but you could try
<xsl:preserve-space elements="school"/>
That might be a little overzealous, though. -geordan
\_ I tried that, no luck. It seems like this would be a problem
common to any inline element, but I haven't seen a good
solution yet. -mjm
\_ You're seriously doing your resume in XML? Trust Motd Wisdom on
this: no one cares what format your resume is in.
\_ The example was fictitious but representative.
\_ You never heard of XML Resume? Let's you create text, html
and pdf resumes w/ ease. Also, lets you create different
resumes based on where you are applying (e.g. C vs. Java
resume). -!mjm
\_ It also allows you to demostrate that you know XML/XSLT
when applying for XSLT jobs.
\_ No one cares. Your text only resume is going to a bimbo
in HR who doesn't know anything about anything and is only
scanning for keywords off a list. Your resume is not the
place to demonstrate your madly kewl hx0r skillz. As an
alum who has "been there, done that" in the job market and
Not sure why it would make any difference.
has had no problems getting new and very high paying jobs
during a down economy I think I might be in a good position
to tell you this and be right.
\_ How high is very high? -alumnus looking for job.
\_ My page comes up correct with the space and I use this:
<xsl:template match="school">
<a href="{@href}">
<xsl:apply-templates/>
</xsl:template>
Not sure why it would make any difference; perhaps it's not
the syntax but rather a bug in the transformer you use.
\_ This will linkify the entire sentence, won't it?
\_ Err...no, it only does so for the school element. |