This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
select="..." expressions in XSLT
- From: "Knebels, Francis" <francis_knebels at merck dot com>
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 20 Dec 2001 11:34:23 -0500
- Subject: [xsl] select="..." expressions in XSLT
- Reply-to: xsl-list at lists dot mulberrytech dot com
I'm trying to get this XSL to work, but it is not giving me the output I'm
looking for. The XSL looks like this:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template
match="/"><xsl:copy-of select="/campaign/question[@start-date
<=20011220<=@end-date]"/>
</xsl:template>
</xsl:stylesheet>
(the 20011220 can be replaced with any date in the form CCYYMMDD.)
When I run this, I don't just get the nodes (and children of the nodes) in
the specific date range. I only get ones where the end-date is greater than
or equal to the 200011220. I've searched the internet for examples if this
can even be done, but I haven't seen anything on compound expressions in
XSL. The only thing I can think of doing as an alternative would be to
split the expression and run one transform. then make the output a
well-formed document and then run the second part of the transform as a
second stylesheet.
The XML I'm trying to transform looks like this:
<campaign name="some_survey" type="SURVEY">
<question questionid="470" text="blah blah blah" ans-type="RADIOBUTTON"
max-responses="1" week-of="10/01/2001" start-date="20011001"
end-date="20011007" total-answered="0" respondents="0">
<answer answerid="1982" text="answer one" sequence-nmbr="1"
total-answered="0"/>
</question>
<question questionid="471" text="question 2" ans-type="MULTISELECT"
max-responses="8" multiple-answers="Y" week-of="10/08/2001"
start-date="20011008" end-date="20011014" total-answered="34"
respondents="17">
<answer answerid="1988" text="answer 1" sequence-nmbr="1"
total-answered="1"/>
</question>
Can this be done as above with other syntax? I tried <xsl:if> and I
couldn't get that to work either.
Francis X. Knebels
Merck Vaccine Division
WP97-3W507
215.652.7710
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list