Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Having Trouble With Condition For Default Nodeset Selection

From: "G. Ken Holman" <gkholman@-------------------->
To:
Date: 7/5/2006 1:10:00 AM
At 2006-07-05 10:49 +1000, Duncan Anker wrote:
On the use of "//",  the $currency-data comes
from a select="document(..)"  and so seems to be
required or I get no result set - although I can
probably fold the currency-data and codes into a
single select. Better pass me that mallet again. :)

When I teach my XSLT class I tell my students "if
you think you need //, think again because you
probably don't" because the use of "//" is the
biggest unnecessary hit on XSLT processing
*unless you really need to search each and every
descendent down each and every subtree of the
source node tree from the point where "//" is used*.

Note my emphasis.  I'm not saying it is evil ...
sometimes you really do need to search each and
every descendent ... but often you do not.  Many
new users of XSLT liberally use "//" thinking
that it will somehow stop at the items they are
looking for, not realizing that it goes below
anything it finds looking all the way to every
leave of every subtree looking for more of what is being looked for.

Perhaps you need something like "document(..)/*/codes".



For example, in UBL we are using code lists
expressed in genericode[1] and something like
"document(..)/*/SimpleCodeList/Row[Value/SimpleValue=$code]"
would be more efficient and less wasteful than
"document(..)//Row[Value/SimpleValue=$code]".

I hope this helps.



. . . . . . . Ken



--
Registration open for UBL training:    Montrial, Canada 2006-08-07
Also for XSL-FO/XSLT training:    Minneapolis, MN 2006-07-31/08-04
Also for UBL/XML/XSLT/XSL-FO training: Varo,Denmark 06-09-25/10-06
World-wide corporate, govt. & user group UBL, XSL, & XML training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent