xslt - Get child from node and pass into attribute -


sorry rivial question @ moment can not figure out.

i have node in there childs, want these child , "print" these directly in attribute. please take @ code:

<fo:declarations>                 <xsl:for-each select="//lb">                     <xsl:for-each select="./dv-group/dv/download">  <xsl:value-of select="." /> <pdf:embedded-file filename="<xsl:value-of select="." />" src="url(test:///c:/users/muster/desktop/template_test/data/mappe1.xlsx)"/>                      </xsl:for-each>                 </xsl:for-each>             </fo:declarations> 

i have try variable doesn't work too.

any suggestions?

thanks.

the concept you're looking called attribute value template: in attribute values on literal result element (and in attributes of xsl: instructions too) can enclose xpath expressions in braces , evaluated , result substituted in output:

<pdf:embedded-file filename="{.}" src="url(test:///c:/users/muster/desktop/template_test/data/mappe1.xlsx)"/> 

if want literal brace character in attribute interpreted avt must double it.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -