1
0
Fork 0

Prettyprint xml output and fix xslt

This commit is contained in:
Starbeamrainbowlabs 2016-07-06 21:08:28 +01:00
parent 7b5c02bb0c
commit 9526d95861
2 changed files with 17 additions and 6 deletions

View File

@ -136,6 +136,8 @@ namespace GalleryShare
XmlWriterSettings writerSettings = new XmlWriterSettings();
writerSettings.Async = true;
writerSettings.Indent = true;
writerSettings.IndentChars = "\t";
XmlWriter xmlData = XmlWriter.Create(outgoingData, writerSettings);
await xmlData.WriteStartDocumentAsync();

View File

@ -1,15 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0" xmlns:xsl="http://w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" indent="yes" />
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html&gt;</xsl:text>
<html>
<head>
<title><xsl:value-of select="CurrentDirectory" /> - GalleryShare</title>
<title><xsl:value-of select="/DirectoryListing/CurrentDirectory" /> - GalleryShare</title>
</head>
<body>
<h1><xsl:value-of select="CurrentDirectory" /> - GalleryShare</h1>
<h1><xsl:value-of select="/DirectoryListing/CurrentDirectory" /> - GalleryShare</h1>
<p>This is a test</p>
<!-- ---------- -->
<style>
html, body { font-size: 100%; }
body
{
font-family: sans-serif;
}
</style>
</body>
</html>
</xsl:template>
</xsl:transform>
</xsl:stylesheet>