Michael Kay wrote:
oXygen complains that "Axis in pattern must be child or
attribute", meaning presumably that only element nodes, not
text nodes, can be selected using this axis.
No, it means what it says. You can use "//" in a pattern, but you can't use
the descendant axis, or any axis other than "child" or "attribute". It's an
irritating restriction when you hit it, but it doesn't come up sufficiently
often to have been fixed in 2.0.
What a strange restriction. I wonder what the reasoning behind it is.
Can anyone suggest how to go about selecting the first text
node which is a descendant of the p tag?
In 2.0:
p//text()[. is ancestor::p[1]/descendant::text()[1]]
In 1.0:
p//text()[generate-id(.) =
generate-id(ancestor::p[1]/descendant::text()[1])]
That works great -- it's exactly what I need. The whitespace issue isn't
a problem -- I stupidly pretty-printed my example without thinking,
trying to clarify the structure, but the original documents are clean.
Thanks to everyone for the helpful suggestions.
Cheers,
Martin
But most people, I think, end up doing the work at the apply-templates level
rather than in the match pattern.
Michael Kay
http://www.saxonica.com/
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--