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

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

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


Subject: Re: [docbook-apps] Output order of elements contained in <personname>


Hi Karl,

> Why isn't this the default?  What is gained
> by altering document order?

The author of the personname template logically assumed that <firstname> comes first in presentation unless otherwise specified. That 'otherwise' is provided by an optional role attribute on personname, as described here:

http://www.sagehill.net/docbookxsl/PersonNames.html

which supports altered output such as "Stayton, Bob".

The stylesheet has to supply some formatting, because the whitespace between elements inside personname is not considered significant in the schema. This custom template:

<xsl:template match="d:personname">
   <xsl:apply-templates/>
</xsl:template>

just happens to preserve any whitespace between elements, but if you omit the space between elements in your source file, then they run together in the output, which is not the expected result.

To carry this idea a little further, perhaps personname should work more like bibliomixed, which allows a mix of text and elements whose order is preserved, as opposed to biblioentry where the order of elements is imposed by the stylesheet based on some bibliography style. But currently personname does not permit text other than whitespace between elements, so you could not insert a comma between surname and firstname in your document, for example.

You are suggesting that the default processing should be to preserve the order of elements in personname and to insert spaces between them. We can still use @role to support other output formats.

Making this change would introduce problems for people who have relied on the stylesheet to impose their expected order, regardless of the order of the elements in personname, which heretofore has not been considered significant. To preserve backwards compatibility, we could introduce a stylesheet parameter that would designate the behavior. In this case, I would suggest that the default setting be to preserve the old behavior, and allow a new setting to support the new processing expectations. That's generally how we support both old and new features without introducing surprises during upgrades.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net

On 10/28/2015 5:07 AM, Karl O. Pinc wrote:
On Wed, 28 Oct 2015 09:19:49 +0100
Martin Doucha <next_ghost@quick.cz> wrote:

Dne 28.10.2015 v 03:16 Karl O. Pinc napsal(a):
Elements contained in <personname> can come in any order within a
document but they are not output in the order input. Right now they
are always output in the order <honorific> <firstname> <surname>
<lineage>.   (At least from inside an <author> element.)

This fixed output order is not suitable in the general case.
Better would be to output in the order input, as with para.

The template for <personname> in XSL stylesheet package indeed
processes subelements in fixed order. To process them in document
order instead, simply put the following template definition into your
customized XSL file (assuming the usual namespace aliases for XSL and
DocBook):

<xsl:template match="d:personname">
   <xsl:apply-templates/>
</xsl:template>

Thanks.

Why isn't this the default?  What is gained
by altering document order?




Karl <kop@meme.com>
Free Software:  "You don't pay back, you pay forward."
                  -- Robert A. Heinlein

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org





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