|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] XML Elements Tag (lable) Name is assign at run time
I am new to XSl, generating HTML report dynamically from XML & XSL. A Users Can Select Columns & Can change lable name of Fields ( Table Headers) , he likes to see on generated report. for example this customer.xml generated with following fields names. <?xml-stylesheet type="text/xsl" href="read.xsl"?> <Customers> <Customer customercode="11" AccountNo="21221"> <Name> <FirstName></FirstName> <LastName></LastName> </Name> <DOB>29/04/1976</DOB> <PassportNo>A321312</PassportNo> <Address> <Street></Street> <City></City> <State></State> <Country></Country> <Zipcode></Zipcode> </Address> </Customer> <Customer > .... </Customer> </Customers> and corresponding XSL File is like this <xsl:template match="Customer"> <tr> <td> <table border="1" width="100%"> <tr> <td> <span style="font-weight:bold"> CustomerName</span>: <span style="font-size:small"><xsl:value-of select="Name" /> </span> <br /> </td> </tr> <tr> <td> <span style="font-weight:bold">NCSNO </span> : <xsl:value-of select="DOB" /><br/> </td> </tr> <tr> <td> <span style="font-weight:bold">PassportNo</span>: <xsl:value-of select="PassportNo" /></td> </tr> <tr> <td> <span style="font-weight:bold">Address</span>: <xsl:value-of select="Address/Street" />, <xsl:value-of select="Address/City" /> <br /> </td> </tr> <tr> <td> <xsl:value-of select="Address/State" />, <xsl:value-of select="Address/Country" /></td> </tr> <tr> <td><xsl:value-of select="Address/Zipcode" /> </td> </tr> </table> </xsl:template> Now when users change lables of fields for e.g DOB to DateOfBirth . or ZipCode to PostCode. corresponding Customer.xml file, look like this <?xml-stylesheet type="text/xsl" href="read.xsl"?> <Customers> <Customer customercode="11" AccountNo="21221"> <Name> <FirstName></FirstName> <LastName></LastName> </Name> <!-- change Tag From DOB to DateOfBirth--> <DateOfBirth>29/04/1976</DOB> <PassportNo>A321312</PassportNo> <Address> <Street></Street> <City></City> <State></State> <Country></Country> <!-- change tag from ZipCode to PostCode --> <PostCode></PostCode> </Address> </Customer> <Customer > .... </Customer> </Customers> is there any solution which can solve problem with out rewriting XSL Template again?? or any other better way, to tackle this Problem???? 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
|






