Andy Black wrote:
> Another possibility is to use a transform to create what you want for 
> the pick command and then feed the pick command with that.  I do that 
> for a number of referenced items.  For example for citations to 
> (bibliographic) references, I use these two commands
> 
>     <cfg:command name="setCitation">
>         <cfg:macro>
>             <cfg:sequence>
>                 <cfg:pass>
>                     <cfg:command name="selectNode" 
> parameter="self[implicitElement] citation"/>
>                 </cfg:pass>
>                 <cfg:command name="getRefWorkTitlesandIds"/>
>                 <cfg:command name="pick" parameter="Citation true %_"/>
>                 <cfg:command name="putAttribute" 
> parameter="[implicitElement] ref %_"/>
>             </cfg:sequence>
>         </cfg:macro>
>     </cfg:command>
>     <cfg:command name="getRefWorkTitlesandIds">
>         <cfg:process showProgress="false">
>             <cfg:copyDocument to="in.xml"/>
>             <cfg:transform cacheStylesheet="true" file="in.xml" 
> stylesheet="../transforms/GetRefWorkTitlesAndIds.xsl" to="out.xml"/>
>             <cfg:read encoding="UTF-8" file="out.xml"/>
>         </cfg:process>
>     </cfg:command>
> 
> and this XSLT:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>     <xsl:output method="text" encoding="UTF-8" indent="no"/>
>     <xsl:template match="/">
>         <xsl:apply-templates select="//refWork">
>         <xsl:sort select="../@citename"/>
>           <xsl:sort select="refTitle"/>
>         </xsl:apply-templates>
>     </xsl:template>
>     <xsl:template match="//refWork">
>         <xsl:text>"</xsl:text>
>         <xsl:value-of select="../@citename"/>
>         <xsl:text>: </xsl:text>
>         <xsl:apply-templates select="refTitle" mode="InTitle"/>
>         <xsl:text> {</xsl:text>
>         <xsl:value-of select="@id"/>
>         <xsl:text>}"
> </xsl:text>
>         <xsl:value-of select="@id"/>
>         <xsl:text>
> </xsl:text>
>     </xsl:template>
>     <xsl:template match="object" mode="InTitle">
>         <xsl:variable name="type" select="id(@type)"/>
>         <xsl:value-of select="$type/@before"/>
>         <xsl:value-of select="."/>
>         <xsl:value-of select="$type/@after"/>
>     </xsl:template>
> </xsl:stylesheet>
> 
> Here is a screenshot of what the pick dialog can look like (since I'm 
> not sure if graphics like this come through to the list, I'm copying 
> Mariusz and Hussein):
> 

Brilliant! Thanks for this suggestion.

(You seem to have forgotten to attach the screenshot to your email
because I haven't received it and generally I have no problem of that
sort. Do not bother resending it: your code speaks for itself!)




Reply via email to