[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML reformatting <xsl:element & <xsl:for-each

Subject: Re: XML reformatting <xsl:element & <xsl:for-each
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 7 Jan 2003 14:49:41 GMT
xsl current text
> but It keeps saying that the element name is not a
> QName, How can I accomplish this???

the name attribute of xsl:element is by default the literal name 9qname)
of the element to be generated.
<xsl:element name="name()">
is generating <name()> which isn't allowed.

To get Xpath expression to evaluate to the name you need to use {} as in
<xsl:element name="{name()}">
however

		<xsl:element name="{name()}">
			<xsl:value-of select="current()/text()"/>
		</xsl:element>
is just making a copy of the current element so it would be simpler to
replace those lines by

<xsl:copy-of select="."/>



	<xsl:text>
		<xsl:value-of select="current()/text()"/>
	</xsl:text>

generates an error as you can not have any elements inside xsl:text
so this error isn't odd:
> I'm also getting Odd errors about <xsl:text>, 'Unexpected  Child'.
It is complaining about teh xsl:value-of.

You could just do without the xsl:text
<xsl:value-of select="current()/text()"/>
which is equivalent to
<xsl:value-of select="text()"/>
or in this case, as the element has no child nodes,
<xsl:value-of select="."/>

however looking at your required output you don't want any text output
before the elements so you can delete these lines.

I didn't understand your description of how the required result shoul
dbe derived from the example input so I'm not sure what else you'll need
to change but your stylesheet doesn't have anything processing the
table1 and table2 elements in your source.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 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.