Home
TeamSite
Generating xml file from a tpl
Ruby123
Hi,
I am working on TS 6.7.1 and i need to generate an xml file (which is basically the dcr file along with some additional nodes) through tpl.
I click generate and give the output file path (a.xml) on the generate pop up window.Then in the tpl i add the required xml nodes to the dcr file and try to write all this to the output file (a.xml).But i am not getting the expected result,a.xml does not get the xml data and it is empty.
I created another file(b.xml) using file->newfile option and tried to write the xml data to this this file.It works.I can see the xml content in this file
Then i compared the attributes of files a.xml and b.xml and noticed that a.xml has these teamsite extended attributes set on it whereas b.xml does have them.
TeamSite/Templating/PrimaryDCR:
TeamSite/Templating/PrimaryDocumentType:
TeamSite/Templating/PrimaryPT:
Can anyone help me with this problem.Is it possible to create xml file through TPL?
Find more posts tagged with
Comments
nipper
Post your TPL and a DCR. This is extremely common, and usually a trivial task.
curiousmaverick
Well your description sounds a bit confusing although I think this task is not that complicated at all.
As suggestted by Nipper, post your codes.
Ruby123
Have attached tpl and dcr files.Please let me know if my question is still not clear.
Migrateduser
Why on earth are you doing all of your I/O manually? If you look at the perldoc for iw_perl, you'll notice that there are functions for accessing data elements from the DCR, iwpt_dcr_value(),and that there are is a function for outputting to the generated file that is selected from the UI, iwpt_output().
I suggest you have a look at the perldoc, have a quick go at rewriting it, and then ask further questions.
nipper
Follow Rob's advice. Then read about ostream, this should be quite easy, but you have taken the most convoluted approach one could imagine.