[xsl] struggling with avt's

Subject: [xsl] struggling with avt's
From: DPawson@xxxxxxxxxxx
Date: Mon, 29 Jul 2002 15:10:51 +0100
Given an external file
<doc>
 <para html='p' pdf='fo:block' attset='para font'>This is .... </para>
</doc>


Objective:
I want to use file in html and fo.

The fo version (I thought) should read

  <xsl:template name="intro">
    <xsl:for-each select='document("intro.xml")/doc/*[@pdf]'>
      <xsl:element name='{@pdf}'>
       <xsl:attribute name="xsl:use-attribute-sets"><xsl:value-of 
        select='@attset'/>
      </xsl:attribute>
        <xsl:value-of select='.'/>
      </xsl:element>
    </xsl:for-each>
  </xsl:template>

I.e. 
for all elements in the intro.xml file which have a pdf attribute,
  Create an element with name from @pdf
    (note that xsl:element doesn't use avt's)
    add an attribute set reference using xsl:attribute with names from
@attset.

Except:

1. XSLT spec says

"The value of the xsl:use-attribute-sets attribute is a whitespace-separated
list of names of attribute sets. The xsl:use-attribute-sets attribute has
the same effect as the use-attribute-sets attribute on xsl:element with the
additional rule that attributes specified on the literal result element
itself are treated as if they were specified by xsl:attribute elements
before any actual xsl:attribute elements but after any xsl:attribute
elements implied by the xsl:use-attribute-sets attribute. "

which *implies* that I must use a literal result element, not an xsl:element
(but I'm not sure).

I'm beginning to wonder which app actually resolves the attribute sets into
the base form, the xslt processor or the fo processor?


Suggestions please.
I'm I flying a kite or does this have a reasonable chance of success?

End game is even dubious.

<fo:block xsl:use-attribute-sets='font para'>

I can't find in the fo spec that this is a valid attribute of fo:block,
but I know I've used it before successfully.

Regards DaveP

************snip here************** 

- 

NOTICE: The information contained in this email and any attachments is 
confidential and may be legally privileged. If you are not the 
intended recipient you are hereby notified that you must not use, 
disclose, distribute, copy, print or rely on this email's content. If 
you are not the intended recipient, please notify the sender 
immediately and then delete the email and any attachments from your 
system.

RNIB has made strenuous efforts to ensure that emails and any 
attachments generated by its staff are free from viruses. However, it 
cannot accept any responsibility for any viruses which are 
transmitted. We therefore recommend you scan all attachments.

Please note that the statements and views expressed in this email 
and any attachments are those of the author and do not necessarily 
represent those of RNIB.

RNIB Registered Charity Number: 226227

Website: http://www.rnib.org.uk 

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


Current Thread