From: SourceForge.net <no...@so...> - 2004-01-06 21:32:34
|
Bugs item #834851, was opened at 2003-11-03 04:30 Message generated for change (Settings changed) made by fgiust You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=113153&aid=834851&group_id=13153 Category: None Group: None Status: Open Resolution: None >Priority: 9 Submitted By: Chris Bitmead (chrisbitmead) Assigned to: Nobody/Anonymous (nobody) Summary: Duplicate xml:space=preserve fix Initial Comment: If you set tidy.setXmlSpace(true), you will probably get duplicate attributes which will make an XML parser barf. The fix is basicly to remove the code looking like this... if (configuration.XmlOut && configuration.XmlSpace && ParserImpl.XMLPreserveWhiteSpace(node, configuration.tt) && node.getAttrByName("xml:space") == null) printString(fout, indent, " xml:space=\preserve\"); from printAttrs in PPrint.java and instead put in printTag, just before the call to printAttrs the following... if (configuration.XmlOut && configuration.XmlSpace && ParserImpl.XMLPreserveWhiteSpace(node, configuration.tt) && node.getAttrByName("xml:space") == null) node.addAttribute("xml:space", "preserve"); ---------------------------------------------------------------------- Comment By: Chris Bitmead (chrisbitmead) Date: 2003-11-03 04:32 Message: Logged In: YES user_id=223792 Just to clarify, because printAttrs in recursive, each recursive call will insert its own xml:space=preserve if the tag already has multiple attributes. This patch adds the attribute once up-front thus making sure the attribute comes out just once. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=113153&aid=834851&group_id=13153 |