How to build xsl:attribute-sets for multiple XML-Items?

femme mature a

New Member
i want to transform a xml with the XSLTProcessor. Everthing is working fine but i got problems with the attribute-sets.My XML looks like:\[code\]<?xml version="1.0" encoding="UTF-8"?><exportDelivery><job>/* many other tags and data */</job><job>/* many other tags and data */</job><job>/* many other tags and data */</job></exportDelivery>\[/code\]If you want to use attributes in your new xml you have to use attribue-sets in the xsl-file. But attribute-sets have to be defined in the "head" of the xsl. that means outside of the foreach-loop for the "job"-tags. After the Transformation every job gets the same attributes of the first job. What did i wrong? Here is a attribue-set i use:\[code\] <xsl:attribute-set name="premium"> <xsl:attribute name="from"> <xsl:value-of select="/exportDelivery/jobAdvertisements/startDate"/> </xsl:attribute> <xsl:attribute name="to"> <xsl:value-of select="/exportDelivery/jobAdvertisements/endDate"/> </xsl:attribute> </xsl:attribute-set>\[/code\]Thanks!
 
Top