Dear Yves,
you are very kind and helpful. I am starting to understand now. Letme be
clearer about what I am trying to do:
- suppress brackets in thecitationformat;
This is easy. Look for "b:FirstAuthor" and "b:LastAuthor". The former
is used to indicate what to do in front of the in-textcitationwhile
the latter indicates what to do after thecitation.
For example for theAPAstyle (APA.xsl), you have the following pieces
of code:
<xsl:if test="msxsl:node-set($ListPopulatedWithMain)/b:Citation/
b:FirstAuthor">
<xsl:call-template name="templ_prop_OpenBracket"/>
</xsl:if>
...
<xsl:if test="/b:Citation/b:LastAuthor">
<xsl:call-template name="templ_prop_CloseBracket"/>
</xsl:if>
...
<xsl:if test="not(/b:Citation/b:LastAuthor)">
<xsl:call-template name="templ_prop_GroupSeparator"/>
</xsl:if>
The first one indicates that the result of "templ_prop_OpenBracket"
should be displayed in front of thecitation. If you want something
else, you can just replace that line by an xsl:text element. So if you
would want a square bracket, you would change it into:
<xsl:if test="msxsl:node-set($ListPopulatedWithMain)/b:Citation/
b:FirstAuthor">
<xsl:text>[</xsl:text>
</xsl:if>
or if you don't want anything, you can just leave it blank:
<xsl:if test="msxsl:node-set($ListPopulatedWithMain)/b:Citation/
b:FirstAuthor">
</xsl:if>
The second one indicates that at the end of thecitationthe result of
"templ_prop_CloseBracket" should be displayed. The third and last one,
contains a "not" instruction. Basically, it tells what to do if this
is not the lastcitationin a group. For example if you would have
[firstcitation; secondcitation], then the third one would take care
of displaying "; " between the two citations.
- replace "." by "," in thebibliography; (the p element after <xsl:when
test="b:Bibliography">, I believe)
This is a lot harder as there might be dozens of dots which need
replacement. You would have to tell me the exact style and where to
change the dot to a comma. If there are no name abbreviations with
dots, and you are sure that every dot can be replaced with a comma,
you can wrap everything in the p element inside a variable and execute
a simple translate on it:
<xsl:element name="p">
<!-- Some attribute stuff -->
<xsl:variable name="dotted">
<!-- All of the original code with exception of the above
attribute stuff -->
</xsl:variable>
<!-- Replace all the dots with a comma -->
<xsl:value-of select="translate($dotted, '.', ',')/>
</xsl:element>
- change or suppress inverted commas around titles in thebibliography;
It would depend on the style you are using, but this is probably just
removing a call template function or two.
- possibly change the order of elements in thebibliography.
This is doable, but once you start doing all that, you would have to
ask yourself if it wouldn't be a lot easier to just write your own
style from scratch rather than having to find out how the data is
handled to start with.
And similar editing of the output. I was looking by these "connecting"
elements by the search option, by could not find them (maybe they are
replaced by some variable name). Maybe just a basic reference guideof xlst
instructions could help in finding the right code bits. Would you suggest any?
I'm not sure what you mean by 'connecting elements'. The logic of what
to put between elements depends on what is available and what isn't.
For example, one could have something like this:
Title. City: Publisher, Year.
What if Publisher would be missing? There could be several options:
Title. City: Year.
Title. City, Year.
Title. City. Year.
The entire code is nothing more than a huge bunch of xslt "if"
operations: if the City element is available and the Year element is
available but the Publisher element is not, then display the "." as a
separator. The very first style I wrote (
http://www.codeplex.com/
bibliography/Release/ProjectReleases.aspx?ReleaseId=15365) uses this
technique. I got rid of this in later styles as I found it rather hard
to keep track of which elements were available and which were not.
http://www.w3schools.com/xsl/xsl_intro.aspoffersa basic introduction
to XSLT. I think that if you understand how the following elements
work, you can understand 90% of the styles: <xsl:if>, <xsl:choose>
(which is just if-else if - else), <xsl:variable> (storing a
variable), <xsl:template> (similar to a VBA function), <xsl:call-
template> (calling the function), <xsl:value-of> (displaying the
result of a variable). The only tricky thing about XSLT is that
variables can only get a value once.
Thank you again and I hope I am not profiting too much of your patience.
Best wishes.
:
If what you want to change is only something small, I might be able to
help you.
Microsoft missed out on a great opportunity by making the XSLTs so
complex. What I tried to do with BibWord is make the styles less
complex and easier to manipulate/adjust. In time I will probably
convert the existing styles as to make them easier accessible.
"All"citationformatting related code in the Microsoft stylesheetsis
located between a pair of tags looking like this:
<xsl:when test="b:Citation"> <= only one of those
...
</xsl:when> <= dozens of those, make sure you have the matching