c# - Work backwards from an xslt to create an xml -


so, have quite few xslt files need generate preview for, not have corresponding xml files. wondering if possible go through xslt file , create list of required fields xslt? example,

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform">   <xsl:template match="/">       <xsl:for-each select="catalog/cd">         <tr>           <td><xsl:value-of select="title" /></td>           <td><xsl:value-of select="artist" /></td>         </tr>     </xsl:for-each>   </xsl:template> </xsl:stylesheet> 

i want go xslt this: "/catalog/cd/title, /catalog/cd/artist" fields required xslt, or set default value of them outputs "/catalog/cd/title" title , "/catalog/cd/artist" artist.

just give shot, won't work multiple templates:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" version="1.0" exclude-result-prefixes="xsl"> <xsl:output method="xml" indent="yes"/> <xsl:variable name="xsl-namespace">http://www.w3.org/1999/xsl/transform</xsl:variable>  <xsl:template match="*[namespace-uri() != $xsl-namespace]" >     <xsl:copy>         <xsl:apply-templates select="@*[namespace-uri() != $xsl-namespace]"/>         <xsl:apply-templates select="*[namespace-uri() != $xsl-namespace]"/>     </xsl:copy> </xsl:template>  <xsl:template match="@*[namespace-uri() != $xsl-namespace]" >     <xsl:copy/> </xsl:template> 


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -