Subject:Copying XML as is with one change, how can I insert an action into the copy procedure? Author:Laurens Aarnoudse Date:05 Apr 2011 05:52 AM Originally Posted: 05 Apr 2011 05:47 AM
I wanted to copy an xml file entirely with one change: one element called <enclosure> should become <image>. This was more difficult to achieve than I expected.
I tried to use a if-then construction to copy everything except when the element <enclosure> has been encounted. In that case it selects an attribute of that element and tries to put that in between <image> tags. This is where I get the error "cannot write an attribute when there is no open start tag". I suspect something goes wrong when the xslt parses through all the elements.