MARCEDIT-L Archives

July 2015

MARCEDIT-L@LISTSERV.GMU.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Terry Reese <[log in to unmask]>
Reply To:
MarcEdit support in technical and instructional matters <[log in to unmask]>
Date:
Wed, 15 Jul 2015 11:35:51 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (95 lines)
So without having any idea what your output should look like -- it's hard to guess as to what you are hoping to get back.  I can tell you your templates are too broad -- apply-templates has an implied rule that it matches not just direct children, but grandchildren as well, so all data is being output into the file.  For example if you are looking for a text output, where the file looks something like this:
=LDR  00000nam  2200000Ia 4500
=300  \\$ahttp://aims.fao.org/aos/agrovoc/c_10
=300  \\$ahttp://aims.fao.org/aos/agrovoc/c_10
=300  \\$ahttp://aims.fao.org/aos/agrovoc/c_10
=300  \\$ahttp://aims.fao.org/aos/agrovoc/c_10
=300  \\$ahttp://aims.fao.org/aos/agrovoc/c_10

=LDR  00000nam  2200000Ia 4500

You'd use the following stylesheet.

--tr



<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:skosxl="http://www.w3.org/2008/05/skos-xl#"
xmlns:marc="http://www.loc.gov/MARC21/slim">
<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>

<xsl:template match="root">
   <xsl:for-each select="rdf:RDF">
	<xsl:text>=LDR  00000nam  2200000Ia 4500</xsl:text>
	<xsl:text>&#13;&#10;</xsl:text>
	<xsl:apply-templates select="rdf:Description/skos:narrowMatch" />
	<xsl:text>&#13;&#10;</xsl:text>
   </xsl:for-each>
</xsl:template>


<xsl:template match="skos:narrowMatch">
  <xsl:text>=300  \\$a</xsl:text><xsl:value-of select="@rdf:resource" />
  <xsl:text>&#13;&#10;</xsl:text>
</xsl:template>

 	
</xsl:stylesheet>

-----Original Message-----
From: MarcEdit support in technical and instructional matters [mailto:[log in to unmask]] On Behalf Of Eugene Espinoza
Sent: Wednesday, July 15, 2015 8:06 AM
To: [log in to unmask]
Subject: Re: [MARCEDIT-L] RDF or XML to MARC

Hi all again! I added root '<root>' tag as placeholder for my record. And I have the following preliminary XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:skosxl="http://www.w3.org/2008/05/skos-xl#">

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

<xsl:template match="rdf:RDF">
	=LDR
	<xsl:apply-templates />
	    	   	    </xsl:template>
	       	    	   	   	    
		<xsl:template match="rdf:Description">			
=300  \\$a<xsl:apply-templates select="skos:narrowMatch/@skos:narrowMatch"/>
	</xsl:template>

 	
</xsl:stylesheet>

However I'm getting the following snapshot:
<?xml version="1.0" encoding="utf-8"?>
	=LDR
				
=300  \\$aآبیس ماریزی‌ای大白叶冷杉Abies mariesiiAbies mariesiiAbies mariesiiAbies mariesiiAbies mariesiiएबीस मैरीइसीAbies mariesiiAbies mariesiiAbies mariesiiAbies mariesiiAbies mariesiiAbies mariesiiAbies mariesiiAbies mariesiiAbies mariesiiオオシラビソ、アオモリトドマツشوح ماريزيAbies numidicaAbies numidicaشوح نوميديAbies numidicaAbies numidicaAbies numidicaAbies numidicaAbies numidicaAbies numidicaAbies numidicaAbies numidicaAbies numidicaएबीस न्यूमीडिकाアルゼリアモミ、アルジェリアモミآبیس نومیدیکاAbies numidica阿尔及利亚冷杉Abies numidicaAbies numidicaشوح سيبيري西伯利亚冷杉एबीस सिबिरिकाAbies sibiricaAbies sibiricaAbies sibiricaAbies sibiricaAbies sibiricaAbies sibiricaAbies sibiricaAbies sibiricaAbies sibiricaAbies sibiricaAbies sibiricaAbies sibiricaAbies sibiricaآبیس سیبیریکاAbies sib!
 iricaシベリアモミAbies fraseri南部香脂冷杉Abies fraseriAbies fraseriAbies fraseriAbies fraseriAbies fraseriAbies fraseriAbies fraseriAbies fraseriAbies fraseriAbies fraseriAbies fraseriAbies fraseriAbies fraseriएबीस फ्रेसेरीフレセールモミآبیس فراسریشوح فرازيريAbies concolor科罗拉多冷杉Abies concolorAbies concolorشوح متساوي الألوانAbies concolorAbies concolorAbies concolorAbies concolorAbies concolorAbies concolorAbies concolorAbies concolorAbies concolorAbies concolorAbies concolorآبیس کونکولورएबीस काँनकलर콜로라도전나무コロラドモミAbies pindrowAbies pindrowAbies pindrowAbies pindrowAbies pindrowAbies pindrow	

which tells me that my xslt goes through all the iteration of rdf:resource. I've actually tried first "xsl:for-each select=" however still I'm getting same result only that the initial rdf:resource "http://aims.fao.org/aos/agrovoc/c_10" which is what I really need to show=300  also shows "آبیس ماریزی‌ای大白叶冷杉Abies mariesiiAbies mariesiiAbies mariesiiAbies mariesiiAbies mariesii..." 

Still very much relatively new with XSLT and I hope you can help me with my problem.
Thanks in advance and God bless!

________________________________________________________________________

This message comes to you via MARCEDIT-L, a Listserv(R) list for technical and instructional support in MarcEdit.  If you wish to communicate directly with the list owners, write to [log in to unmask] To unsubscribe, send a message "SIGNOFF MARCEDIT-L" to [log in to unmask]

________________________________________________________________________

This message comes to you via MARCEDIT-L, a Listserv(R) list for technical and instructional support in MarcEdit.  If you wish to communicate directly with the list owners, write to [log in to unmask] To unsubscribe, send a message "SIGNOFF MARCEDIT-L" to [log in to unmask]

ATOM RSS1 RSS2