This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
this might be a simple question but I just started with xslt and i cant get it to work.
Basically I got an xml with this format coming in:
<?xml version="1.0" encoding="UTF-8"?>
<FileXML xmlns:vi="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/XSL/Transform">
<vi:Name>Union Square Limited</vi:Name>
This means it should read the amount of employees (=3) in the source xml and therefore create three Branch elements with all the original data but assign a unique Identifier. I think I can manage to change all the <vi:Employees> to have the value 1 afterwards but the rest is totally above my current skills.
Any thoughts or ideas are more than welcome!
I think I can manage to change all the <vi:Employees> to have the value 1 afterwards but the rest is totally above my current skills.
You mean you can change it to 1 and reproduce the original xml document as such with only that value changed? That seems already not that obvious for someone who just starts xslt. Could you show how you do it, the xslt document ? and from thereon I might help you to complete the task.
If you don't want to show the xslt that does that part, I can only say you make out a named template mainly based on that with a parameter initialized to 1. That named template would then call itself each time with the parameter increaded by 1 until the 3 is surpassed to stop. That is the big picture of the construction.
subject: XSLT: reading value of field and creating elements in a loop