Hi Edward

Maybe something like

<xsl:for-each select="//dc:subject">
        <tr>
                <td scope="col" class="width1"/>
                <th scope="col" class="width20">Subject: (</th>
                <xsl:value-of select="substring-after(@xsi:type,'dcterms:')"/>
                <xsl:text>) :</xsl:text>
                <td scope="col" class="widthAuto">
                        <xsl:value-of select="."/>
                </td>
        </tr>
</xsl:for-each>

Cheers

Neal Fitzgerald, State Library of Queensland

-----Original Message-----
From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Edward 
M. Corrado
Sent: Tuesday, August 02, 2011 7:54 AM
To: CODE4LIB@LISTSERV.ND.EDU
Subject: [CODE4LIB] xml stylesheet question

Hi,

I am trying to do something with an xsl stylesheet (1.0) that seems
like it should be pretty simple, but I can't figure out how to do it
or find any examples on the Web that work-. I have a set of Dublin
Core XML records that have the subjects as either LCSH or TGM. The
type of subject is identified by xsi:type. So for an individual
record, the subjects may look something like this:

         <dc:subject xsi:type="dcterms:LCSH">Drum--Kurdistan</dc:subject>
         <dc:subject xsi:type="dcterms:TGM">Drums (Musical
instruments)--Kurds</dc:subject>

I want this to display something like:

           Subject (LCSH): Drum--Kurdistan
           Subject (TGM): Drums (Musical instruments)--Kurds


The following works fine to print the subjects (as part of an HTML
table) but (obviously) does not take into account the type of subject
heading:

   <xsl:for-each select="//dc:subject">
      <tr>
       <td scope="col" class="width1"/>
        <th scope="col" class="width20">Subject: </th>
       <td scope="col" class="widthAuto"><xsl:value-of select="." />
       </td>
      </tr>
   </xsl:for-each>

I need some sort of logic to test what the value of xsi:type is but
I'm lost. I have been trying to find examples on how to do this on th
Web and in a few XSLT books we have in the library with no luck. Any
ideas?

Edward

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>
>>>>> See what is happening at the State Library of Queensland...
>>>>>
>>>>> http://www.slq.qld.gov.au/__data/assets/image/0005/184307/email_banner.jpg
>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


******************* Disclaimer *******************

This e-mail, together with any attachments, is intended for the named 
recipient(s) only. This e-mail may contain information which is confidential, 
of a private nature or which is subject to legal professional privilege or 
copyright. Accordingly, any form of disclosure, modification, distribution 
and/or publication of this email message is prohibited unless expressly 
authorised by the sender acting with the authority of or on behalf of the 
Library Board of Queensland.

If you have received this email by mistake, please inform the sender as soon as 
possible and delete the message and any copies of this message from your 
computer system network.

The confidentiality, privacy or legal professional privilege attached to this 
email is not waived or destroyed by that mistake.

The State Library of Queensland uses virus scanning software.  However, it is 
your responsibility to ensure that this email does not contain and is not 
infected by a computer virus.

Unless expressly attributed, the views expressed in this email do not 
necessarily represent the views of the Library Board of Queensland.

******************** Disclaimer *******************

ref:68ga42xfzt

Reply via email to