[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

Subject: Re: Using XSL and schemas to create form-editable xml files
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 27 Feb 2001 11:41:38 +0000
create form from 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.