Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. generate xslt code dynamically

generate xslt code dynamically

Scheduled Pinned Locked Moved XML / XSL
xmldatabasehelptutorialalgorithms
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sdee2
    wrote on last edited by
    #1

    :)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

    L 1 Reply Last reply
    0
    • S sdee2

      :)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

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups