Portál AbcLinuxu, 30. října 2025 08:06
Řešení dotazu:
Konkrétně např.:
$ cat strip_comment.xsl
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:strip-space elements="*"/>
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="comment()"/>
</xsl:stylesheet>
$ xmlstarlet tr strip_comment.xsl input.xml >output.xml
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.