Subject: Re: [xsl] struggling with avt's From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Date: Tue, 30 Jul 2002 09:52:20 +0100 |
Dave, > Thanks David. > Cleared most of it up. > > I'll carry on at least knowing I'm going in the right direction :-) I'm just a bit worried that you've misinterpreted what David was saying. You're going to find it very difficult (read impossible in the general case) to go from: <doc> <para html='p' pdf='fo:block' attset='para font'>This is .... </para> </doc> via a single stylesheet including attribute sets for 'para' and 'font' to get to an XSL-FO document that includes the attributes defined in that attribute set in just one step. Perhaps this is what you're doing at the moment anyway, but I think the easiest thing will probably be to have two steps, where the first creates a stylesheet that includes literal result elements with xsl:use-attribute-sets attributes on them (plus the definitions of the attribute sets themselves) and the second runs that stylesheet (processing the xsl:use-attribute-sets attributes) to create the final XSL-FO that you're after. So your first stylesheet would look something like: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/XSL/Transform/Alias" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:namespace-alias stylesheet-prefix="#default" result-prefix="xsl" /> <xsl:template match="/"> <stylesheet version="1.0"> <include href="attribute-sets.xsl" /> <template match="/"> <xsl:apply-templates /> </template> </stylesheet> </xsl:template> <xsl:template match="*[@pdf]"> <xsl:element name="{@pdf}"> <xsl:attribute name="xsl:use-attribute-sets"> <xsl:value-of select="{@attset}" /> </xsl:attribute> <xsl:apply-templates /> </xsl:element> </xsl:template> </xsl:stylesheet> which would create: <stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <include href="attribute-sets.xsl" /> <template match="/"> <fo:block xsl:use-attribute-sets="para font"> This is ... </fo:block> </template> </stylesheet> When that stylesheet is run (on anything) then it will create the XSL-FO, with the attribute sets resolved. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] struggling with avt's, DPawson | Thread | [xsl] Any free product like XSL-WIZ, Mailer Mailer |
Re: [xsl] Passing Command line para, Jeni Tennison | Date | Re: [xsl] math get maximum and subt, Jeni Tennison |
Month |