OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook] Newbie: create named data items?


Thomas Nichols wrote:


> Problem: a <book> has <section>s for a number of minerals. For each, I 
> have a Name, a "History" section, a "Geology" section, etc. I want to 
> create a valid DocBook doc, so that I can publish the entire book, but I 
> want to add markup to allow me to print, say, just Name and Geology 
> sections. A different stylesheet might extract just Name and History 
> sections.



Here's a simple hack (when relying on attribute role you should be aware 
of possible issues), which might solve parts of your problem:


Input:

http://www.pinkjuice.com/howto/vimxml/docbook/ch02.xml

<chapter><title>About</title><!-- ... -->
  <section role='HTMLOnly'><title>Access</title><!-- ... -->


Through:
(with XSLT 1, you could run it in a separate pass,
with XSLT 2 you could run the filter in the single pass)

http://www.pinkjuice.com/howto/vimxml/xslt/nwalsh_fo/print_filter.xslt

   <t:template match="node() | @*">
     <t:copy>
       <t:apply-templates select="@* | node()" />
     </t:copy>
   </t:template>
   <!--
   filter out:
   -->
   <t:template match="*[
     @role='InteractiveOnly'
     or
     @role='HTMLOnly'
     or
     @role='DisplayOnly'
     or
     @role='DynamicOnly'
     or
     @role='NotForPrint'
     or
     @role='ColorPic'
     ]"/>


Result:

Chapter About / Section Access appears in the HTML
http://www.pinkjuice.com/howto/vimxml/about.xml#access ,
but not in the PDF
http://www.pinkjuice.com/howto/vimxml/print/nwalsh_fop.pdf .

You mught also want to
http://www.sagehill.net/xml/docbookxsl/SpecialHandling.html#Profiling
(I'm happy with my simple solution though :)

P.S.
This thread might be more appropriate for
docbook-apps@lists.oasis-open.org
http://docbook.org/wiki/moin.cgi/DocBookAppsMailingList ,
but since it's majorly concerned with the input markup ...

Tobi


-- 
http://www.pinkjuice.com/



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]