How to copy a string containing attributes into an element?

Subject: How to copy a string containing attributes into an element?
From: Jan Kohnert <J.Kohnert@xxxxxxxxxxx>
Date: Wed, 30 Jun 2004 16:21:41 +0200
Hello List,

In my stylesheet, I perform two steps to generate FO. First, I dissolve any
references inside the XML source data, building an temporary result tree.
Second, I apply over the temporary result tree, generating the FO code
itself.

While dissolving the references I use saxon's "function" extension to return
the dissolved values.
To apply succesfully over the tempory result tree, I need to store any
information stored in FO as attributes also as attributes in the temporary
result tree.

Therefor I want to copy a string as returned from the function example below
into an element as a "attribute set": (X PATH is short for the real X Path,
that is quite long..)

<saxon:function name="fun:GetAppearance">
<xsl:param name="appearance"/>
<xsl:variable name="Appearanceset">
<xsl:value-of select="concat( 'border=&quot;', fun:GetBorder( X PATH ),
'&quot; ',
                              'background-color=&quot;', fun:GetColor( X
PATH ), '&quot; ',
                              fun:GetMargin( X PATH ))"/>

</xsl:variable>
<saxon:return select="$Appearanceset"/>
</saxon:function    

Returns (for example): 
border="0.5pt solid #FFAAAA" background-color="#CDCDCD" margin=""
margin-top="5mm" margin-bottom="7mm" margin-right="2mm" margin-left="5mm" 

(There is also a concat in "fun:GetMargin()" !)

what I want is, for example, to put this string into an <block-container>
element.
<block-container border="0.5pt solid #FFAAAA" background-color="#CDCDCD"
margin="" margin-top="5mm" margin-bottom="7mm" margin-right="2mm"
margin-left="5mm" >

Is this possible? and when, how?

Thanks!

Current Thread