472,123 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,123 software developers and data experts.

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 2623
* 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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.