[XML4Lib] R: Style Sheet for RefWorks Display

fmeschini at tin.it fmeschini at tin.it
Wed Nov 7 05:18:09 EST 2007



----Messaggio originale----
Da: xml4lib-request at webjunction.org
Data: 
6-nov-2007 6.00 PM
A: <xml4lib at webjunction.org>
Ogg: XML4Lib Digest, 
Vol 30, Issue 3

Send XML4Lib mailing list submissions to
	
xml4lib at webjunction.org

To subscribe or unsubscribe via the World Wide 
Web, visit
	http://lists.webjunction.org/mailman/listinfo/xml4lib
or, 
via email, send a message with subject or body 'help' to
	xml4lib-
request at webjunction.org

You can reach the person managing the list at
	
xml4lib-owner at webjunction.org

When replying, please edit your Subject 
line so it is more specific
than "Re: Contents of XML4Lib digest..."


Today's Topics:

   1. Style Sheet for RefWorks Display (Hutchinson, 
Alvin)


----------------------------------------------------------------------

Message: 1
Date: Tue, 6 Nov 2007 11:34:45 -0500
From: "Hutchinson, 
Alvin" <HUTCHINSONA at si.edu>
Subject: [XML4Lib] Style Sheet for RefWorks 
Display
To: <web4lib at webjunction.org>, <xml4lib at webjunction.org>
Message-ID:
	<E89010005DD2A14C9BA6B4AF11BF84B89E31A3 at SI-ECL03.US.SINET.
SI.EDU>
Content-Type: text/plain;	charset="US-ASCII"

Please excuse the 
cross posting . . . .

I am creating a bibliography of staff 
publications using the web-based
bibliographic management software, 
RefWorks which can export to
tab-delimited or XML formats (among other 
things).

Of course I can import a delimited file into a SQL database 
and serve
the content up via scripting language, but I am wondering 
whether the
XML format might offer some more flexibility or other 
advantages. Any
ideas?

My questions:

>The master_bibliography.xml 
file will probably grow to 30-50mb or more.
>Is this too large to 
adequately filter and display data on several dozen
>different pages 
using XSLT or some other method?

Do you mean a static display, 
generating in a batch way html pages or a dynamic one, displaying and 
filtering the data on the fly.

Do already know what kind of 
sofware/framework do you want to use? eXist could be suitable for this 
aim, at least you can chunck the big file in smaller parts.

>Has 
anyone worked with RefWorks-exported XML? Sample data is shown here:
><a1>Author, First</a1>
><a1>Author, Second</a1>
><a1>Author, 
Third</a> 
>Etc.
><t1>Title of article or book chapter</t1>
><yr>Pub 
Year</yr>
>Etc.

>I have written simple style sheets but I'm afraid I 
don't know how to
>display repeated elements like <a1>. Any hints?

do 
you want to display something like

"Author, first; Author, second; 
Author Thid." or something like " F. Author, S. Author, T. Author"?

anyway you should work on the preceding:: sibling and following::
sibling axis.

When you meet the first <a1> element then you process 
all the other using the following::sibling, while when you meet the 
following ones you do nothing, (checking that the have a preceding::
sibling)

something like

    <xsl:template match="a1">
        <xsl:
choose>
            <xsl:when test="preceding-sibling::a1" />
            <xsl:otherwise>
                <xsl:value-of select="."
/>    
                    <xsl:for-each select="following-sibling::a1"
>
                        <xsl:text>, </xsl:text>
                        <xsl:value-of select="."/>
                    
</xsl:for-each>
          <xsl:text>.</xsl:text>
     </xsl:otherwise>
    </xsl:choose>
    </xsl:template>

If you want also to format the 
display of the name some work should be done using the substring 
functions.

Hope it helps and it was what you were asking for

>Thanks 
in advance for any advice and please pardon me if this is a dumb 
question.

My grandma always said that there were not dumb questions, 
but only dumb answers :-)

Fede


More information about the XML4Lib mailing list