[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: image path by unparsed-entity-uri()

Subject: Re: image path by unparsed-entity-uri()
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Mon, 04 Oct 2010 10:57:02 +0100
Re:  image path by unparsed-entity-uri()
The function unparsed-entity-uri() is defined to return the absolute URI of the entity, not the relative URI as written in the source document. If you want to reconstruct a relative URI, you'll have to do some (non-trivial) manipulation of what's returned.

Michael Kay
Saxonica

On 04/10/2010 10:40 AM, JS rawat wrote:
Hi Team,
Can we get the appropriate path as describe in input by
unparsed-entity-uri().

XSLT
<xsl:template match="graphic">
  <graphic>
   <xsl:copy-of select="@id"/>
   <xsl:if test="@fileref">
    <xsl:attribute name="src"><xsl:value-of
select="@fileref"/></xsl:attribute>
   </xsl:if>
   <xsl:if test="not(@fileref)">
    <xsl:call-template name="entifyref">
     <xsl:with-param name="figname"
select="unparsed-entity-uri(@entityref)"/>
    </xsl:call-template>
   </xsl:if>
  </graphic>
</xsl:template>

<xsl:template name="entifyref">
  <xsl:param name="figname"/>
  <xsl:attribute name="src"><xsl:value-of select="$figname"/></xsl:attribute>
</xsl:template>


input <!DOCTYPE article abd.dtd"[ <!ENTITY F0001 SYSTEM ".\Fig\F0001.gif" NDATA GIF> ]> <article> <para><graphic entityref="F0001"/></para> </article>

output
<book>
<p><graphic src="file:/d:/Jobs/xsl/abc/xslt/Fig/F0001.gif"/></p>
</book>

required output
<book>
<p><graphic src="./Fig/F0001.gif"/></p>
</book>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.