Hello,
I need a way to get the relative path of an external entity using xsl. Given the following xml:
if I use the following xsl:
It returns the absolute path from where the transformation occurs. So if I run the transformation from c:\data\xyz\ then unparsed-entity-uri('image') returns c:\data\xyz\temp\me.gif, but I need the value temp/me.gif. How can I do that using xsl.
XML that I need to transform is authored content and I cannot change that. I have to transform the xml to html and it is likely the absolute path will not match the document root, so such references will result in missing graphics when the HTML file is viewed.
Any help is greatly appreciated.
I need a way to get the relative path of an external entity using xsl. Given the following xml:
Code:
<!NOTATION GIF SYSTEM "Graphical Interchange Format">
<!ENTITY mypicture SYSTEM "temp/me.gif" NDATA GIF>
...
<graphic image="mypicture"></graphic>
if I use the following xsl:
Code:
<xsl:value-of select="unparsed-entity-uri('image')"/>
It returns the absolute path from where the transformation occurs. So if I run the transformation from c:\data\xyz\ then unparsed-entity-uri('image') returns c:\data\xyz\temp\me.gif, but I need the value temp/me.gif. How can I do that using xsl.
XML that I need to transform is authored content and I cannot change that. I have to transform the xml to html and it is likely the absolute path will not match the document root, so such references will result in missing graphics when the HTML file is viewed.
Any help is greatly appreciated.