Click to See Complete Forum and Search --> : How to call a template node in xml file?


rp83
12-28-2007, 06:57 PM
HI
I am a novice programmer in xml.In my xml file a set of elements are repeating.I want to make a template of this and call this template from wherever needed.Can anyone provide help?

The sample node looks like this:

<value value="1">America</value>
<value value="2">Canada</value>
<value value="3">Europe</value>
<value value="4">Australia</value>
<value value="5">Asia</value>
<value value="6">Africa</value>

These are repeating several times.I want to write it once and call them from another location in xml file..Is ther any mechnism to do this??

brasspenguins
12-30-2007, 08:09 PM
What you're asking for is unclear to me. Of course that could just be due to my half functioning mind. Check these out and see if they help...
http://www.w3schools.com/xsl/el_call-template.asp
http://www.w3schools.com/xsl/xsl_templates.asp