Attribute corruption using Java 6
Added by Anonymous over 16 years ago
Legacy ID: #5083890 Legacy Poster: Gordon Cooke (cookeg)
I have been experiencing attribute corruption on some elements with a large number of attributes when using Java 6. I have produced the following test case which illustrates this problem: Input file: <In/> Transform: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml"/> <xsl:template match="/"> <A a="[a]" b="[a]" c="[a]" d="[a]" e="[a]" f="[a]" j="[a]" m="[%ok]" n="[a]"/> </xsl:template> </xsl:stylesheet> When I run this under Java 5 I get the following (expected output): <?xml version="1.0" encoding="UTF-8"?><A a="[a]" b="[a]" c="[a]" d="[a]" e="[a]" f="[a]" j="[a]" m="[%ok]" n="[a]"/> When I run this under Java 6 I get the following (with the "j" attribute value corrupt): <?xml version="1.0" encoding="UTF-8"?><A a="[a]" b="[a]" c="[a]" d="[a]" e="[a]" f="[a]" j="[%o" m="[%ok]" n="[a]"/> I have experience these problems with various versions of saxon 8/9. In particular the output above was produced using JDK 1.6.0_06 with saxonb9.1.0.1j. I ran saxon using: java -jar saxon9.jar -s in.xml -o out.xml transform.xsl
Replies (2)
RE: Attribute corruption using Java 6 - Added by Anonymous over 16 years ago
Legacy ID: #5083956 Legacy Poster: Michael Kay (mhkay)
If I remember rightly this is a known problem in the version of Xerces that is shipped with Java 6. I suggest using the Apache version of Xerces, or choosing some other XML parser. The problem has nothing to do with Saxon. See also: http://markmail.org/message/e73eijertcdquqhv http://markmail.org/message/py6ukptjlm3qv6l5 Michael Kay
RE: Attribute corruption using Java 6 - Added by Anonymous over 16 years ago
Legacy ID: #5084231 Legacy Poster: Gordon Cooke (cookeg)
Using Xerces from Apache does indeed fix the problem.
Please register to reply