[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
On Nov 16, 2004, at 7:59 AM, Pawson, David wrote:
I doubt that'll work. Imagine someone authoring a document; they add a citation, and want to run the output transformation again.
The easiest way is instead of sending a single query for each distinct-value of the "citekey" key, I somehow send a query that asks for all of them at once.
I'm not quite sure who to do that, though. I know that I want a "for $key in $keys return mods:mods[ID='$key']" sort of expression; I just don't know how to do that with the key.
<xsl:template match="db:bibliography" mode="create-bibcollection">
<bibliography>
<modsCollection xmlns="http://www.loc.gov/mods/v3">
<xsl:for-each select="distinct-values(key('citekey', 'all'))">
<!--+ ==============================================================
| bibrecord variable identifies where to locate the bib records; in
| this case, we access them via http from an eXist XML DB
+-->
<xsl:variable name="bibrecord" select='doc(concat("http://localhost:8080/exist/servlet/db/biblio?",
"_query=declare%20namespace%20mods=%22http://www.loc.gov/mods/ v3%22;",
"/mods:modsCollection/mods:mods[@ID='", ., "']"))'/>
<xsl:copy-of select="$bibrecord/exist:result/mods:mods" />
</xsl:for-each>
</modsCollection>
</bibliography>
</xsl:template>
Bruce
Re: [xsl] doc() concat expression and whitespace error
Subject: Re: [xsl] doc() concat expression and whitespace error From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx> Date: Tue, 16 Nov 2004 12:02:00 -0500 |
On Nov 16, 2004, at 7:59 AM, Pawson, David wrote:
Pull a 'version' or date attribute from the database, cmp with the same attribute on the root of the document?
I doubt that'll work. Imagine someone authoring a document; they add a citation, and want to run the output transformation again.
Can the former be made faster?
The easiest way is instead of sending a single query for each distinct-value of the "citekey" key, I somehow send a query that asks for all of them at once.
I'm not quite sure who to do that, though. I know that I want a "for $key in $keys return mods:mods[ID='$key']" sort of expression; I just don't know how to do that with the key.
<xsl:template match="db:bibliography" mode="create-bibcollection">
<bibliography>
<modsCollection xmlns="http://www.loc.gov/mods/v3">
<xsl:for-each select="distinct-values(key('citekey', 'all'))">
<!--+ ==============================================================
| bibrecord variable identifies where to locate the bib records; in
| this case, we access them via http from an eXist XML DB
+-->
<xsl:variable name="bibrecord" select='doc(concat("http://localhost:8080/exist/servlet/db/biblio?",
"_query=declare%20namespace%20mods=%22http://www.loc.gov/mods/ v3%22;",
"/mods:modsCollection/mods:mods[@ID='", ., "']"))'/>
<xsl:copy-of select="$bibrecord/exist:result/mods:mods" />
</xsl:for-each>
</modsCollection>
</bibliography>
</xsl:template>
Bruce
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] doc() concat expression a, Pawson, David | Thread | Re: [xsl] doc() concat expression a, Bruce D'Arcus |
Re: [xsl] problem matching attribut, David Carlisle | Date | RE: [xsl] mathML2SVG, Pieter Reint Siegers |
Month |
Keywords