Aller au contenu principal
loading

Recopier un noeud complet en XSL sans la balise parent

POSTÉ DANS TAGS AUTEUR herve COMMENTAIRES 1

Voici un exemple basé sur une recopie d'un noeud body extrait d'une source en XHTML : <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent="yes"/> <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"> <xsl:copy-of select="//xhtml:head" /> <body> <xsl:copy-of select="//xhtml:body/node()|@*" /> </body> </html> </xsl:template> </xsl:stylesheet>



1 commentaire