RE: [xsl] struggling with avt's

Subject: RE: [xsl] struggling with avt's
From: DPawson@xxxxxxxxxxx
Date: Tue, 30 Jul 2002 11:17:30 +0100
Hi Jeni.

> 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.

Sort of.

exept that I have 3 directories for 5 media,
so I'm effectively applying one stylesheet per media using
the same markup.

As seen in the fresh light of day,

My 'boiler plate' now looks like

<fsubsect1 media='print'>

  <head2  media='html pdf print'  attset='head1 font'>INTRODUCTION</head2>

  <para  media='html print pdf' attset='para font'>When you have found the
books you wish to read, you can add these
titles to your current selection list, ......
<il media='print pdf html'  attset='emph'>press and hold</il> the bookmark
key. The guide voice will say "bookmark one
inserted" (the bookmark number will increase with each insertion). The
disc will continue to play.

</para>


The processing through to xml is done moded,

<xsl:template match='para[contains(@media, "print")]' mode='intro'>
  <p><xsl:apply-templates mode='intro'/></p>
</xsl:template>

<xsl:template match='il[contains(@media, "print")]' mode='intro'>
  <xsl:choose>
    <xsl:when test='contains(@attset, "emph")'>
      <b><xsl:apply-templates mode='intro'/></b>
    </xsl:when>
  </xsl:choose>
</xsl:template>


For the fo processing I have:

 <xsl:template match='head2[contains(@media,"pdf")]' mode='intro'>
      <xsl:choose>
        <xsl:when test='contains(@attset,"head2")'>
          <xsl:element name='fo:block'  use-attribute-sets='head2 font'>
            <xsl:apply-templates/>
          </xsl:element>
        </xsl:when>
        <xsl:otherwise>
          <xsl:message terminate='yes'>
            intro.xml. content has head block without head2 attribute sets!
            Stopping processing:
          </xsl:message>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>

With all the attribute sets included in the same xsl file.
I need to tighten this up

Works so far, html won't be too much addition.

I don't try and output n media from one stylesheet though, which would
be pretty hairy!

I don't need to make it all that general purpose.
head1 head2 para inline
are sufficient for the boiler plate I'm doing, so I can trigger off
the element.
The wrappers are only needed for one media.



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