getAllStatuses(); $renderer = get_active_status_renderer(); echo ''; } function topic_icons_css() { echo "\n"; } function topic_icons_label( $label ) { global $topic; if (bb_is_front() || bb_is_forum() || bb_is_view() || bb_is_tag()) { $icon_set_name = topic_icons_get_active_icon_set(); $icon_set_url = ICON_SET_URL_BASE . $icon_set_name; $status = get_active_status_interpreter()->getStatus(bb_get_location(), $topic); $renderer = get_active_status_renderer(); $image = $renderer->renderStatus($status); $tooltip = $renderer->renderStatusTooltip($status); $exists = file_exists(dirname(__FILE__).'/icon-sets/'.$icon_set_name.'/'.$image); if (!$exists) { return sprintf(__('
%s
%s'), get_topic_link($topic->topic_id), ICON_SET_URL_BASE.'/empty.png', ICON_WIDTH, ICON_HEIGHT, $tooltip, $label); } else if (strlen($tooltip) > 0) { return sprintf(__('
%s%s
%s'), get_topic_link($topic->topic_id), $icon_set_url.'/'.$image, ICON_WIDTH, ICON_HEIGHT, $tooltip, $tooltip, $label); } else { return sprintf(__('
%s
%s'), get_topic_link($topic->topic_id), $icon_set_url.'/'.$image, ICON_WIDTH, ICON_HEIGHT, $tooltip, $label); } } return $label; } function topic_icons_init( ) { remove_filter('bb_topic_labels', 'bb_closed_label', 10); remove_filter('bb_topic_labels', 'bb_sticky_label', 20); add_filter('bb_topic_labels', 'topic_icons_label', 11); add_action('bb_head', 'topic_icons_css'); add_action('bb_admin_menu_generator', 'topic_icons_admin_page_add'); add_action('bb_admin-header.php', 'topic_icons_admin_page_process'); topic_icons_register_status_interpreter('default', new DefaultStatusInterpreter(BUSY_THRESHOLD)); topic_icons_register_status_renderer('default', new DefaultStatusRenderer()); } topic_icons_init(); ?> Digital Humanities Questions & Answers » Topic: Best way to create COinS or other metadata from TEI using XSLT? http://digitalhumanities.org/answers/topic/best-way-to-create-coins-or-other-metadata-from-tei-using-xslt Digital Humanities Questions & Answers » Topic: Best way to create COinS or other metadata from TEI using XSLT? en-US Sat, 23 Mar 2019 06:57:34 +0000 http://bbpress.org/?v=1.0.2 <![CDATA[Search]]> q http://digitalhumanities.org/answers/search.php laura.mandell@gmail.com on "Best way to create COinS or other metadata from TEI using XSLT?" http://digitalhumanities.org/answers/topic/best-way-to-create-coins-or-other-metadata-from-tei-using-xslt#post-1494 Mon, 19 Dec 2011 19:49:16 +0000 laura.mandell@gmail.com 1494@http://digitalhumanities.org/answers/ <p><em>Replying to @Karin Dalziel's <a href="http://digitalhumanities.org/answers/topic/best-way-to-create-coins-or-other-metadata-from-tei-using-xslt#post-137">post</a>:</em></p> <p>Here is what I put in my XSLT param file, from the TEI-provided xslts, in order to generate COINS metadata in HTML pages that have been generated from a TEI P5 master:</p> <p>&lt;!-- COINS Metadata --&gt;<br /> &lt;xd:doc class="hook"&gt;<br /> &lt;xd:short&gt;for adding COINS metadata&lt;/xd:short&gt;<br /> &lt;xd:detail&gt;coins metadata for the edition generated at <a href="http://generator.ocoins.info/.&#038;lt;/xd:detail&#038;gt" rel="nofollow">http://generator.ocoins.info/.&#038;lt;/xd:detail&#038;gt</a>;<br /> &lt;/xd:doc&gt;<br /> &lt;!-- Here is what it should look like when in the HTML: &lt;span<br /> class="Z3988"<br /> title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator<br /> &amp;rft.genre=article&amp;rft.atitle=TITLE&amp;rft.title=Poetess+Archive%3A+The+Criticism+Archive&amp;rft.stitle=PACA<br /> &amp;rft.date=2011-01-01&amp;rft.aulast=AUTHORLAST&amp;rft.aufirst=AUTHORFIRST&amp;rft.au=AUTHORFIRST+AUTHORLAST&amp;rft.au=Mary+Waters"&gt;<br /> (Insert Default Text Here)<br /> &lt;/span&gt;</p> <p> --&gt;<br /> &lt;xsl:template name="COINS"&gt;<br /> &lt;xsl:variable name="TITLE"&gt;<br /> &lt;xsl:value-of select="normalize-space(ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblStruct/tei:analytic/tei:title)"/&gt;<br /> &lt;/xsl:variable&gt;<br /> &lt;xsl:variable name="AUTHORLAST"&gt;<br /> &lt;xsl:value-of select="normalize-space(substring-before(ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblStruct/tei:analytic/tei:author/tei:name, ','))"/&gt;<br /> &lt;/xsl:variable&gt;<br /> &lt;xsl:variable name="AUTHORFIRST"&gt;<br /> &lt;xsl:value-of select="normalize-space(substring-before(substring-after(ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblStruct/tei:analytic/tei:author/tei:name, ','), ','))"/&gt;<br /> &lt;/xsl:variable&gt;<br /> &lt;xsl:text disable-output-escaping="yes"&gt;&lt;![CDATA[&lt;span<br /> class="Z3988"<br /> title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rfr_id=info%3Asid%2Focoins.info%3Agenerator<br /> &amp;rft.genre=article&amp;rft.atitle=]]&gt;&lt;/xsl:text&gt;&lt;xsl:value-of select="translate($TITLE, ' ', '+')"/&gt;<br /> &lt;xsl:text disable-output-escaping="yes"&gt;&lt;![CDATA[&amp;rft.title=Poetess+Archive%3A+The+Criticism+Archive&amp;rft.stitle=PACA<br /> &amp;rft.date=]]&gt;&lt;/xsl:text&gt;&lt;xsl:value-of select="translate(normalize-space(ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:sourceDesc/tei:biblStruct/tei:monogr/tei:imprint/tei:date/@when), ' ', '+')"/&gt;<br /> &lt;xsl:text disable-output-escaping="yes"&gt;&lt;![CDATA[&amp;rft.aulast=]]&gt;&lt;/xsl:text&gt;<br /> &lt;xsl:value-of select="translate($AUTHORLAST, ' ', '+')"/&gt;<br /> &lt;xsl:text disable-output-escaping="yes"&gt;&lt;![CDATA[&amp;rft.aufirst=]]&gt;&lt;/xsl:text&gt;<br /> &lt;xsl:value-of select="translate($AUTHORFIRST, ' ', '+')"/&gt;<br /> &lt;xsl:text disable-output-escaping="yes"&gt;&lt;![CDATA[&amp;rft.au=]]&gt;&lt;/xsl:text&gt;<br /> &lt;xsl:value-of select="concat($AUTHORFIRST, '+', $AUTHORLAST)"/&gt;<br /> &lt;xsl:text disable-output-escaping="yes"&gt;&lt;![CDATA[&amp;rft.au=Mary+Waters"&gt; &lt;/span&gt;]]&gt;&lt;/xsl:text&gt;<br /> &lt;/xsl:template&gt; </p> Patrick Murray-John on "Best way to create COinS or other metadata from TEI using XSLT?" http://digitalhumanities.org/answers/topic/best-way-to-create-coins-or-other-metadata-from-tei-using-xslt#post-215 Wed, 29 Sep 2010 14:41:52 +0000 Patrick Murray-John 215@http://digitalhumanities.org/answers/ <p><em>Replying to @Wayne Graham's <a href="http://digitalhumanities.org/answers/topic/best-way-to-create-coins-or-other-metadata-from-tei-using-xslt#post-135">post</a>:</em></p> <p>Want to echo and reinforce Wayne's point about how the header elements are encoded. Not sure the degree to which this is others' experience, but I've seen wide variation there. I'm guessing that you might need to spend some time understanding the original encoding as you move to producing those mappings. Hopefully the info to guide you will be there in the encoding description. </p> <p>Good luck! </p> Dorothea Salo on "Best way to create COinS or other metadata from TEI using XSLT?" http://digitalhumanities.org/answers/topic/best-way-to-create-coins-or-other-metadata-from-tei-using-xslt#post-199 Wed, 29 Sep 2010 13:30:55 +0000 Dorothea Salo 199@http://digitalhumanities.org/answers/ <p>COinS is awful because OpenURL is awful, but it works. Something else you might want to look at is <a href="http://research.talis.com/2005/erdf/wiki/Main/RdfInHtml">embedded RDF</a>. </p> unsworth on "Best way to create COinS or other metadata from TEI using XSLT?" http://digitalhumanities.org/answers/topic/best-way-to-create-coins-or-other-metadata-from-tei-using-xslt#post-139 Fri, 24 Sep 2010 05:05:26 +0000 unsworth 139@http://digitalhumanities.org/answers/ <p><em>Replying to @Karin Dalziel's <a href="http://digitalhumanities.org/answers/topic/best-way-to-create-coins-or-other-metadata-from-tei-using-xslt#post-137">post</a>:</em></p> <p>Coins is what you want if you aim to integrate with Zotero. Or park on the street in Chicago. </p> Karin Dalziel on "Best way to create COinS or other metadata from TEI using XSLT?" http://digitalhumanities.org/answers/topic/best-way-to-create-coins-or-other-metadata-from-tei-using-xslt#post-137 Thu, 23 Sep 2010 21:23:19 +0000 Karin Dalziel 137@http://digitalhumanities.org/answers/ <p>We are using TEI P4 or P5 (depending on the age of the file), and the Saxon 9 processor (the free one, is that 9b?) I think the method you described will work- I'll give it a try.</p> <p>Followup question: is COinS still the recommended data format for adding metadata of items to pages? </p> Wayne Graham on "Best way to create COinS or other metadata from TEI using XSLT?" http://digitalhumanities.org/answers/topic/best-way-to-create-coins-or-other-metadata-from-tei-using-xslt#post-136 Thu, 23 Sep 2010 18:56:15 +0000 Wayne Graham 136@http://digitalhumanities.org/answers/ <p>BTW, if you don't have URL encoding available on the processor, check out this xslt <a href="http://skew.org/xml/stylesheets/url-encode/url-encode.xsl" rel="nofollow">http://skew.org/xml/stylesheets/url-encode/url-encode.xsl</a> </p> Wayne Graham on "Best way to create COinS or other metadata from TEI using XSLT?" http://digitalhumanities.org/answers/topic/best-way-to-create-coins-or-other-metadata-from-tei-using-xslt#post-135 Thu, 23 Sep 2010 18:50:44 +0000 Wayne Graham 135@http://digitalhumanities.org/answers/ <p>I would definitely categorize this as a programming question; the metadata is there, now you want to do something else with it.</p> <p>The answer is, well, it depends. Really this depends on what version of TEI you're using and how the header elements are encoded. The "hard" part of this is really encoding the special characters contained in the text (spaces, etc.). There is, however, a nice function (I believe it's in Saxon) named url:encode(string). </p> <p>As an approach, take the fields you want to provide to the z39.88 standard (<a href="http://ocoins.info/" rel="nofollow">http://ocoins.info/</a>) and assign them in to key-value pairs (e.g. &lt;xsl:variable name="btitle" value="/TEI.2/teiHeader/fileDesc/titleStmt/title" /&gt; and string them together in your span element that is nested somewhere in your HTML body element:</p> <p>&lt;span class="Z3988" title="url:encode($btitle...)" /&gt;</p> <p>Knowing more about the TEI version, and which XSLT processor you're using would also help. </p> Karin Dalziel on "Best way to create COinS or other metadata from TEI using XSLT?" http://digitalhumanities.org/answers/topic/best-way-to-create-coins-or-other-metadata-from-tei-using-xslt#post-134 Thu, 23 Sep 2010 16:31:50 +0000 Karin Dalziel 134@http://digitalhumanities.org/answers/ <p>I feel way behind in this area. I have successfully used XSLT to insert in Dublin Core metadata into the header of an HTML page, but I would like to support multiple resources, etc. From looking around, it seems the best format to use is COinS, but the format is a bit more, er, obtuse than dublin core. </p> <p>Has anyone done this? care to share some sample XSLT? Am I going about this all wrong?</p> <p>(Also, I debated whether this should go in metadata or programming. Feel free to chime in on that as well) </p>