xsl-list
[Top] [All Lists]

[xsl] Is the context node accessible from within a called template ?

2017-08-01 10:30:56

I have a pattern-matching template which calls (ie with call-template) a named 
template.  Although there is of course a context node that is valid throughout 
the pattern-matched template it isn't clear whether it remains accessible from 
within the called template.  Can someone please tell me whether it is or not?  
I'm sure when I was working on something a while ago I concluded that it is 
accessible, but now it isn't happening.  I'm not sure whether I've got the 
addressing wrong or whether I've misremembered and it is not in fact possible.



I have XML data that contains elements like this :
<symbol name="sysORIndex">
<table-object entry-name="sysOREntry" sequence-name="SysOREntry" 
table-name="sysORTable"/>
<object-type max-access="not-accessible" status="current">
...
</object-type>
</symbol>

Sometimes the table-object is not present.

My main XSLT template starts:
<xsl:template match="symbol/object-type" mode="slotmap">

Within that I can use "../table-object" to access the table-object element.

That template calls another:
  <xsl:call-template name="insert">
<xsl:with-param name= ... />

Within "insert" should I be able to use "../table-object" to access the 
table-object element?

Actually there is another level, as "insert" calls another:
  <xsl:call-template name="integer-template-param" >
<xsl:with-param ... />

Does that make a difference ?  I'd have thought that either the original 
context node would be accessible from all levels of called templates, or none.


Regards,
Richard.

I'm using XSLT version 2, with Saxon 9.8.0.3.




[Blue line]
Richard Kerry
BNCS Engineer, SI SOL Telco & Media Vertical Practice
T: +44 (0)20 3618 2669
M: +44 (0)7812 325518
4 Triton Square, Regent’s Place, London NW1 3HG
richard(_dot_)kerry(_at_)atos(_dot_)net<mailto:richard(_dot_)kerry(_at_)atos(_dot_)net>

[Atos logo]
This e-mail and the documents attached are confidential and intended solely for 
the addressee; it may also be privileged. If you receive this e-mail in error, 
please notify the sender immediately and destroy it. As its integrity cannot be 
secured on the Internet, the Atos group liability cannot be triggered for the 
message content. Although the sender endeavours to maintain a computer 
virus-free network, the sender does not warrant that this transmission is 
virus-free and will not be liable for any damages resulting from any virus 
transmitted.</
Atos, Atos Consulting, Worldline and Canopy The Open Cloud Company are trading 
names used by the Atos group. The following trading entities are registered in 
England and Wales: Atos IT Services UK Limited (registered number 01245534), 
Atos Consulting Limited (registered number 04312380), Atos Worldline UK Limited 
(registered number 08514184) and Canopy The Open Cloud Company Limited 
(registration number 08011902). The registered office for each is at 4 Triton 
Square, Regent’s Place, London, NW1 3HG.The VAT No. for each is: GB232327983.

This e-mail and the documents attached are confidential and intended solely for 
the addressee, and may contain confidential or privileged information. If you 
receive this e-mail in error, you are not authorised to copy, disclose, use or 
retain it. Please notify the sender immediately and delete this email from your 
systems. As emails may be intercepted, amended or lost, they are not secure. 
Atos therefore can accept no liability for any errors or their content. 
Although Atos endeavours to maintain a virus-free network, we do not warrant 
that this transmission is virus-free and can accept no liability for any 
damages resulting from any virus transmitted. The risks are deemed to be 
accepted by everyone who communicates with Atos by email.
--~----------------------------------------------------------------
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>