xsl:document

admin

Administrator
Staff member
Bonjour,
Je suis en train de tester xsl:document

Voici mon fichier xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE poem SYSTEM "C:\Documents and Settings\michael\Desktop\New
Folder\poem.dtd">
<poem>
<author>Rupert Brooke</author>
<date>19212</date>
<title>Song</title>
<stranza>
<line>And suddenly the wind comes soft,</line>
<line>And the sbhbhkjhbhbjhbhjbhjbhbh</line>
<line>And the sbhbhkjhbhbjhbhjbhjbhbh</line>
</stranza>
</poem>

Voila mon fichier xsl:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="poem">
<poem>
<xsl:copy-of select="title"/>
<xsl:copy-of select="author"/>
<xsl:copy-of select="date"/>
<xsl:apply-templates select="stranza" />
</poem>
</xsl:template>

<xsl:template match="stranza">
<xsl:variable name="file" select="concat('verse',position(),'.xml')"/>
<verse number="{position()}" href=http://www.webdeveloper.com/forum/archive/index.php/"{$file}"/>
<xsl:document href="{$file}">
<xsl:copy-of select="."/>
</xsl:document>
</xsl:template>
</xsl:stylesheet>

En faite il cr殚 bien mon fichier de sortie suivant:
<?xml version="1.0" encoding="UTF-8"?>
<poem xmlns:fo="http://www.w3.org/1999/XSL/Format">
<title>Song</title>
<author>Rupert Brooke
</author><date>19212</date>
<verse number="1" href="verse1.xml"/>
</poem>

Mais il ne cr殚 pas mon fichier verse1.xml , quelqu'un pourrait me dire pq
et quel est mon erreur car je ne trouve pas ce qui cloche merci!!!

Cordialement Thi閎ault Micha雔
 
Back
Top