Print

Print


Lynn,
The element EXTPTR is difficult to transform due to the many attributes it can possess. Some of these are actually logically mutually exclusive, but they are not governed by the DTD. The EXTPTR could point to an image, or draw an image into the document build. But there is no way of knowing which it will be. Even the attributes and their values do not help you. These attributes can be used in any combination and with any values (some enumerated).

This means you will have to have a best practices, or write conditions into the template.

If you want to get the SYSTEM value from an ENTITY, you can use:

unparsed-entity-uri(@entityref)

The location of the image, file size, image size, etc. may all result in a failed build.

    <xsl:value-of select="unparsed-entity-uri(@entityref)"/>

Michele Combs' XSLT has you going in the right direction.

Mike Ferrando
Library Technician
Library of Congress
Washington, DC
202-707-4454

----- Original Message ----
From: Michele Combs <[log in to unmask]>
To: [log in to unmask]
Sent: Wednesday, January 17, 2007 8:50:49 AM
Subject: Re: Image and link help

>>> [log in to unmask] 1/16/2007 4:47 PM >>>
>>Can anyone help me get from this, in my xml doc:
>> <extptr show="embed" actuate="onload" entityref="nyplogo"/>
>> using an xsl template, to display the image.

    <xsl:template match="extptr">
        <xsl:choose>
            <xsl:when test="self::extptr[@show='embed']">
                                          <img src="{@xpointer}"
alt="{@title}" align="{@altrender}"/>
            </xsl:when>
            <xsl:otherwise>
                                          <a
href="{@xpointer}">"{@title}"</a>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>


>>Similarly, I need to get from the line below in my xml doc:
>> <extref href="http://nypl.org/research/lpa/the/the.html";
actuate="onload"
>> show="new">http://nypl.org/research/lpa/the/the.html</extref>
>> using an xsl template, to create line below in the resulting html
>> <a href="http://nypl.org/research/lpa/the/the.html";
>> target="_blank">http://nypl.org/research/lpa/the/the.html</a>

    <xsl:template match="extref">
        <a href="{@href}"  target="_blank">
            <xsl:apply-templates/>
        </a>
    </xsl:template>

Michele C.


-=--=--=--=--=--=--=--=--=--=--=--=--=--=-
Michele R. Combs
[log in to unmask]
Manuscripts Processor
Special Collections Research Center
Syracuse University Library
222 Waverly Avenue
Syracuse, NY 13244
(315) 443-2697
-=--=--=--=--=--=--=--=--=--=--=--=--=--=-





 
____________________________________________________________________________________
The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php