Skip to content

Commit 44cd4fd

Browse files
committed
Simplify xml code
1 parent aa8b1af commit 44cd4fd

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/routes/+page.svelte

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@
8989
try {
9090
let xmlDoc = new DOMParser().parseFromString(input, 'application/xml');
9191
let xsltDoc = new DOMParser().parseFromString(`
92-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
93-
<xsl:strip-space elements="*"/>
94-
<xsl:template match="para[content-style][not(text())]">
95-
<xsl:value-of select="normalize-space(.)"/>
96-
</xsl:template>
97-
<xsl:template match="node()|@*">
98-
<xsl:copy><xsl:apply-templates select="node()|@*"/></xsl:copy>
99-
</xsl:template>
100-
<xsl:output indent="yes"/>
101-
</xsl:stylesheet>
92+
<xsl:stylesheet version="1.0"
93+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
94+
<xsl:output omit-xml-declaration="yes" indent="yes"/>
95+
96+
<xsl:template match="node()|@*">
97+
<xsl:copy>
98+
<xsl:apply-templates select="node()|@*"/>
99+
</xsl:copy>
100+
</xsl:template>
101+
</xsl:stylesheet>
102102
`,'application/xml');
103103
104104
let xsltProcessor = new XSLTProcessor();

0 commit comments

Comments
 (0)