[Top] [All Lists]

Re: [xsl] Want to process child and decendent nodes the same way as parent node but can only process children

2014-12-15 20:48:12
On Tue, Dec 16, 2014 at 12:18:11AM -0000, Jason Davis 
nosaj3(_at_)gmail(_dot_)com scripsit:
I am currently trying to process multiple files for specific nodes and
collect them in a meaningful way to demonstrate the parent-child
relationship but I'm having trouble getting past the first level of


And believe me, I'm sure there are better ways to accomplish what I am
attempting. So, any insights or suggestions for improvement, better
efficiency, etc. are greatly appreciated. I'm pretty much an amateur
with XSLT. So, please let me know if I am missing anything.

This sounds like a DITA map-merge sort of problem.  The trick with
those is to recognize that your stylesheet will happily consume multiple
source documents, so you start at the "topmost" document and when you
get to the child documents you use

<apply-templates select="document(@href)"/> 

or similar to process the interesting child document referenced by the
@href  Then you make sure the templates -- maybe using modes -- are set
up to match only what you want in the result document.

In this application, you probably have to set up templates to ignore
what you don't want, but the trick is to move the context node into the
child documents as necessary.  It's not an initially natural way to
think but does get easier with practise.

This is much, much easier than trying to construct references of
references to arbitrary depth!

-- Graydon
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com

<Prev in Thread] Current Thread [Next in Thread>