This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

copying attributes


>From: "Bryan Rasmussen" <bry@itnisk.com>
>To: <xsl-list@lists.mulberrytech.com>
>Subject: copying attributes
>Date: Wed, 30 Jan 2002 17:31:45 +0100
>
>okay when I make xsl:fo I like to use the document() function to write in
>different styles on elements using a css-like xml syntax. Today I decided to
>make something that took a completed xsl, ran an xslt against it, copied the
>xsl out, but used the external css to overwrite the attribute values that I
>needed overwritten.
>am in the early dev stages, have a working copier, but with a problem in the
>following template:
>
>
><xsl:template match="fo:*[@it:class]" priority="2">
><xsl:message>matched</xsl:message>
><xsl:variable name="itclass"><xsl:value-of
>select="@it:class"/></xsl:variable>
>
><xsl:element name="{name()}">
><xsl:for-each select="@*"><xsl:copy/></xsl:for-each>
><xsl:for-each select="$cssdocSelect/root/selector[@it:class=$itclass]/s">
><xsl:attribute name="{@name}"><xsl:value-of select="."/>
></xsl:attribute>
></xsl:for-each>
><xsl:apply-templates/>
></xsl:element>
></xsl:template>
>
>(I use it:class so I'll have something similar to a class attribute, also
>have the same situation for it:id, and $cssdoc is the parameter that refers
>document())
>
>anyway I have the really lame <xsl:for-each
>select="@*"><xsl:copy/></xsl:for-each> to copy out my attributes and then I
>follow this with the <xsl:for-each
>select="$cssdocSelect/root/selector[@it:class=$itclass]/s">
><xsl:attribute name="{@name}"><xsl:value-of select="."/>
></xsl:attribute>
></xsl:for-each>
>
>the problem is of course that with the for-each @* I'm copying some of the
>same attributes I'm getting from the next for-each, obviously what I need to
>do is to figure if any attribute does not match any of the attribute::name
>in $cssdocSelect//selector[@it:class=$itclass]/s
>I have to admit with all humility I've always had problems checking if @*
>was NOT equal to another attribute in an external document.
>
>Does anyone have a good solution for this?



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]