473,390 Members | 1,651 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 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 2681
* 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Francesc Guim Bernat | last post by:
Dear colleagues, i'm getting in troubles using one XML library with Visual Studio .NET and Xerces with Xalan. When i execute the code i get the next run time error: "Run-Time Check Failure #2...
2
by: Anthony Bouch | last post by:
Can anyone tell me why I receive the following compiler warning after having recently upgraded to VS.Net 2003 and .Net 1.1? Warning CS0618: 'System.Xml.Xsl(System.Xml.XPath.IXPathNavigable,...
2
by: Matt Frame | last post by:
I have a problem with the XslTransform looking as though it is not using my custom XslResolver. My customer resolver has been working fine until I tried to use the following in my style-sheet: ...
1
by: Tim Menninger | last post by:
When I use the XslTransform.Transform method to write to the HttpRequest.OutputStream The first byte of the output is always an invalid character, looks like an ascii zero or some other...
3
by: Steve | last post by:
Is there any way of specifying the startMode when using the xslTransform class? We are updating code which used msxml to the system.xml classes but can find no way to specify the startMode. We...
3
by: Paul Hatcher | last post by:
Hi I have a transform going from XML to HTML, but I can't seem to get the XslTransform class to output &amp; as & even when using disable-output-escaping. I've tried writing the result to a...
2
by: KJS | last post by:
Hello, I'm receiving: 'System.Xml.Xsl.XsltException: Missing mandatory attribute 'version' After I try and run my transformation. I spent a good few days coming up with the appropriate (I think)...
0
by: Ruprict | last post by:
I am trying to transform a dataset with xslt, and it continually fails with a NullReference Exception after the transform when I try to read the result into another dataset I have tested the XML...
12
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b)...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.