////////////////////////////////////////////////////////////////////////////////
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
import avmplus.*
if (System.argv.length != 3)
trace("Usage locDiff fileOne.xml fileTwo.xml output.xml " );
else
{
var oldFile:XML = XML(File.read(System.argv[0]));
var newFile:XML = XML(File.read(System.argv[1]));
var diffableXML:XML = ;
//var elements:XMLList = oldFile.descendants("error");
if (newFile.warnings == undefined)
{
for each (var w:XML in newFile..error)
{
delete w.description;
var w2:XMLList = oldFile..error.(@id == w.@id);
delete w2.description;
if (w2 == undefined)
{
diffableXML.New += {String(w)}
}
else if (String(w2) != String(w))
{
diffableXML.changed += {String(w)}{String(w2)}
}
}
}
else
{
for each (var w:XML in newFile.warnings.warning)
{
delete w.description;
var w2:XMLList = oldFile.warnings..warning.(@id == w.@id);
delete w2.description;
if (w2 == undefined)
{
diffableXML.New += {String(w)}
}
else if (String(w2) != String(w))
{
diffableXML.changed += {String(w)}{String(w2)}
}
}
}
var s:String = "\n";
s += diffableXML.toXMLString()
File.write(System.argv[2], s);
}