Click to See Complete Forum and Search --> : xsl:document


piston
03-14-2003, 11:53 AM
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="{$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ébault Michaël

khalidali63
03-15-2003, 07:25 AM
you would have a better chance of some one answering your post if more people could undertand your question..

:D

Khalid