X-Git-Url: https://git.ladys.computer/Shushe/blobdiff_plain/44ad50cac2e0fb39ba3cf8b3d5bdf3840e47dc34..5a363a0a9e519b88fed12252328acd4bfa7689e5:/lib/literally.xslt?ds=inline

diff --git a/lib/literally.xslt b/lib/literally.xslt
index 203dfd3..d929f2f 100644
--- a/lib/literally.xslt
+++ b/lib/literally.xslt
@@ -18,8 +18,9 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
 	version="1.0"
 >
 	<template match="node()" mode="书社:literally">
+		<param name="extension-element-namespaces"/>
 		<choose>
-			<when test="self::*">
+			<when test="self::* and contains(concat(' http://www.w3.org/1999/XSL/Transform ', normalize-space($extension-element-namespaces), ' '), concat(' ', namespace-uri(), ' '))">
 				<xslt:element name="{name()}" namespace="{namespace-uri()}">
 					<for-each select="@*">
 						<xslt:attribute name="{name()}" namespace="{namespace-uri()}">
@@ -31,6 +32,23 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
 					<apply-templates mode="书社:literally"/>
 				</xslt:element>
 			</when>
+			<when test="self::*">
+				<element name="{name()}" namespace="{namespace-uri()}">
+					<for-each select="@*[not(contains(., '{') or contains(., '}'))]">
+						<attribute name="{name()}" namespace="{namespace-uri()}">
+							<value-of select="."/>
+						</attribute>
+					</for-each>
+					<for-each select="@*[contains(., '{') or contains(., '}')]">
+						<xslt:attribute name="{name()}" namespace="{namespace-uri()}">
+							<xslt:text>
+								<value-of select="."/>
+							</xslt:text>
+						</xslt:attribute>
+					</for-each>
+					<apply-templates mode="书社:literally"/>
+				</element>
+			</when>
 			<when test="self::text()">
 				<xslt:text>
 					<value-of select="."/>