 |
 |
 |
In testing for the upcoming release of the 4Suite tools, we have
came across a rather bad bug in the XSLT TextWriter code.
Basically it was printing an end tag after a single < /> element tag.
What follows is the diff of the file TextWriter.py
--- removed line
+++ changed line
in function endElement()
@@ -139,9 +142,11 @@
trace("End Element %s" % name)
if self.__currElement:
- self.__completeLastElement(1)
+ elementIsEmpty = self.__completeLastElement(1)
+ else:
+ elementIsEmpty = 0
if self.__outputParams.method != 'html' or (string.upper(name)
not in HTML_FORBIDDEN_END):
- text = '</' + name + '>'
+ text = (not elementIsEmpty) and ('</' + name + '>') or ''
if self.__outputParams.indent == 'yes':
self.__indent = self.__indent[:-2]
if (self.__outputParams.method != 'html') or
and in function __completeLastElement()
@@ -181,6 +186,7 @@
else:
self.__result = self.__result + '>'
self.__nextNewLine = 0
+ elementIsEmpty = 0
else:
self.__result = self.__result + '>'
self.__nextNewLine = 1
@@ -188,5 +194,5 @@
if self.__outputParams.indent == 'yes':
self.__indent = self.__indent + ' '
self.__currElement = None
- return self.__currElement
+ return
elementIsEmpty
Sorry for any problems that this has caused.
--
Jeremy Kloth Consultant
jeremy.kloth@xxxxxxxxxxxxxxx (303)583-9900 x 102
Fourthought, Inc. http://www.fourthought.com
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |