|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Copying Groups of Attributes
Hi all, Is any one aware of a way where I can group attributes in my XSL in a similar fashion to the way they might be grouped in a DTD. Taking an example from HTML Spec.. <!ELEMENT P - 0 (%inline;) * <!ATTLIST P %attrs; -- %coreattrs,%il8n,%events -- > where %coreattrs is.. <!ENTITY %coreattrs "id ID #IMPLIED class CDATA #IMPLIED style %Stylesheet;#IMPLIED title %Text; #IMPLIED > and so on.. (At the moment) In my XSL if I want to copy across attributes only if they exist I have the following template: <xsl:template match="p"> <p> <xsl:if test="@id"> <xsl:attribute name="align"><xsl:value-of select="@id"/></xsl:attribute> </xsl:if> <xsl:if test="@class"> <xsl:attribute name="align"><xsl:value-of select="@class"/></xsl:attribute> </xsl:if> ....... and so on for the rest of the attributes </p> </xsl:template> Is there anyway for me to reduce this overhead ? I'm aware of attribute-sets by my understanding is that they are only a "textual macro". Is this correct ? Thanks, Ciaran. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








