summaryrefslogtreecommitdiffstats
path: root/utils_xml.py
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-05-30 20:18:09 +0200
committerJan Pokorný <jpokorny@redhat.com>2014-05-30 20:18:09 +0200
commit85e0dcdf6ac244b5091a9fb54dd0256b04e20f3b (patch)
treee0acdb8a6e82a72c509adebc845084cd675ba968 /utils_xml.py
parent2eed8c42b204e9810093b4544c58981c52b7f58b (diff)
downloadclufter-85e0dcdf6ac244b5091a9fb54dd0256b04e20f3b.tar.gz
clufter-85e0dcdf6ac244b5091a9fb54dd0256b04e20f3b.tar.xz
clufter-85e0dcdf6ac244b5091a9fb54dd0256b04e20f3b.zip
Cleanup: move some more XML related stuff to utils_xml.py
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'utils_xml.py')
-rw-r--r--utils_xml.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/utils_xml.py b/utils_xml.py
index 9f08893..6170a2e 100644
--- a/utils_xml.py
+++ b/utils_xml.py
@@ -13,9 +13,19 @@ from .utils import selfaware
NAMESPACES = {
- 'rng': 'http://relaxng.org/ns/structure/1.0'
+ 'clufter': 'http://people.redhat.com/jpokorny/ns/clufter',
+ 'rng': 'http://relaxng.org/ns/structure/1.0',
+ 'xsl': 'http://www.w3.org/1999/XSL/Transform',
}
+xslt_identity = '''\
+ <xsl:template match="{0}@*|{0}node()"
+ xmlns:xsl="''' + NAMESPACES['xsl'] + '''">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>'''
+
class UtilsXmlError(ClufterPlainError):
pass