Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XSL in Word 2007 bibliography, changing

154 views
Skip to first unread message

mitja decman

unread,
Sep 17, 2007, 4:38:10 AM9/17/07
to
Hi,
there is an XSL file that transforms XML bibilography list in Word 2007 to a
specific form like APA, SIO690, Chicago citation style. I tried to change it
a bit to suit my publishers need. But ...

Could please someone tell me where to find more info to understand this
line:
<xsl:value-of
select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/b:RetrievedFromCap"/>

Because the result of this function is "Retrived %1, fom %2". I want to
change this caption to "Accessible on %2, on %1".

<xsl:template name="templ_str_RetrievedFromCap">
<xsl:param name="LCID"/>
<xsl:variable name="_LCID">
<xsl:call-template name="localLCID">
<xsl:with-param name="LCID" select="$LCID"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of
select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/b:RetrievedFromCap"/>
</xsl:template>

Thanks
Mitja


George Bina

unread,
Sep 17, 2007, 5:10:36 AM9/17/07
to
Hi Mitja,

<xsl:value-of
select="/*/b:Locals/b:Local[@LCID=$_LCID]/b:Strings/
b:RetrievedFromCap"/>

/* selects the root element whatever name that has
/b:Locals selects the element with the local name Locals from the
namespace that the b prefix maps to
/b:Local[@LCID=$_LCID] selects the element with the name b:Local that
has an attribute named LCID whose value is equal with whatever value
the _LCID variable has
/b:Strings selects the b:Strings element
/b:RetrievedFromCap selects the b:RetrievedFromCap element

So the value-of instruction will output the value of the
b:RetrievedFromCap element that is found inside a b:Strings inside a
b:Local inside b:Locals inside the root element.

If you want to change that value then you need to know what values are
expected there.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina - http://aboutxml.blogspot.com/
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

JAd...@gmail.com

unread,
Oct 4, 2007, 11:38:37 AM10/4/07
to
Hi Mitja,

When generating a bibliography, Word 2007 sends to the XSL style file
a XML tree like this:


<b:Bibliography>
<b:Locals>
<b:DefaultLCID>1033</b:DefaultLCID>
<b:Local LCID="1033">
...
...
</b:Local>
<b:Local LCID="3082">
...
...
</b:Local>
...
...
</b:Locals>
<b:Source>
...
...
</b:Source>
<b:Source>
...
...
</b:Source>
...
...
</b:Bibliography>


The subtree "b:Locals" contains sets of strings for different
languages (LCID) and some of them according to the bibliography style
selected (APA, MLA, etc.). The line <xsl:value-of select="/*/b:Locals/
b:Local[@LCID=$_LCID]/b:Strings/b:RetrievedFromCap"/> reads the value
of the string named "RetrievedFromCap" ("RetrievedFrom" with capital
initial character) in the "b:Locals" subtree for the language returned
by the function "localLCID" and stored in the variable "_LCID" (i.e.:
the language selected for the source or, if blank, the default
language of the document [the value of the tag <b:DefaultLCID>]).

To my mind, there are two solutions to change the caption "Retrieved
%1, from %2" to "Accesible on %2, on %1":

(1) To replace the function "templ_str_RetrievedFromCap" with
something like this:


<xsl:template name="templ_str_RetrievedFromCap">
<xsl:value-of select="'Accesible on %2, on %1'"/>
</xsl:template>


or, checking the _LCID variable, like this:


<xsl:template name="templ_str_RetrievedFromCap">
<xsl:param name="LCID"/>
<xsl:variable name="_LCID">
<xsl:call-template name="localLCID">
<xsl:with-param name="LCID" select="$LCID"/>
</xsl:call-template>
</xsl:variable>

<xsl:choose>
<xsl:when test "$_LCID" = "1033">
<xsl:value-of select="'Accesible on %2, on %1'"/>
</xsl:when>
<xsl:when test "$_LCID" = "3082">
<xsl:value-of select="'Consultado el %2 en %1'"/>
</xsl:when>
</xsl:choose>
</xsl:template>


(2) To build, in a customized XSL file, a customized "b:Locals"
subtree containing the values of your personal bibliography style for
one or several languages. You can see an example of customized XSL
file for Word 2007 (it includes comments, but in Spanish) at
http://www.fermu.com/content/view/541/1/lang,es/

Please, excuse my poor English skill

Chuso

JAd...@gmail.com

unread,
Oct 4, 2007, 12:44:27 PM10/4/07
to
Hi again,

I'm seeing two errata in my previous post:

<xsl:when test"$_LCID" = "1033"> the line must say: <xsl:when
test="$_LCID = '1033'">
<xsl:when test"$_LCID" = "3082"> the line must say: <xsl:when
test="$_LCID = '3082'">

Sorry,

Chuso

0 new messages