[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XSL Dependency Mapping
Hi > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of > Andy Joslin > Sent: Thursday, July 24, 2003 8:00 AM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: XSL Dependency Mapping > > > Hi All > > Does anyone know of a tool that can generate a dependency map > of a whole set of XSL's ? (i.e. which stylesheets import others, etc.) > > A tool that generated some kind of site map/tree of related > XSLs would be great as I'm trying to clean up and reign in > some 400 files with a view to finding common dependencies, etc. > > Does XML Spy have this feature ? You could do that with xslt. Try these templates: <xsl:template match="xsl:stylesheet"> <xsl:text>Mappings </xsl:text> <xsl:text>--+ </xsl:text> <xsl:text>  | </xsl:text> <xsl:apply-templates select="*[self::xsl:include or self::xsl:import]"/> <xsl:text> </xsl:text> </xsl:template> <xsl:template match="xsl:include"> <xsl:param name="sep" select="'  '"/> <xsl:variable name="nxt"> <xsl:choose> <xsl:when test="following-sibling::*[self::xsl:include or self::xsl:import][1]"> <xsl:value-of select="'|'"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="' '"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:value-of select="concat($sep,'| ')"/> <xsl:value-of select="concat($sep,'+-')"/> <xsl:value-of select="@href"/> <xsl:text> (include)</xsl:text> <xsl:text> </xsl:text> <xsl:apply-templates select="document(@href)/xsl:stylesheet/*[self::xsl:include or self::xsl:import]"> <xsl:with-param name="sep" select="concat($sep,$nxt,' ')"/> </xsl:apply-templates> </xsl:template> <xsl:template match="xsl:import"> <xsl:param name="sep" select="'  '"/> <xsl:variable name="nxt"> <xsl:choose> <xsl:when test="following-sibling::*[self::xsl:include or self::xsl:import][1]"> <xsl:value-of select="'|'"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="' '"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:value-of select="concat($sep,'| ')"/> <xsl:value-of select="concat($sep,'+-')"/> <xsl:value-of select="@href"/> <xsl:text> (import)</xsl:text> <xsl:text> </xsl:text> <xsl:apply-templates select="document(@href)/xsl:stylesheet/*[self::xsl:include or self::xsl:import]"> <xsl:with-param name="sep" select="concat($sep,$nxt,'  ')"/> </xsl:apply-templates> </xsl:template> Hope this helps you. Regards, Américo Albuquerque XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|