Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 17th, 2010, 05:12 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Look up Jeni Tennison on Muenchian Grouping for an explanation of this XSLT 1.0 coding pattern.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old April 19th, 2010, 05:10 PM
Registered User
 
Join Date: Apr 2010
Posts: 8
Thanks: 4
Thanked 0 Times in 0 Posts
Default

I read Jeni's article on Muenchian Method and it makes sense, however, I am having trouble understanding why Martin uses concat and how the namespace-uri() with curly braces is being used.

Im sorry if this question has an obvious answer, I'm still very new at XSLT.

Thanks
 
Old April 20th, 2010, 08:50 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

I used concat on the namespace uri and the local name for the key value to make the XSLT 1.0 solution as close as possible to the XSLT 2.0 solution which groups on node-name(.). In an XML input document without any namespaces or with elements from only one namespace it would suffice to group (XSLT 2.0) or key (XSLT 1.0) only on the local name of elements but in general it is possible to encounter two elements of the same name but from a different namespace. In that case node-name(.) in XSLT 2.0 allows you to distinguish them but the function node-name is new in XSLT/XPath 2.0 so you can't use it with XSLT 1.0. Therefore I concatenated namespace uri and local name to make the posted solution capable of distinguishing two elements with the same local name but from different namespaces. The curly braces are used as that is an established notation (Clark notation I think) to represent a qualified name consisting of a namespace uri and a local name in one string.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog





Similar Threads
Thread Thread Starter Forum Replies Last Post
Simplifying XML parents [XSLT] FrozenGrapes XSLT 2 April 13th, 2010 06:02 PM
SIBLING RECURSION - REVISITED pallone XSLT 7 December 4th, 2009 11:25 AM
Want to Pull multiple following-sibling data to preceding-sibling element sameer_kadam XSLT 4 May 9th, 2009 08:07 AM
having issue printing child values by comparing parents value eruditionist XSLT 4 January 7th, 2009 02:34 AM
MDI Sibling calling Sibling... Nick.Net VB.NET 2002/2003 Basics 1 December 8th, 2003 09:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.