Tag Name as Placeholder

Mar 16, 2010 at 12:13 PM
Edited Mar 16, 2010 at 12:17 PM
Hi,
I am writing my Master Thesis and I have some problems displaying the Tag Name.
All I want is that instead of the standard display of the source - "(Author Last name, Year)" - I would like to display it like this: "[Tag Name]".
I am using my own Bibliography style.
I was able to change the brackets from () to [].
But I can not display the Tag Name.
My code:
<!-- Defines the output format as (Author, Year)-->
<xsl:text>[</xsl:text>
<xsl:value-of select="b:Author/b:Author/b:NameList/b:Person/b:Last"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="b:Year"/>
<xsl:text>]</xsl:text>

Hope someone can help.
Matic
Coordinator
Mar 16, 2010 at 1:00 PM

It doesn't look like this has anything to do with BibWord.

Anyway, can't you just select the tag like you are now selecting the name and the year? So something like:

<xsl:text>[</xsl:text> 
<xsl:value-of select="b:Tag"/> 
<xsl:text>]</xsl:text>
Mar 16, 2010 at 1:35 PM
Unfortunately not.
I don't know why, but this just will not work.
Coordinator
Mar 16, 2010 at 6:21 PM

Does the original code work? I'm talking about the one with the author and the year. Do they display correctly?

Assuming the original code worked, what does your code display?

Do you have access to the entire b:Source element? If it's a watered down version it might not have a b:Tag child. It would be strange, but it is possible as you only posted a real short piece of code which gives almost nothing to work with.

As you are clearly starting from another style, have you tried contacting the author of that style?

On a side note, displaying the brackets directly like that will cause problems when you want to combine multiple citations: [tag1, tag2, tag3]

Mar 17, 2010 at 11:05 AM

I think it could be possible that it does not have the whole b:Source element.

But NO idea how to make this work...

The original code works yes.

 

The whole file can be viewed here.

Coordinator
Mar 17, 2010 at 12:24 PM

For starters,

<xsl:value-of select="b:Tag/b:Name"/>

does not exist. The tag field is stored inside the b:Tag element.

Next, at that point in the code, you are not inside the b:Source element, hence accessing its children (b:Tag) won't work at all. A quick and dirty way that will work is:

<xsl:value-of select="/b:Citation/b:Source/b:Tag"/>

I get the feeling that you have little to no xslt experience. It is of course your choice to proceed as you are, but you might want to consider using the BibWord template to start from. It should make your life easier.