Project

Profile

Help

Revision 4ef9a359

Added by Michael Kay over 12 years ago

Fix bug 2679879 - character maps in attributes containing single and double quotes

View differences:

latest9.1/bj/net/sf/saxon/event/XMLEmitter.java
464 464
                // null (0) characters will be used before and after any section of
465 465
                // the value generated from a character map
466 466
                writer.write('=');
467
                char delimiter = (val.indexOf('"') >= 0 ? '\'' : '"');
467
                char delimiter = (val.indexOf('"') >= 0 && val.indexOf('\'') < 0 ? '\'' : '"');
468 468
                writer.write(delimiter);
469 469
                writeEscape(value, true);
470 470
                writer.write(delimiter);

Also available in: Unified diff