XSLT <xsl:import> మెమ్బర్
నిర్వచనం మరియు వినియోగం
<xsl:import> మెమ్బర్ పైస్ట్ లెవల్ మెమ్బర్, ఒక స్టైల్షీట్ యొక్క సహజ కంటెంట్ ను మరొక స్టైల్షీట్ లోకి తీసుకు వెళ్ళడానికి ఉపయోగిస్తారు.
注释:దిగుమతి చేసుకున్న స్టైల్షీట్ ప్రాధాన్యత ఎక్స్పోర్ట్ చేసుకున్న స్టైల్షీట్ కంటే తక్కువగా ఉంటుంది.
注释:ఈ మెమ్బర్ అవసరమైనది <xsl:stylesheet> లేదా <xsl:transform> యొక్క మొదటి సంకేతం ఉండాలి.
注释:నెట్స్కేప్ 6 ఇమ్పోర్ట్ ప్రాధాన్యత నిబంధనలను మద్దతు చేయదు, కాబట్టి ఈ మెమ్బర్ యూనిట్ ప్రదర్శన మార్పులు <xsl:include> తో సమానంగా ఉంటాయి.
సంకేతాలు
<xsl:import href="URI"/>
అంశం
అంశం | విలువ | వివరణ |
---|---|---|
href | URI | అవసరమైన. దిగుమతి చేసుకునే స్టైల్షీట్ యూరి ని నిర్దేశిస్తుంది. |
ఉదాహరణ
ఉదాహరణ 1
మీరు "cdcatalog_ex3.xsl" పేరు కలిగిన స్టైల్షీట్ ఫైల్ కలిగి ఉండాలి:
<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <h2>My CD Collection</h2> <table border="1"> <tr bgcolor="#9acd32"> <th>Title</th> <th>Artist</th> </tr> <tr> <td><xsl:value-of select="catalog/cd/title"/></td> <td><xsl:value-of select="catalog/cd/artist"/></td> </tr> </table> </body> </html> </xsl:template> </xsl:stylesheet>
రెండవ "cdcatalog_import.xsl" పేరు కలిగిన స్టైల్షీట్ "cdcatalog_ex3.xsl" ని దిగుమతి చేస్తుంది:
<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:import href="cdcatalog_ex3.xsl"/> <xsl:template match="/"> <xsl:apply-imports/> </xsl:template> </xsl:stylesheet>
注释:此例无法在 Netscape 6 运行,因为 Netscape 6 不支持 <xsl:apply-imports> 元素!