Subject: Re: [xsl] Can I see the main DOM from a doc() DOM? From: "G. Ken Holman g.ken.holman@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Wed, 10 Jun 2015 20:55:19 -0000 |
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?
Here's a snippet of the primary input file:
<refBody> <refActionSet actionSet="cas.tkcastab" eid="p19uxflykz04i4n166yzdl1o5osr"> <exampleBlock eid="n1nw8ix56o1qx5n1t8woivgwje9g"> <example eid="p0pzu6eop12af6n1j7dnjo7ripkd">
Here's 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 exampleBlock's 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 "cas" 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 isn't 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 won't see any responses till tomorrow unless you include my email in your response to the list.
<mailto:craig.sampson@xxxxxxx>craig.sampson@xxxxxxx
<http://www.mulberrytech.com/xsl/xsl-list>XSL-List info and archive
<-list/96802>EasyUnsubscribe (<>by email)
-- Check our site for free XML, XSLT, XSL-FO and UBL developer resources | Free 5-hour lecture: http://www.CraneSoftwrights.com/links/video.htm | Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ | G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx | Google+ profile: http://plus.google.com/+GKenHolman-Crane/about | Legal business disclaimers: http://www.CraneSoftwrights.com/legal |
--- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Can I see the main DOM from a, Craig Sampson craig. | Thread | Re: [xsl] Can I see the main DOM fr, Wendell Piez wapiez@ |
[xsl] Late-breaking News for Balisa, Tommie Usdin btusdin | Date | Re: [xsl] Can I see the main DOM fr, Wendell Piez wapiez@ |
Month |