Have u ever used <xsl:include>. How to include an xslt in another xslt ?

This question is related to Oracle Interview

Showing Answers 1 - 1 of 1 Answers

pravash

  • Jun 8th, 2005
 

An XSLT file can include another XSLT file using the element. The href attribute value is a URI reference identifying the file to be included. The relative URI is resolved with relation to the base URI of the element. 
 
The element is only allowed as the child of the element. 
 
note:::An error occurs if an XSLT file directly or indirectly includes itself. 
 
example:: 
----------- 
Including an XSLT file multiple times can cause errors because of duplicate definitions. Such multiple inclusions are less obvious when they are indirect. For example, A, B, C, and D are all XSLT files. Files B, C, and D include other XSLT files, as follows:  
 
B includes A. 
C includes A. 
D includes both B and C. 
 
Then, the XSLT file, D, will indirectly include the XSLT file, A, twice. You can avoid this error by separating everything in B (other than the inclusion of A) into a separate XSLT file, B1, and changing B to include B1 and A. Then, use this same approach on C and, finally, change D to include A, B1, C1. 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions