[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Can I see the main DOM from a doc() DOM?


Subject: Re: [xsl] Can I see the main DOM from a doc() DOM?
From: "Wendell Piez wapiez@xxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 10 Jun 2015 21:35:29 -0000

Hi Craig:

To reiterate and summarize Ken's excellent advice, your solution
includes any or all of:

1. Variables - bind global variables to your respective trees and you
can always get from one to the other;

2. Tunnel parameters - a very powerful way of passing "context" or
"calling state" through a chain of templates (of arbitrary depth), so
there when you need it, e.g. recalling a 'home' node;

3. Keys - permit accessing arbitrary nodes across system boundaries
(including document boundaries), given any associations (value or
context-based) of interest.

Enjoy,
Wendell


On Wed, Jun 10, 2015 at 3:59 PM, Craig Sampson craig.sampson@xxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> Hi All,
>
>   I am working on a transform that merges a second input (xml) file with
the
> primary input (xml) file to create one deliverable. I am accessing the
> second input file using the doc() function.
>
>   Is there a way to look up from the second input file to see attribute
> values in the first input file?
>
>
>
> Herebs a snippet of the primary input file:
>
>
>
> <refBody>
>
> <refActionSet actionSet="cas.tkcastab" eid="p19uxflykz04i4n166yzdl1o5osr">
>
> <exampleBlock eid="n1nw8ix56o1qx5n1t8woivgwje9g">
>
> <example eid="p0pzu6eop12af6n1j7dnjo7ripkd">
>
>
>
>
>
> Herebs a snippet of the second input file:
>
>
>
> <actionSet id="cas.tkcastab" name="tkcastab" scriptname="tkcastab"
> prmname="tkcastab">
>
>   <label id="cas.tkcastab.__label" key="TKCASTAB_LABEL_LIBRARY">Tables and
> Files</label>
>
>   <action id="cas.tkcastab.view" name="view" entry="View">
>
>     <label id="cas.tkcastab.view.__label" key="TKCASTAB_LABEL_VIEW">Create
> View</label>
>
>     <desc id="cas.tkcastab.view.__desc" key="TKCASTAB_DESC_VIEW">Define a
> view from files or tables</desc>
>
>
>
> When I am in the action template I want to get the exampleBlockbs eid
value.
> I get to the action when the refActionSet element in the primary input file
> is being processed by its template. The template contains the following:
> (note: the second file is in the bcasb namespace)
>
>
>
> <xsl:variable name="myActionSet"
> select="doc(concat('file:',translate($casFile,'\','/')))"/>
>
> <xsl:apply-templates select="$myActionSet/cas:casActions">  <!-- in
> xisActionSet.xsl -->
>
>   <xsl:with-param name="actionSetID" select="@actionSet"/>
>
> </xsl:apply-templates>
>
>
>
> I tried to get the exampleBlock eid value from the action template using:
>
>
>
> <a href="{ancestor::refActionSet/exampleBlock/@eid}.htm">
>
>
>
> But got nothing. If it isnbt possible (doc is a function after all) to
look
> up to the parent xml I can always pass the attribute value as a parameter
> from the refActionSet template.
>
>
>
> Thanks,
>
>   Craig
>
>
>
> BTW I see the list in the digest view so I wonbt see any responses till
> tomorrow unless you include my email in your response to the list.
>
> craig.sampson@xxxxxxx
>
>
>
>
>
> XSL-List info and archive
> EasyUnsubscribe (by email)



--
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^


Current Thread
Keywords