Re: [xsl] XSL resources - Flat to hierarchy - Common ancestors

Subject: Re: [xsl] XSL resources - Flat to hierarchy - Common ancestors
From: "M. David Peterson" <m.david@xxxxxxxxxx>
Date: Tue, 27 Jul 2004 09:56:21 -0600
Hey Ben, I wish I had the time to help you further today but if you take a look at the release schedule for today,, you will easily see why time is something I am in short supply of at the moment...


If there is anybody who is as capable and respected as David Carlisle is in the XML transformation community and XML community as a whole (Mr. MathML -- this Google link should help you better understand who you are dealing with, or better said who you are fortunate enough to have your questions answered by -- it would only be the likes of Michael Kay, Dave Pawson, Jeni Tennison, Wendell Piez, Elliot Rusty Harold, or a handful of the other members of the whos-who in the XML/XQuery/XPath/XML Schema/XSLT/X** world that frequent this list...

Youre in good hands my friend...

Once again, best of luck with your crash course in XSLT that you seem to be handling quite well... Very impressive!

And dont forget to smile and have fun with it! :)



David Carlisle wrote:

1) do the nodes returned by ancestor-or-self retain their hierarchy?

If you mean what I think, then yes. Nodes live in the input tree and have the same parents children etc however they are selected.

< 2) when I do an apply templates on ancestor-or-self, do they 'remember'

the rest of the document, ie. Can the called template access their
children etc.?

yes, see above

3) Why do I need the ::Menu?

when you go select="foo" it is short for seelct="child::foo" and selects
the foo children of wherever you are. If that's notthe direction you
want to go, you head in another direction around the tree with another
axos eg select="following-sibling::foo" selects siblings instead of
children. Since yor posted code was child::Menu the short answer to your
question is: you don't need it.

4) Why does child::Menu seem to return all the descendants and not just
the first generation?

It doesn't it just selcts the children.
but you have copy of and copy of on an element node copies the entire
branch rooted at that node. If youjust want a "shallow" copy that gets
that element but none of its children ise xsl:copy.


This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

Current Thread