Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to add a new attribute via xsl in an existing xml structure

 
Sumit Aggarwal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem : I need to add a new variable DateTime(Integer type) in the current hierarchy(of dbPublish.xml) as a event attribute. For example,



Partial Solution:

I have added the code in red in dbPublish.xsl, which will give me DateTime=”20110802124026”



Now, where should I call my event template so as to put my attribute at the desired location.


Please provide your valuable inputs.
 
g tsuji
Ranch Hand
Posts: 672
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you mean the xml document itself does not actually have DateTime attribute on its "event" element, you can do it like this, modifying the attribute template and adding one named template "DateTime" below.

You can thereby take out the template for event, and named template "FormatDate" and "FormatTime".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic