Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #341 (closed defect: worksforme)

Opened 13 years ago

Last modified 12 years ago

output is invalid xml

Reported by: anonymous Owned by: anonymous
Priority: normal Milestone: 0.9
Component: Kid Version: 0.8
Severity: normal Keywords:
Cc:

Description

I use a template with xml/xsl code like this:

<XML id="style">

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<xsl:template match="/">

<xsl:apply-templates select="//IMAGE"/>

</xsl:template> <xsl:template match="IMAGE">

<P>

<img border="0">

<xsl:attribute name="NAME">

<xsl:value-of select="NAME"/>

</xsl:attribute> <xsl:attribute name="src">

<xsl:value-of select="PATH"/>

</xsl:attribute> </img>

</P>

</xsl:template>

</xsl:stylesheet>

</XML>

After publishing it with tg the </img> tag is missing and the "xmlns:xs" namespaceparameter to.

Change History

comment:1 Changed 13 years ago by anonymous

There is an related problem with xsl tags and parameters. TG change the case of all tags and parameters to upper. This sucks perfect in IE. The code above (<xsl:value-of select="PATH"/>) works if it is lower case but not in upper case (<xsl:value-of SELECT="PATH"/>).

comment:2 Changed 13 years ago by anonymous

  • Milestone set to 0.9

comment:3 Changed 13 years ago by oefe

  • Status changed from new to closed
  • Resolution set to worksforme
  • Component changed from CherryPy to Kid
  • Summary changed from turbogears remove parameters unquestioned to output is invalid xml

This is because TurboGears uses kid's html serializer by default. To output XML, use the XML serializer. To do this, just add tg_format="xml" to the dict which you return from your controller. (In the rare case when you always want to generate XML, you can globally set kid.outputformat in your config file.

See:  http://turbogears.org/docs/deployment/config.html

Note: See TracTickets for help on using tickets.