[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] generating xml from xslt
Hi: I have an xslt through which I am generating an XML file. <root> <status> <locn> <loc1> <address> <add1/> <add2/> <add3/> </address> </loc1> </locn> </status> <main> <para>This is a test only</para> </main> </root> I need to write an XSLT to generate this XML file. However, the values of add1, add2 and add3 are required to be entered at runtime. So I need to generate atleast 5 such xml files with different values for add1, add2 and add3. How do I do this? I started writing an XSLT for this. Here is what I have written so far. This is not complete and accurate so please let me know how to achieve this. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml"/> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="/root/status/locn/loc1/address"> <xsl:element name="add1"></xsl:element> <xsl:element name="add2"></xsl:element> <xsl:element name="add3"></xsl:element> </xsl:template> </xsl:stylesheet> Thank you
|
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
|