diff options
-rw-r--r-- | repositories.xsl | 22 | ||||
-rwxr-xr-x | write-repositories-xml.py | 10 |
2 files changed, 31 insertions, 1 deletions
diff --git a/repositories.xsl b/repositories.xsl new file mode 100644 index 0000000..b5115b4 --- /dev/null +++ b/repositories.xsl @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" + xmlns:exslt="http://exslt.org/common" + xmlns:str="http://exslt.org/strings" + extension-element-prefixes="str exslt"> + +<xsl:output encoding="UTF-8" + omit-xml-declaration="no" + cdata-section-elements="description longdescription name" + indent="yes" + media-type="application/xml"/> + +<xsl:strip-space elements="*"/> + +<!-- Identity transform, just copy everything --> +<xsl:template match="/repositories | /repositories//*"> + <xsl:copy> + <xsl:copy-of select="attribute::*" /> + <xsl:apply-templates select="node()" /> + </xsl:copy> +</xsl:template> +</xsl:stylesheet> diff --git a/write-repositories-xml.py b/write-repositories-xml.py index 8c9dff2..184c040 100755 --- a/write-repositories-xml.py +++ b/write-repositories-xml.py @@ -115,4 +115,12 @@ overlays.insert(0, ET.Comment('NOTE: This file is generated, do not edit directl recurse_print(overlays) indent(overlays) -a.write('repositories.xml') +repositories_xml = open('repositories.xml', 'w') +repositories_xml.write("""\ +<?xml version="1.0" encoding="UTF-8"?> +<!-- $Header$ --> +<?xml-stylesheet href="/xsl/repositories.xsl" type="text/xsl"?> +<!DOCTYPE repositories SYSTEM "/dtd/repositories.dtd"> +""") +a.write(repositories_xml, encoding='utf-8') +repositories_xml.close() |