I think the correct test here would be:

<xsl:if test="self::d:editor and count(preceding-sibling::d:editor) = 0 and not($editedby.enabled = 0)"

See if that works for you, and I will check in the change if it does.

Bob Stayton
Sagehill Enterprises
[email protected]

On 2/14/2014 3:21 AM, Michael Cook wrote:
Hi Bob, it look's like this change is still not good enough.

I was testing a document without an author (only editors) but once you
insert an author in there then naturally the position of the first
editor changes, and so no "Edited by" is inserted at all.

I'm not sure yet how to fix it.


Michael


On 13/02/2014 22:47, Bob Stayton wrote:
I'd say that's a bug.  self::d:editor returns a single node, so in
that context the position()=1 test is always true.  I'll fix that in
the source.  Thanks for the report, and for providing the fix.

Bob Stayton
Sagehill Enterprises
[email protected]

On 2/13/2014 3:38 AM, Michael Cook wrote:
When processing a document with multiple editors the EPUB3 titlepage is
showing an "Edited by" label for each editor, rather than just the once.

I can fix the problem by updating xhtml/titlepage.xsl:210;

<xsl:if test="self::d:editor[position()=1] and not($editedby.enabled
= 0)"

to

<xsl:if test="self::d:editor and position()=1 and not($editedby.enabled
= 0)">

Is this a bug or perhaps something wrong on my end?


I'm using the latest "docbook-xsl-ns-snapshot" and parsing with Nokogiri
(a RubyGEM), which itself uses libxml2.

Here's what's in the XML;

<book ...>
   <info>
     ...
     <authorgroup>
       ...
       <editor>
         <personname>
           <firstname>Jon</firstname>
           <surname>Doe</surname>
         </personname>
       </editor>
       <editor>
         <personname>
           <firstname>Timmy</firstname>
           <surname>Toe</surname>
         </personname>
       </editor>
     </authorgroup>
     ....

which with the current stylesheet becomes;

Edited by
Jon Smith

Edited by
Timmy Toe


Thanks,

Michael Cook

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]






---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to