diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2009-10-10 10:03:20 +0200 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2009-10-10 10:03:20 +0200 |
commit | c3278e865044070919d57bbd8c9c33f0fef9d370 (patch) | |
tree | 2f7064b906e4b6b5ca36dd88b0e0fbc30b4205b6 | |
parent | No longer write ".git.git" in feed URIs (diff) | |
download | repositories-xml-format-c3278e865044070919d57bbd8c9c33f0fef9d370.tar.gz repositories-xml-format-c3278e865044070919d57bbd8c9c33f0fef9d370.tar.bz2 repositories-xml-format-c3278e865044070919d57bbd8c9c33f0fef9d370.zip |
Add support for Gentoo infra's XSL wrapping
-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() |