[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Selecting Bits, Dumping the Rest

Subject: RE: Selecting Bits, Dumping the Rest
From: "Fox, Michael" <michael.fox@xxxxxxxx>
Date: Wed, 26 Apr 2000 10:14:56 -0500
xsl template match marc record
John Gardner asked

>  -----------What is the basic principle I'm missing here?  Usually it's
>  that I _can't_ get the other stuff to come through b/c I'm screwing up
>  with apply-templates.  Now I got it backwards!  Note, I do have a
> successful establishment of the foa element based on the variables set up.
> 
> 
> 
Try this.  It achieves the output you specified.  I don't follow the request
in your last paragraph

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="marc/record" >
<xsl:element name="{control-field[@tag='001']}">
<xsl:value-of select="text()" />


<xsl:for-each select="data-field [@tag='773']/subfield[@code='x']">
<issn_x>
<xsl:apply-templates select="text()" />
</issn_x>
</xsl:for-each>

<!-- this part distinguishes the first page of the article as an
"foa"element -->

<xsl:for-each select="data-field[@tag='773']/subfield[@code='g']">

<citation_g>
<xsl:apply-templates select="text()" />
<xsl:variable name="ispartof" select="normalize-space(.)"/>
<xsl:variable name="numseqs" select="substring-after($ispartof,'p. ')"/>
<xsl:variable name="start" 
select="number(substring-before($numseqs,'-'))"/>

<foa>
<xsl:value-of select="$start" />
</foa>

</citation_g>
</xsl:for-each>
</xsl:element>
</xsl:template>

</xsl:stylesheet>

Michael

Michael Fox
Acting Assistant Director for Library and Archives
Minnesota Historical Society
345 Kellogg Blvd West
St. Paul MN 55102-1906
phone: 651-296-1014
fax:  651-296-9961
michael.fox@xxxxxxxx




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.