|
Subject: RE: [xsl] [answered] collecting multiple tokenize() results into one sequence From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Thu, 24 Jul 2008 12:49:06 -0400 |
> How to clarify the error message? What about (borrowing > language from the above paragraph): > "Invalid initial / or // in path step: Cannot select the root > node of the tree that contains the context node, because the > context item is not a node."
One of the difficulties in designing run-time error messages is that it's dangerous to make assumptions about what constructs were used in the original source code, since the same run-time code can be produced from many different source code formulations.
However, there are many cases where Saxon saves information at compile time for use in the event of a run-time error, so that better diagnostics can be produced, and it might be possible to do the same here.
<!-- gather all tokens into one sequence of strings, then group
by identical strings -->
<xsl:for-each-group select="for $tags in //item/meta return
tokenize($tags, ',')" group-by=".">
<xsl:sort select="." /> <!-- alphabetical order -->
<h2><xsl:value-of select="."/>:</h2>
<ul>
<xsl:for-each select="//item[contains(meta, .)]">
<xsl:sort select="name"/>
<li>...
<xsl:for-each-group select="//item" group-by="tokenize(meta,',')">
<xsl:sort select="current-grouping-key()"/>
<h2><xsl:value-of select="current-grouping-key()"/>:</h2>
<ul>
<xsl:for-each select="current-group()">
<xsl:sort select="name"/>
<li>...Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] [answered] collecting mul, Michael Kay | Thread | Re: [xsl] [answered] collecting mul, Michael Müller-Hille |
| RE: [xsl] [answered] collecting mul, Michael Kay | Date | [xsl] Sum one attribute while group, DB |
| Month |