Subject:Creating dynamically named elements Author:hungry backspace Date:26 Dec 2007 02:51 PM
i've read a few posts on the subject of creating dynamically-named elements using the name() function. that technique seems to work for me, but only in limited applications. specifically, i'm finding that using it is problematic within certain templates. for example, this template is called within another template, which is in turn called by yet another template:
the variable assignment to a value that passes through PHP is no problem; i can define that statically and the result is the same, which is this: the next element, <example>, is properly added to the document, and the dynamically generated variable $itemname is properly contained within the element. the element after that, however, causes a runtime error in the XSLT processor, and the only discernible difference to me is that i'm assigning the element name to a variable.
i'm admittedly quite new to XSLT! so there's likely something basic i missed. any advice or comments are greatly appreciated.