我是一名图书管理员,尝试通过将我们的记录从广泛使用的平台转换为Excel来执行收集分析。之前我已经获得了一些帮助,可以在几个月内使用XSL样式表。XSL样式表不再适用于Excel
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" />
<xsl:strip-space elements="*" />
<xsl:template match="/">
<record>
<xsl:for-each select="//catalog">
<itemline>
<callNumber>
<xsl:value-of select="call/callNumber" />
</callNumber>
<title>
<xsl:value-of select="marc/marcEntry[@label='Title']" />
</title>
<yearOfPublication>
<xsl:value-of select="yearOfPublication" />
</yearOfPublication>
<xsl:for-each select="call/item/totalCheckouts">
<xsl:copy-of select="." />
</xsl:for-each>
<dateLastUsed>
<xsl:value-of select="call/item/dateLastUsed" />
</dateLastUsed>
<location>
<xsl:value-of select="call/item/location" />
</location>
</itemline>
</xsl:for-each>
</record>
</xsl:template>
</xsl:stylesheet>
此代码不再适用于系统生成的新报告。我希望它将记录中的所有信息都返回到Excel中的一行,但现在它会将每条信息放在一个新行中,从而无法操作数据。
这里是一个老唱片的一个例子:
<catalog>
<flexibleKey>l55041415</flexibleKey>
<numberOfTitleHolds>0</numberOfTitleHolds>
<totalHolds>0</totalHolds>
<numberOfCallNumbers>1</numberOfCallNumbers>
<bibliographicLevel>FULL</bibliographicLevel>
<catalogFormat>MARC</catalogFormat>
<createdBy>TECH</createdBy>
<dateCreated>2009-11-09</dateCreated>
<dateCataloged>2009-01-29</dateCataloged>
<modifiedBy>TECH</modifiedBy>
<dateModified>2009-11-12</dateModified>
<catalogKey>129825</catalogKey>
<yearOfPublication>1953</yearOfPublication>
<marc>
<marcEntry tag="100" label="Personal Author" ind="1 ">Colonius, Lillian.</marcEntry>
<marcEntry tag="245" label="Title" ind="10">At the bakery/by Lillian Colonius and Glenn W. Schroeder.</marcEntry>
<marcEntry tag="260" label="Publication info" ind=" ">Los Angeles, CA : Melmont Pub., Inc., c1953.</marcEntry>
<marcEntry tag="300" label="Physical description" ind=" ">24 p. : ill. ; 24 cm.</marcEntry>
<marcEntry tag="650" label="Subject term" ind=" 1">Bread.</marcEntry>
</marc>
<call>
<callNumber>PZ 10.C694 ATG 1958</callNumber>
<library>UOG-RFK</library>
<item>
<numberOfCharges>0</numberOfCharges>
<numberOfBills>0</numberOfBills>
<numberOfCopyHolds>0</numberOfCopyHolds>
<totalCharges>0</totalCharges>
<inhouseCharges>1</inhouseCharges>
<totalCheckouts>0</totalCheckouts>
<totalRenewals>0</totalRenewals>
<intervalCheckouts>0</intervalCheckouts>
<intervalRenewals>0</intervalRenewals>
<intervalStartDate></intervalStartDate>
<recirculate>YES</recirculate>
<dateLastUsed>2017-02-17</dateLastUsed>
<isReserveItem>false</isReserveItem>
<copyNumber>1</copyNumber>
<itemID>33296000201835</itemID>
<library>UOG-RFK</library>
<libraryDescription>University of Guam - RFK Memorial Library</libraryDescription>
<location>JUVENILE</location>
<homeLocation>JUVENILE</homeLocation>
<price currency="$">30.00</price>
<category1>JUVENILE</category1>
<type>JUVENILE</type>
<numberOfPieces>1</numberOfPieces>
<dateCreated>2009-11-09</dateCreated>
<isPermanent>true</isPermanent>
</item>
</call>
</catalog>
这里是一个新的记录的例子:
<catalog>
<catalogKey>59433</catalogKey>
<yearOfPublication>1999</yearOfPublication>
<marc>
<marcEntry tag="100" label="Personal Author" ind="1 ">Rose, Ed (Edwin)</marcEntry>
<marcEntry tag="245" label="Title" ind="10">50 ways to teach your learner : activities and interventions for building high-performance teams/by Ed Rose with Steve Buckley.</marcEntry>
<marcEntry tag="260" label="Publication info" ind=" ">San Francisco, CA : Jossey-Bass, c1999.</marcEntry>
<marcEntry tag="300" label="Physical description" ind=" ">xvii, 264 p. : ill. ; 28 cm.</marcEntry>
<marcEntry tag="650" label="Subject term" ind=" 0">Teams in the workplace--Training of.</marcEntry>
<marcEntry tag="650" label="Subject term" ind=" 0">Experiential learning.</marcEntry>
<marcEntry tag="700" label="Added Entry-Personal Name" ind="10">Buckley, Steve, 1960-</marcEntry>
</marc>
<call>
<callNumber>HD 66 .R65 1999</callNumber>
<library>UOG-RFK</library>
<item>
<numberOfCharges>0</numberOfCharges>
<numberOfBills>0</numberOfBills>
<numberOfCopyHolds>0</numberOfCopyHolds>
<totalCharges>3</totalCharges>
<inhouseCharges>0</inhouseCharges>
<totalCheckouts>0</totalCheckouts>
<totalRenewals>0</totalRenewals>
<intervalCheckouts>0</intervalCheckouts>
<intervalRenewals>0</intervalRenewals>
<intervalStartDate></intervalStartDate>
<recirculate>YES</recirculate>
<dateLastUsed>2003-12-17</dateLastUsed>
<isReserveItem>false</isReserveItem>
<copyNumber>1</copyNumber>
<itemID>33296001664171</itemID>
<library>UOG-RFK</library>
<libraryDescription>University of Guam - RFK Memorial Library</libraryDescription>
<location>MAIN</location>
<homeLocation>MAIN</homeLocation>
<price currency="$">42.00</price>
<category1>MAIN</category1>
<type>BOOK</type>
<numberOfPieces>1</numberOfPieces>
<dateCreated>2002-05-22</dateCreated>
<isPermanent>true</isPermanent>
</item>
</call>
</catalog>
我没有看到任何重大变化的结构这些记录会导致这种变化,并且不能很好地了解XSLT,甚至无法开始排除故障。
您可以分享输出和期望输出的差异吗? –
我不确定这个问题是否与XSLT有关。它生成的XML实际上是如何导入到Excel中的? –