0

We are creating a UWP app which uses an unmodified C library which dynamically writes out XML files and corresponding XSL stylesheet files to be loaded by a WebView object.

The fact that it must write out new files means ms-appx: cannot be used. The fact that it must also popup Javascript dialog boxes means ms-appdata: cannot be used.

So we are using ms-local-stream: with a IUriToStreamResolver class which works with both file creation and with Javascript popup dialogs. And it loads an XML file, BUT it does not even try to load the corresponding XSL stylesheet file.

For example consider the following XML file:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="demo.xsl"?>
<MAINELEM>
    Main text
    <SUBELEM>
        Subtext
    </SUBELEM>
</MAINELEM>

which results in the display:

Main text Subtext 

BUT never even attempts to use the href file demo.xsl. It doesn't matter what the contents of demo.xsl are since the file is never loaded. Setting a breakpoint in IUriToStreamResolver.UriToStreamAsync() shows that no attempt is made to load the XSL file.

This is our last hope for ever creating a UWP app. This worked fine using ms-appx: but as I mentioned this cannot be used since it doesn;t allow dynamic file creation. How can we get this ms-local-stream: working with XML and XSL?

Cheers, Bill :-)

Julian
  • 33,915
  • 22
  • 119
  • 174
  • Did you check [this question](http://stackoverflow.com/questions/40173758/uwp-allow-xsl-transformation-in-a-webview-for-local-content)? Seems like related to yours. – Andrei Ashikhmin Apr 20 '17 at 04:50
  • Thank you, that question and answer are interesting. It shows a way to trick it to replace an href="..." with loading and transforming the contents. But that is not sufficient for our case; we need it to follow and load the href recursively because the referenced XSLT file itself contains nested and those referenced href files point to yet more subnested href's. So we need href to work. It's beginning to look like UWP simply cannot do what we need with ms-appx-web nor ms-appdata nor ms-local-stream. Very frustrating. – user3334340 Apr 20 '17 at 17:08

0 Answers0