469,332 Members | 6,678 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,332 developers. It's quick & easy.

XSLTransform & using XML Resolver to get images

I am transforming xml using XSLTransform which works fine. The xsl
file is stored on eg. C:\temp1 and the xml is loaded from c:\temp2.
All image files referenced in the stylesheet file are stored on the
same path as the stylesheet and are not used in the transform. How do
I use an XMLResolver to transform using the images without having to
move the files, is it possible???

Images are referenced as eg. <img src="image1.gif"/> in the
stylesheet.

Thanks
Nov 12 '05 #1
3 2549
* Pat Buxton wrote in microsoft.public.dotnet.xml:
I am transforming xml using XSLTransform which works fine. The xsl
file is stored on eg. C:\temp1 and the xml is loaded from c:\temp2.
All image files referenced in the stylesheet file are stored on the
same path as the stylesheet and are not used in the transform. How do
I use an XMLResolver to transform using the images without having to
move the files, is it possible???

Images are referenced as eg. <img src="image1.gif"/> in the
stylesheet.


You can use a <base> element in the generated HTML/XHTML document to
specify how relative URLs should be resolved, see the definition of
the element <http://www.w3.org/TR/REC-html40/struct/links.html#h-12.4>.
Use something like <base href="file:///c:/temp1/" /> in the <head>
section of the document in the XSLT.
Nov 12 '05 #2
Bjoern Hoehrmann <bj****@hoehrmann.de> wrote in message news:<41****************@news.bjoern.hoehrmann.de> ...
* Pat Buxton wrote in microsoft.public.dotnet.xml:
I am transforming xml using XSLTransform which works fine. The xsl
file is stored on eg. C:\temp1 and the xml is loaded from c:\temp2.
All image files referenced in the stylesheet file are stored on the
same path as the stylesheet and are not used in the transform. How do
I use an XMLResolver to transform using the images without having to
move the files, is it possible???

Images are referenced as eg. <img src="image1.gif"/> in the
stylesheet.


You can use a <base> element in the generated HTML/XHTML document to
specify how relative URLs should be resolved, see the definition of
the element <http://www.w3.org/TR/REC-html40/struct/links.html#h-12.4>.
Use something like <base href="file:///c:/temp1/" /> in the <head>
section of the document in the XSLT.


If I use the base element, and create it using <xsl:element> and
<xsl:attribute>, how can I get the uri of the current xsl document and
place it in this tag such that my images will be pulled from this
location???
Nov 12 '05 #3
* Pat Buxton wrote in microsoft.public.dotnet.xml:
If I use the base element, and create it using <xsl:element> and
<xsl:attribute>, how can I get the uri of the current xsl document and
place it in this tag such that my images will be pulled from this
location???


Not possible using XSLT 1.0, you would need to hardcode the value
somehow or use extension functions, etc.
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Francesc Guim Bernat | last post: by
2 posts views Thread by Anthony Bouch | last post: by
2 posts views Thread by Matt Frame | last post: by
3 posts views Thread by Paul Hatcher | last post: by
reply views Thread by Ruprict | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by haryvincent176 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.