xsl-list
[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-18 11:32:11
Hi Graydon,

Thanks for your tips. Could elaborate on this please? As I mentioned
before, I'm an amateur when it comes to this stuff.

From my perspective, it's not really a map merge. I'm just using the
map as the source of truth for what a given reference resolves to.
That just could be my vague interpretation of things. The style sheet
I've put together almost accomplishes what I am attempting. The
problem is I guess, as you say, I am attempting to "construct
references of references to arbitrary depth." Is it really that
difficult to extend what I have put together to process all the cross
references in the way I desire?

I am prepared to re-write my style sheet as necessary. However, I
played around a bit with what you suggested but I am apparently
missing something because I was unable to come up with anything that
made sense.

Thanks,
Jason

On Mon, Dec 15, 2014 at 6:48 PM, Graydon graydon(_at_)marost(_dot_)ca
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
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
children.

[snip]

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>