Incorporated strict-then-sloppy XML parsing into the patch process
This commit is contained in:
parent
459474323c
commit
3572850586
6 changed files with 213 additions and 25 deletions
|
@ -636,11 +636,11 @@ public class ManagerFrame extends JFrame implements ActionListener, HashObserver
|
|||
resultBuf.append( "But malformed XML may break tools that do proper parsing, " );
|
||||
resultBuf.append( "and it hinders the development of new tools.\n" );
|
||||
resultBuf.append( "\n" );
|
||||
resultBuf.append( "In future releases, Slipstream will try to parse XML while " );
|
||||
resultBuf.append( "patching: first strictly, then failing over to a sloppy " );
|
||||
resultBuf.append( "parser. The sloppy parser will tolerate similar errors, " );
|
||||
resultBuf.append( "at the risk of unforseen behavior, so satisfying the " );
|
||||
resultBuf.append( "strict parser is advised.\n" );
|
||||
resultBuf.append( "Since v1.2, Slipstream will try to parse XML while patching: " );
|
||||
resultBuf.append( "first strictly, then failing over to a sloppy parser. " );
|
||||
resultBuf.append( "The sloppy parser will tolerate similar errors, at the risk " );
|
||||
resultBuf.append( "of unforseen behavior, so satisfying the strict parser " );
|
||||
resultBuf.append( "is advised.\n" );
|
||||
}
|
||||
infoArea.setDescription( "Results", resultBuf.toString() );
|
||||
}
|
||||
|
|
|
@ -298,6 +298,8 @@ public class ModXMLSandbox extends JDialog implements ActionListener {
|
|||
|
||||
|
||||
private void open() {
|
||||
messageArea.setText( "" );
|
||||
|
||||
FTLDat.FTLPack dataP = null;
|
||||
InputStream is = null;
|
||||
try {
|
||||
|
@ -345,6 +347,8 @@ public class ModXMLSandbox extends JDialog implements ActionListener {
|
|||
private void patch() {
|
||||
if ( mainDoc == null ) return;
|
||||
|
||||
messageArea.setText( "" );
|
||||
|
||||
try {
|
||||
String appendText = appendArea.getText();
|
||||
appendText = appendText.replaceFirst( "<[?]xml [^>]*?[?]>", "" );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue