[Linuxtrent] [OT - Programmazione] Rimuovere un tag da un file?

  • From: "Luca Manganelli" <luca76@xxxxxxxxx>
  • To: linuxtrent@xxxxxxxxxxxxx
  • Date: Mon, 21 Apr 2008 12:17:58 +0200

Salve a tutti, ho un file in formato XML dal quale devo togliere tutti i tag:

.........
  <font bla bla bla />
.........
  <font
bla bla bla />      <--------- notare che può essere anche su 2 righe
...........

ho provato anche con questo schema XSL:

<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
<xsl:output method="xml" indent="yes"/>

<xsl:template match="font">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="@* | text() | comment() | processing-instruction()">
<xsl:copy-of select="."/>
</xsl:template>

<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="*| @* | text() | comment() |
processing-instruction()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

Però non da il risultato dovuto.

Qualche idea?
--
Per iscriversi  (o disiscriversi), basta spedire un  messaggio con OGGETTO
"subscribe" (o "unsubscribe") a mailto:linuxtrent-request@xxxxxxxxxxxxx


Other related posts: