xsl-list
[Top] [All Lists]

RE: [xsl] Bibliography References

2006-09-13 16:41:58
In 2.0 I would be inclined to do:

<xsl:key name="b" match="bibliomixed" use="@id"/>

<xsl:template match="bibref">
  <xsl:number select="key('b', @xref)"/>
</xsl:template> 

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: Mark Shellenberger [mailto:mshellenberger(_at_)gmail(_dot_)com] 
Sent: 13 September 2006 23:20
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Bibliography References

...tentatively dips his virtual finger in the listserv.

I have an XSLT 1.0 solution.

    <xsl:template match="bibliography"/>
    <xsl:template match="bibref">
        <xsl:variable name="xref" select="@xref"/>
        <xsl:for-each select="//bibliography/bibliomixed">
          <xsl:if test="@id = $xref">
            <xsl:value-of 
select="count(preceding-sibling::bibliomixed)+1"/>
          </xsl:if>
       </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>

I am sure there is a more XSLTish way of doing this and that 
there is some super-fantabulous way of doing it in XSLT 2.0, 
but this works.  I can't wait to see what others suggest.

--Mark

-----Original Message-----
From: siarom egrub [mailto:egrubs(_at_)yahoo(_dot_)com]
Sent: Wednesday, September 13, 2006 5:17 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Bibliography References

Hi All!

I am trying to output the following bibliography references 
(<bibref...>) in following format. 

***This is the output that I want:***

Refer to References (1, 4, 5) for guidelines on performing 
precision testing.

***The source file looks like this:***

<para>Refer to References (<bibref
xref="bib98861831"/>,<bibref
xref="bib98861816"/>,<bibref xref="bib988618273"/>) for 
guidelines on performing precision testing.</para>

<bibliography><title>REFERENCES</title>
  <bibliomixed id="bib98861831">National 
Committee...<booktitle>Fundamentals...</booktitle>...</bibliomixed>

  <bibliomixed id="bib98861814">National Committee...</bibliomixed>
  <bibliomixed id="bib98861870">National Committee...</bibliomixed>
  <bibliomixed id="bib98861816">National Committee...</bibliomixed>
  <bibliomixed id="bib988618273">National Committee for 
Clinical...</bibliomixed>  </bibliography> 
  
 I think I may have to first check the "xref" value against 
the "id" in bibliomixed for a match and then count the 
bibliomixed location and output the reference number. But how 
do I get started?
 
 Could someone give me a few pointers on how to accomplish this task?
 
 Thanks in advance for your help!!

S.Egrub

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection 
around http://mail.yahoo.com 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>