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>
XML ఫైల్ను చూడండి,XSL ఫైల్ను చూడండి,ఫలితాలను చూడండి.
ప్రత్యామ్నాయ వివరణలు:ఈ ఉదాహరణను Netscape 6 లో నడపలేదు, ఎందుకంటే Netscape 6 కి <xsl:apply-imports> అంగం మద్దతు లేదు!