RE: [xsl] More newbie questions

Subject: RE: [xsl] More newbie questions
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 22 Mar 2005 08:52:02 -0000
> I tried assigning the value to a variable with
> xsl:variable, but the transformation fails. Any help
> appreciated...

Show us what you did, and we'll tell you where you went wrong.

You don't really need a variable here: you can get the value by navigation.
Depending where you are when you start, an expression like
ancestor::Response/preceding-sibling::Database/@DatabaseName should do the
trick.
> 
> 2- How would I create multiple CITY tags in the output
> when faced with a response like that in record # 2,
> where the value is Toronto, Montreal?  I don't want a
> comma separated value in the body of the tag.

XSLT 2.0 has a tokenize() function. The EXSLT library of extensions, and
also the FXSL library, have library routines to do the same job. If you want
to code it yourself in XSLT 1.0, you need to learn how to write recursive
templates.
> 
> 3- You may have noticed the escaped angle brackets for
> the HTML tags in the TEXT tag value. How do I have them
> display properly? I played with the output="html" and
> the escape attribute to no avail.

It would be better not to generate them like that. Check the options
available for extracting XML from your database.

Michael Kay
http://www.saxonica.com/

Current Thread