generate xslt code dynamically
-
:)For a simple example, I have an access database which has 2 columns: Let's say one column is InputXML and other column is OutputXML that we want. This contains the mapping rules. The table structure is as follows: INPUTXML OUTPUTXML Fname First Name Lname Last Name So basically Fname in input XML should be changed to First Name in output XML. So the database just has the mapping rules for the transformation and not the values. Now the task is to create a dot net windows application that has a button called GENERATE XSLT . On clicking this button, it should dynamically generate the XSLT taking the mapping rules from the database. In other words instead of hardcoding the XSLT , based on the DB mapping rules like Fname to FirstName etc, it should just generate the code for XSLT in a txt file or XSL file, which is the code which does the transformation. So basically an XSLT code generator should be written. Someone said there is a function call or API in dot net which generates the xslt template, I just have to define the relationships among them using values from DB. Not even sure what this means. Any help on how to approach solving this problem or some starting idea (some psuedo code or anything ) would be great, I am learning Dot net as well as XML/XSLT. If you are aware of the API also, please let me know as it will save me some searching time. Hope someone helps. Thanks, Sdee sdee
-
:)For a simple example, I have an access database which has 2 columns: Let's say one column is InputXML and other column is OutputXML that we want. This contains the mapping rules. The table structure is as follows: INPUTXML OUTPUTXML Fname First Name Lname Last Name So basically Fname in input XML should be changed to First Name in output XML. So the database just has the mapping rules for the transformation and not the values. Now the task is to create a dot net windows application that has a button called GENERATE XSLT . On clicking this button, it should dynamically generate the XSLT taking the mapping rules from the database. In other words instead of hardcoding the XSLT , based on the DB mapping rules like Fname to FirstName etc, it should just generate the code for XSLT in a txt file or XSL file, which is the code which does the transformation. So basically an XSLT code generator should be written. Someone said there is a function call or API in dot net which generates the xslt template, I just have to define the relationships among them using values from DB. Not even sure what this means. Any help on how to approach solving this problem or some starting idea (some psuedo code or anything ) would be great, I am learning Dot net as well as XML/XSLT. If you are aware of the API also, please let me know as it will save me some searching time. Hope someone helps. Thanks, Sdee sdee
sdee2 wrote:
Someone said there is a function call or API in dot net which generates the xslt template
System.Xml.Xsl.XslTransform is the XSLT processor but I am not aware of any library that generates XSLT. However XSLT "is" XML so you can use any of the XML mechanisms to create XSLT.