[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: transform only a section of xml
> I am sure this is a FAQ but I am not sure how to ask this > question properly without illustrating it. I would like to > transform only a portion of an xml document while mainting > the rest of the structure. Write the identity template rule as the default rule for all elements: <xsl:template match="*"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> and then supplement it with rules for the elements you want to modify: <xsl:template match="form"> ... </xsl:template> Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx > > <!-- original --> > <xml> > <section> > <title>title</title> > <para> > <form id="1"/> <!-- item to transform --> > </para> > </section> > </xml> > > <!-- transform to --> > <xml> > <section> > <title>title</title> > <para> > <form method="post"> > <input type="text" name="NAME" /> > </form> > </para> > </section> > </xml> > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > 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
|