[RESOLVED] [Please move to the XML forum] domdocument transformnode
Please move to the XML forum.
It's possible avoid that transformNode begins the output string with <?xml version='1.0'?>
For example:
XML content:
Code:
<?xml version="1.0"?>
<Lista>
<Pelicula>
<Id>100</Id>
<Titulo>12 Monos</Titulo>
</Pelicula>
<Pelicula>
<Id>101</Id>
<Titulo>La nave de la muerte</Titulo>
</Pelicula>
</Lista>
XSL Content:
Code:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="Lista/Pelicula">
<xsl:value-of select="format-number(number(Id),'000000')"/>
<xsl:value-of select="Titulo"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
The result of the transformation is:
<?xml version='1.0'?>00010012 Monos000101La nave de la muerte...
I expects:
00010012 Monos000101La nave de la muerte...
Is this possible?
Thanks
Re: [Please move to the XML forum] domdocument transformnode
First of all a valid XML document must begin with the xml declaration. But, your transformation doesn't have to output valid XML.
Take a look at the xsl:output element.
- petter
Re: [Please move to the XML forum] domdocument transformnode
I don't want to return valid XML
<xsl:output method="text"/> Works fine
Thank you!