This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Mixed content variation
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: Mixed content variation
- From: "Fox, Michael" <michael dot fox at mnhs dot org>
- Date: Fri, 7 Apr 2000 15:59:55 -0500
- Reply-To: xsl-list at mulberrytech dot com
How does one identify the text node and some child nodes but not other child
nodes of an element with mixed content? I cannot formulate an expression
that works or find one in any FAQ.
Here's the situation:
<foo> is an element with mixed content.
It may contain text and/or any number of child elements such as <bar>,
<bob>, <betty>, and <date>
Text and children may appear in any sequence except that when <date> is
present, it is always last.
Examples
<foo>some text
<bar>some different kind of text</bar>
</foo>
<foo>
<bob>blah, blah, blah</bob>
<date>1975</date>
</foo>
Objective:
1. Select the text node and all child nodes of <foo> except for the <date>
child
2. if <date> is present, then
3. insert a comma and a space with <xsl:text>
4. select the child <date>
This would result in something like
Galley proofs of The Great Gatsby, 1932.
Numbers 2, 3, and 4 are easy. Number 1 has me stumped.
Any suggestions would be appreciated.
Michael
Michael Fox
Acting Assistant Director for Library and Archives
Minnesota Historical Society
345 Kellogg Blvd West
St. Paul MN 55102-1906
phone: 651-296-1014
fax: 651-296-9961
michael.fox@mnhs.org
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list