473,395 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Extracting Citations

1
Hello everyone,

I am a newbie to XSLT, and would appreciate any feedback from this experienced community.

I'm attempting to extract inline citations from my document, put them at the end of the document, deduplicate them, and assign them the proper references.

My document looks something like this:

Expand|Select|Wrap|Line Numbers
  1. <section>
  2. <para> This is my content <citation>Joe Smith, 1997 Journal of Medicine.</citation> This is more content <citation>Jane Doe, 2003, Cosmopolitan</citation>
  3. </para>
  4. <para> Even more content <citation>Joe Smith, 1997 Journal of Medicine.</citation>
  5. </para>
  6. </section>
The output I'm looking to have is the following:

Expand|Select|Wrap|Line Numbers
  1. <section>
  2. <para> This is my content (1) This is more content (2)</para>
  3. <para> Even more content (1)</para>
  4. </section>
  5. <section>
  6. <title> References </title>
  7. <listitem>1 - Joe Smith, 1997 Journal of Medicine. </listitem>
  8. <listitem>2 - Jane Doe, 2003, Cosmopolitan</listitem>
  9. </section>
I have done the following, which spits out the entire xml, plus my duplicated citations at the end of te document. At this point, I'm at a loss on how to dedup them, and more importantly, how to cross reference them and substitude the number of the reference.

Thank you, any help is greatly appreciated.

Expand|Select|Wrap|Line Numbers
  1. <xsl:template match="/">
  2.         <xsl:copy-of select = "."/>
  3.         <xsl:apply-templates select="//citation">     
  4.             <xsl:sort select="."/>
  5.         </xsl:apply-templates>         
  6.     </xsl:template>
  7.  
  8.     <xsl:template match="//citation">
  9.             <xsl:copy-of select = "."/>
  10.     </xsl:template>
Oct 3 '05 #1
0 1660

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Nazgul | last post by:
Hi! I want to implement a small tool in Python for distributing "patches" and I need Your advice. This application should be able to package all files chosen by a user into a self-extracting.exe...
10
by: Calvin FONG | last post by:
Dear all, Are there any utility that can be call by python to create self extracting zip file. I'm now using the powerarchiever. But the command line options aren't flexible enough. Basically, I...
2
by: Avi | last post by:
hi, Can anyone tell me what the problem is and how to solve it The following piece of code resides on an asp page on the server and is used to download files from the server to the machine...
5
by: Michael Hill | last post by:
Hi, folks. I am writing a Javascript program that accepts (x, y) data pairs from a text box and then analyzes that data in various ways. This is my first time using text area boxes; in the past,...
1
by: Cognizance | last post by:
Hi gang, I'm an ASP developer by trade, but I've had to create client side scripts with JavaScript many times in the past. Simple things, like validating form elements and such. Now I've been...
0
by: k_nil | last post by:
I have a link on my web page for a self extracting executable file placed on the server. When the link is clicked, 1) i could see dialog box with open or save options 2) when open clicked, self...
0
by: Jean-François Michaud | last post by:
Hello all, I need to generate (SHEET X of Y) in titles for figures contained in a section (I already generate page A of B at the bottom right of every page in the document). Is there a way...
2
by: bjm | last post by:
I created a self extracting zip file with about 9000 files in it. I extracted it manually from the command line without a problem. However, when I tried to do the same extraction at the same...
6
by: Werner | last post by:
Hi, I try to read (and extract) some "self extracting" zipefiles on a Windows system. The standard module zipefile seems not to be able to handle this. False Is there a wrapper or has...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.