|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using XSL and schemas to create form-editable xml
Hi Chris,
> Has anyone found pleasant workarounds to the following problems:
>
> 1. can't use variables to name new xsl:elements
Well you can - you can use an attribute value template in the name
attribute of xsl:element. For example, if you have:
<xsl:variable name="foo" select="'bar'" />
<xsl:element name="{$foo}" />
then you get the empty element:
<bar />
> 2. can't use variables to name new xsl:attributes
Again, you can - you can use an attribute value template in the name
attribute of xsl:attribute as well. For example, if you have:
<foo>
<xsl:variable name="foo" select="'bar'" />
<xsl:attribute name="{$foo}">baz</xsl:attribute>
</foo>
then you get the empty element:
<foo bar="baz" />
> 3. xsl:copy, when used on attributes, can't have a template body
If you want to change the value of an attribute, then there's no point
in copying it - a copy is a copy, so it has the same value.
Instead, you can use the above facility - the attribute value
templates - to create a new attribute with the same name (and
namespace) and put whatever content you want in it:
<xsl:attribute name="{name()}" namespace="{namespace-uri()}">
... template body ...
</xsl:attribute>
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








