XSLT <xsl:include> కార్యకలాపం
నిర్వచనం మరియు వినియోగం
<xsl:include> కార్యకలాపం టాప్ లెవల్ ఎలమెంట్ (top-level element) ఉంది, ఒక స్టైల్షీట్ లోని స్టైల్షీట్ కంటెంట్ ను మరొక స్టైల్షీట్ లో చేర్చుతుంది.
ప్రక్కలు:చేర్చబడిన స్టైల్షీట్ (included style sheet) మరియు చేర్చబడిన స్టైల్షీట్ (including style sheet) యొక్క ప్రాముఖ్యత ఒకే విధంగా ఉంటాయి.
ప్రక్కలు:ఈ కెమెంట్ కార్యకలాపం <xsl:stylesheet> లేదా <xsl:transform> యొక్క పిల్లవాడు ఉండాలి.
సంకేతం
<xsl:include href="URI"/>
అంశం
అంశం | విలువ | వివరణ |
---|---|---|
href | URI | అవసరమైనది. సంశోధించవలసిన స్టైల్షీట్ యురి నిర్దేశిస్తుంది. |
ప్రకారం
ఉదాహరణ 1
ఈ ఉదాహరణలో xslincludefile.xsl పేరు కలిగిన స్టైల్షీట్ ఉంది:
<?xml version=1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:template match="/"> <xsl:for-each select="COLLECTION/BOOK"> <xsl:apply-templates select="TITLE"/> <xsl:apply-templates select="AUTHOR"/> <xsl:apply-templates select="PUBLISHER"/> <BR/> <!-- add this --> </xsl:for-each> </xsl:template> <xsl:template match="TITLE"> <DIV STYLE="color:blue"> Title: <xsl:value-of select="."/> </DIV> </xsl:template> <xsl:include href="/xsl/xslincludefile.xsl" /> </xsl:stylesheet>