You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XSL processing can insert href links into the html output, for images, css etc. This works fine in xmlnotepad as long as the href links are fully qualified paths (eg. c:\solarsys\planet9.css) but fails when the links are relative (./../../solarsys/planet9.css)
From a new users perspective, this can be perplexing since relative paths look valid in all xml/xsl files. However, the html output is never 'stored' anywhere other than memory and relative paths have no meaning. Currently the XML is loaded to memory then passed to WebBrowser thus relative paths have no meaning. There seems to be no way to set a 'working directory' for the WebBrowser component.
xmlnotepad could support relative paths by reading href links and loading those files into the WebBrowser DOM. But that is probably a bit of work. Is there an easier way?
Workarounds:
(1) Use fully qualified paths.
(2) Drag and drop your xml file into the xmlnotepad WebBrowser window
(3) Use XSL to copy the content of relative files directly into the html output - described here: http://stackoverflow.com/questions/1038101/how-to-copy-external-css-and-javascript-in-xslt
For images, they would need to be base64 encoded for embedding into html with Data URI.
The text was updated successfully, but these errors were encountered:
Actually, solution (2) above got me thinking, why not simply open the xml file with WebBrowser? Clicking the transform button handler would simply be: webBrowser1.Url = new Uri("file:///C:/temp/test.xml");
Relative paths would be handled correctly.
Is there a downside to that solution?
This should be fixed now. I added a separate "output file name" field to the XSL output tab, it will get an automatically generated file name and by default it will store the output file near the XSL file so relative links now work.
XSL processing can insert href links into the html output, for images, css etc. This works fine in xmlnotepad as long as the href links are fully qualified paths (eg. c:\solarsys\planet9.css) but fails when the links are relative (./../../solarsys/planet9.css)
From a new users perspective, this can be perplexing since relative paths look valid in all xml/xsl files.
However, the html output is never 'stored' anywhere other than memory and relative paths have no meaning.Currently the XML is loaded to memory then passed to WebBrowser thus relative paths have no meaning. There seems to be no way to set a 'working directory' for the WebBrowser component.xmlnotepad could support relative paths by reading href links and loading those files into the WebBrowser DOM. But that is probably a bit of work. Is there an easier way?
Workarounds:
(1) Use fully qualified paths.
(2) Drag and drop your xml file into the xmlnotepad WebBrowser window
(3) Use XSL to copy the content of relative files directly into the html output - described here:
http://stackoverflow.com/questions/1038101/how-to-copy-external-css-and-javascript-in-xslt
For images, they would need to be base64 encoded for embedding into html with Data URI.
The text was updated successfully, but these errors were encountered: