• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

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

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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".
 
Let's get him boys! We'll make him read this tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic