W3C home > Mailing lists > Public > www-xsl-fo@w3.org > May 2008

Re: Newbie Question

From: Mark Lundquist <ml@wrinkledog.com>
Date: Wed, 7 May 2008 06:41:46 -0700
Cc: www-xsl-fo@w3.org
Message-Id: <C0B33D60-45E6-4A66-8948-8D562124F46B@wrinkledog.com>
To: Frank Merrow <fmerrow@qualcomm.com>


On May 6, 2008, at 6:16 PM, Frank Merrow wrote:

>
> I'm trying to learn XLS myself with limited success.
>
> So this is my input record:
>
> <AI00010002 type='wiki'>Status_Message_for_APS_MobModel_and_QXDM</ 
> AI00010002>
>
> and this is what I want for an output record:
>
> <aitag type="wiki">Status_Message_for_APS_MobModel_and_QXDM</aitag>
>
> I'm almost there . . . what goes in the place I am missing?
>
> <aitag><xsl:attribute name="type">what goes here?</ 
> xsl:attribute><xsl:value-of select="."/></aitag>


Well, you could use

	<aitag>
		<xsl:attribute name="type" select="@type"/>

which is shorthand for

	<aitag>
		<xsl:attribute name="type" select="attribute::type"/>

Or you could do it like this:

	<aitag>
		<xsl:copy-of select="@type"/>

Less verbose is this:

	<aitag type="{@type}">		<!-- using attribute value template -->

Alternatively, you can generalize it like this

	<aitag>
		<xsl:copy-of select="@*"/>	<!-- copy all attributes from context  
node -->


cheers, HTH
—ml—
Received on Wednesday, 7 May 2008 13:42:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 May 2008 13:42:26 GMT