Advisories for OGSA-DAI WSRF 2.2
The following advisories have been issued:
XMLCreateResource client toolkit activity for OGSA-DAI WSI 2.2
This is a patch to allow the client side XMLCreateResource activity
to processing XML documents that begin with the <?xml.... It fixes
a developer bug. For more details see below.
Please use the provided ANT build file to apply a patch to a binary or source OGSA-DAI 2.2 distribution. On the command line run the following:
ant -f patch.xml -Dogsadai.root=/PATH/TO/YOUR/OGSA-DAI/DISTRIBUTION
Replace /PATH/TO/YOUR/OGSA-DAI/DISTRIBUTION by the correct path of your
OGSA-DAI distribution (binary or source).
If patching the binary distribution make sure that a java compiler is on
the system path.
Download patch in tar.gz or zip format.
Details
This patch modifies the following classes:
uk.org.ogsadai.client.toolkit.activity.xmldb.XMLCreateResource uk.org.ogsadai.common.xml.XMLUtilities
In XMLCreateResource, within the setContext method the line:
mContent = content;
is replaced with:
mContent = XMLUtilities.stripXMLDeclaration(content);
and within the setContentFromFile method the line:
mContent = XMLUtilities.xmlDOMToString(
XMLUtilities.xmlFileToDOM(contentFileName, false));
is replaced with:
mContent = XMLUtilities.stripXMLDeclaration(
XMLUtilities.xmlDOMToString(
XMLUtilities.xmlFileToDOM(contentFileName, false)));
In XMLUtilities the following method is added:
/**
* Removes an XML declaration from the start of the specified XML string, if
* one exists. Otherwise, no action is taken and same string that was passed
* to the method is returned.
*
* @param xmlString
* a string describing an XML document
* @return a string describing an XML document without an XML declaration
*/
public static String stripXMLDeclaration(String xmlString)
{
if (xmlString.startsWith("&lh;?xml "))
{
System.out.println("Index = " + xmlString.indexOf("?>"));
return xmlString.substring(xmlString.indexOf("?>") + 2);
}
else
{
return xmlString;
}
}