#
# vim:set sw=4 ts=4:
#############################################################################
#
# ALICE
# Automatic Linux Installation and Configuration Environment
#
# Copyright (c) 2000-2002 SuSE Linux Solutions AG, Eschborn, Germany
#               2002-2004 SuSE Linux AG, Eschborn, Germany
#               2005           SUSE GmbH, Nuernberg, Germany
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#############################################################################
#
# Author: 
FORMAT=$(cat << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: nice_xml,v 1.4 2005/04/11 14:14:34 fabian Exp $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
    <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="no" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
EOF
)
#
# create the xsl style sheet
#
echo "$FORMAT" > /tmp/f$$.xsl
#
# remove the <!DOCTYPE...> (but store it)
#
DOCT=$(awk '/<!DOCTYPE/' "$1")
awk '!/<!DOCTYPE/' "$1" > /tmp/d$$.xml
#
#
#
sabcmd /tmp/f$$.xsl /tmp/d$$.xml |
   awk 'NR == 2 { print doct }
	            { print $0   }
	   ' doct="$DOCT"
rm -f /tmp/f$$.xsl
rm -f /tmp/d$$.xml
