|
From: <jav...@us...> - 2012-08-02 02:17:14
|
Revision: 171
http://andspidclient.svn.sourceforge.net/andspidclient/?rev=171&view=rev
Author: javinovich
Date: 2012-08-02 02:17:06 +0000 (Thu, 02 Aug 2012)
Log Message:
-----------
DMSTECH-3773:
- Update DOI client to be compliant with XML interface for ANDS DOI Service 1.1
- XML request used in minting and updating DOI is now validated against DataCite Metadata Schema v 2.2 before being sent to ANDS DOI service.
- Response codes are now used to determine if an operation completed successfully.
Modified Paths:
--------------
trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java
trunk/src/main/java/au/csiro/doiclient/AndsDoiResponse.java
trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java
trunk/src/main/resources/DoiMetadataTemplate.xml
trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java
Added Paths:
-----------
trunk/src/main/resources/schema/
trunk/src/main/resources/schema/include/
trunk/src/main/resources/schema/include/datacite-contributorType-v2.xsd
trunk/src/main/resources/schema/include/datacite-dateType-v2.xsd
trunk/src/main/resources/schema/include/datacite-descriptionType-v2.xsd
trunk/src/main/resources/schema/include/datacite-relatedIdentifierType-v2.xsd
trunk/src/main/resources/schema/include/datacite-relationType-v2.xsd
trunk/src/main/resources/schema/include/datacite-resourceType-v2.xsd
trunk/src/main/resources/schema/include/datacite-titleType-v2.xsd
trunk/src/main/resources/schema/metadata.xsd
Modified: trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java
===================================================================
--- trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java 2012-07-30 07:46:49 UTC (rev 170)
+++ trunk/src/main/java/au/csiro/doiclient/AndsDoiClient.java 2012-08-02 02:17:06 UTC (rev 171)
@@ -15,6 +15,11 @@
*/
package au.csiro.doiclient;
+import au.csiro.doiclient.business.AndsDoiIdentity;
+import au.csiro.doiclient.business.DoiDTO;
+import au.csiro.doiclient.utils.DoiMetaDataGenerator;
+import au.csiro.doiclient.utils.HttpUtil;
+import au.csiro.pidclient.AndsPidClient.HandleType;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
@@ -22,14 +27,16 @@
import java.net.URLEncoder;
import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
-
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.HttpURL;
import org.apache.commons.httpclient.HttpsURL;
import org.apache.commons.httpclient.NameValuePair;
@@ -38,12 +45,6 @@
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
-import au.csiro.doiclient.business.AndsDoiIdentity;
-import au.csiro.doiclient.business.DoiDTO;
-import au.csiro.doiclient.utils.DoiMetaDataGenerator;
-import au.csiro.doiclient.utils.HttpUtil;
-import au.csiro.pidclient.AndsPidClient.HandleType;
-
/**
* This is the main interface to the ANDS DOI Client library. It allows the caller to interact with the <a
* href="http://www.ands.org.au/services/doi-m2m-identifiers.html">Digital Object IDentifier Service</a> provided by the
@@ -66,8 +67,22 @@
* </UL>
* <p>
* This class has methods for (a)minting DOIs, (b)updating DOIs, (c) activating and deactivating DOIs.
+ * </p>
+ * <b>Debug:</b>
+ * <p>
+ * The methods requestMetaDataOfDOI, mintDOI, activateDOI, deactivateDOI and upDateDOI have an optional debug parameter.
+ * This is only meant to be used to diagnose problems while calling the ANDS web services.
+ * </p>
+ * <p>
+ * When activating the debug flag you must also activate this class logger (LOG) to print trace statements. The output
+ * from this logger will generally be requested when opening a ticket with the ANDS service desk.
+ * </p>
+ * <p>
+ * <b>Warning:</b> Enabling the debug flag will most likely break the method calls, as the response format
+ * won't be XML as it is expected under normal operation.
+ * Don't rely in the responses coming from the method calls when debug is enabled.
+ * </p>
*
- * </p>
* Copyright 2012, CSIRO Australia All rights reserved.
*
* @author Robert Bridle on 05/02/2010
@@ -77,7 +92,9 @@
public class AndsDoiClient
{
/**
- * Constant that defines the logger to be used.
+ * The logger used by this class.
+ *
+ * It's name is au.csiro.doiclient.AndsDoiClient
*/
public static final Logger LOG = Logger.getLogger(AndsDoiClient.class.getName());
@@ -150,6 +167,10 @@
/**
+ * The list of valid success response codes
+ */
+ private static final List<String> successCodes = Arrays.asList("MT001", "MT002", "MT003", "MT004");
+ /**
* Loads the specified properties file.
*/
static
@@ -375,7 +396,9 @@
* @param doi
* that needs to be updated.
* @param updatedUrl
- * the url pointing to the landing page of the data collection.
+ * The url pointing to the landing page of the data collection.
+ * It is very important that the base domain for updatedUrl is the list of registered
+ * domains in ANDS otherwise the method will fail
* @param doiDTO
* doiDTO with the values for the meta-data update.
* @param debug
@@ -415,7 +438,7 @@
AndsDoiResponse existingMetaDataXML = requestMetaDataOfDOI(doi);
return executeMethod(params, updateMethodName,
- existingMetaDataXML.getMetaData(), doiDTO);
+ existingMetaDataXML.getMessage(), doiDTO);
}
/**
@@ -687,8 +710,8 @@
if (LOG.isDebugEnabled())
{
- LOG.debug("ExecuteMethod : Query String : ->" + queryStringParams);
- LOG.debug("ExecuteMethod : Method Name : ->" + methodName);
+ LOG.debug("Query String: " + queryStringParams);
+ LOG.debug("Method Name: " + methodName);
}
HttpsURL url = new HttpsURL(this.getDoiServiceHost(), this.getDoiServicePort(), this.getDoiServicePath());
@@ -814,6 +837,11 @@
}
doiResponse = new AndsDoiResponse();
doiResponse.setMessage(outputBuffer.toString());
+ if(LOG.isTraceEnabled())
+ {
+ LOG.trace("Response Message:" + doiResponse.getMessage());
+ }
+
setResponseFlag(method.getStatusCode(), doiResponse);
}
finally
@@ -840,36 +868,26 @@
}
/**
- * Sets a boolean flag indicating success or failure based on the returned code.
+ * Sets the success flag in doiResponse indicating success or failure based on httpResponseCode
+ * and doiResponse.getResponseCode()
+ * If the response code is HttpStatus.SC_OK and doiResponse.getResponseCode() is one of "MT001", "MT002", "MT003",
+ * "MT004" then doiResponse.isSuccess will be true, otherwise it will be false
*
- * @param responseCode
- * code returned from the web service invocation.
- * @param responseMessage
- * message returned from the web service invocation.
+ * @param httpResponseCode
+ * http code returned from the web service invocation.
* @param doiResponse
- * response to be sent back to the client.
+ * contains the response code and success flag
*
*/
- private static void setResponseFlag(int responseCode, AndsDoiResponse doiResponse)
+ private static void setResponseFlag(int httpResponseCode, AndsDoiResponse doiResponse)
{
- switch (responseCode)
+ if(httpResponseCode == HttpStatus.SC_OK)
{
- case 200:
- if ((doiResponse.getMessage().contains("successfully"))
- || doiResponse.getMessage().contains("<?xml version="))
- {
- doiResponse.setSuccess(true);
- }
- else
- {
- doiResponse.setSuccess(false);
- }
- break;
- case 415:
- case 500:
- default:
+ doiResponse.setSuccess(
+ successCodes.contains(doiResponse.getResponseCode()));
+ } else
+ {
doiResponse.setSuccess(false);
- break;
}
}
@@ -972,5 +990,4 @@
{
this.metadataTemplatePath = metadataTemplatePath;
}
-
}
Modified: trunk/src/main/java/au/csiro/doiclient/AndsDoiResponse.java
===================================================================
--- trunk/src/main/java/au/csiro/doiclient/AndsDoiResponse.java 2012-07-30 07:46:49 UTC (rev 170)
+++ trunk/src/main/java/au/csiro/doiclient/AndsDoiResponse.java 2012-08-02 02:17:06 UTC (rev 171)
@@ -43,6 +43,11 @@
* Whether an ANDS DOI service call was successful.
*/
private boolean success;
+
+ /**
+ * Any of the response codes from Cite My Data M2M service
+ */
+ private String responseCode;
/**
@@ -93,9 +98,10 @@
/**
* ANDs has requested us to change the schema version to 2.1 for all meta-data sent to ANDs even though they send
* meta-data pertaining to version 2.2 in a GET Meta-data request.
- *
+ * @deprecated The version received should be used as it is to call back ANDS DOI services
* @return the metaData if it has been retrieved, null otherwise
*/
+ @Deprecated
public String getMetaData()
{
if (getMessage() != null)
@@ -106,7 +112,6 @@
{
return null;
}
-
}
/**
@@ -132,20 +137,71 @@
*/
private void extractDOI()
{
- doi = null;
if (isSuccess())
{
- int startIndex = getMessage().indexOf("DOI");
- int endIndex = getMessage().indexOf("was");
+ doi = extractElementFromXmlMessage("doi");
+ }
+ }
+
+ /**
+ * Extracts the response code into responseCode from the DOI service response body, if no response code could be extracted
+ * from the response body then null is set
+ */
+ private void extractResponseCode()
+ {
+ responseCode = extractElementFromXmlMessage("responsecode");
+ }
- if (startIndex > 0 && endIndex > 0)
+
+ /**
+ * Very basic parser to extract values for xml elements inside getMessage()
+ * @param elementName The XML Element name we want to extract
+ * @return the value for elementName or null if not found
+ */
+ private String extractElementFromXmlMessage(String elementName)
+ {
+ String xmlPrefix = "<" + elementName + ">";
+ String xmlPostfix = "</" + elementName + ">";
+
+ String value = null;
+ int startIndex = getMessage().indexOf(xmlPrefix);
+ int endIndex = getMessage().indexOf(xmlPostfix);
+
+ if (startIndex > 0 && endIndex > 0)
+ {
+ try
{
- doi = getMessage().substring(startIndex + 3, endIndex).trim();
+ value = getMessage().substring(startIndex + xmlPrefix.length() , endIndex).trim();
+ }
+ catch (IndexOutOfBoundsException e)
+ {
+ return null;
}
}
+ return value;
}
+
+ /**
+ * @return the responseCode
+ */
+ public String getResponseCode()
+ {
+ extractResponseCode();
+ return responseCode;
+ }
+
+
+ /**
+ * @param responseCode the responseCode to set
+ */
+ public void setResponseCode(String responseCode)
+ {
+ this.responseCode = responseCode;
+ }
+
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@@ -157,12 +213,13 @@
if (doi != null)
builder.append("doi=").append(doi).append(", ");
builder.append("success=").append(success).append(", ");
+ if (responseCode != null)
+ builder.append("responseCode=").append(responseCode).append(", ");
if (message != null)
- builder.append("\nmessage=").append(message);
- builder.append("\n]");
+ builder.append("\nmessage=\n").append(message);
+ builder.append("]");
return builder.toString();
}
-
}
Modified: trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java
===================================================================
--- trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java 2012-07-30 07:46:49 UTC (rev 170)
+++ trunk/src/main/java/au/csiro/doiclient/utils/DoiMetaDataGenerator.java 2012-08-02 02:17:06 UTC (rev 171)
@@ -1,5 +1,5 @@
/**
- * Copyright 2012, CSIRO Australia.
+ * Copyright 2010, CSIRO Australia.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,10 @@
*/
package au.csiro.doiclient.utils;
+import java.io.StringReader;
+
+import org.jdom.input.SAXBuilder;
+
import java.io.IOException;
import java.io.InputStream;
@@ -73,6 +77,9 @@
/** Constant giving the path to the meta-data template **/
private static final String metadataTemplatePath = "/DoiMetadataTemplate.xml";
+
+ /** Constant giving the path to the local copy of DataCite Metadata Schema **/
+ private static final String SCHEMA_LOCALTION = "/schema/metadata.xsd";
/**
* Constant that defines the logger to be used.
@@ -89,14 +96,21 @@
* if the XML Document access fails
* @throws JDOMException
* when invalid XML parsing/access occurs
+ * @throws IllegalArgumentException If a parameter in doiDTO would violate the restrictions set on
+ * <a href="http://schema.datacite.org/meta/kernel-2.2/index.html">DataCite Metadata Schema v 2.2</a>
*/
public static String createDoiMetaDataXML(DoiDTO doiDTO) throws IOException,
JDOMException
{
InputStream is = DoiMetaDataGenerator.class.getResourceAsStream(metadataTemplatePath);
+
+
+
+ SAXBuilder builder = createValidationSAXBuilder(SCHEMA_LOCALTION);
- Document document = ConverterUtils.getXmlDocument(is, "DoiMetadataTemplate.xml");
+ // Implicit validation, it should not happen if the template is properly built
+ Document document = builder.build(is);
ConverterUtils.updateElementValues(document, NAME_SPACE, CREATOR_NAME_XPATH, doiDTO.getCreators());
@@ -107,10 +121,39 @@
ConverterUtils.updateElementValue(document, NAME_SPACE, DoiMetaDataGenerator.PUBLICATIONYEAR_NAME_XPATH,
doiDTO.getPublicationYear());
- return ConverterUtils.outputTheXml(document);
+ String result = ConverterUtils.outputTheXml(document);
+
+ try
+ {
+ document = builder.build(new StringReader(result));
+ }
+ catch (JDOMException e)
+ {
+ throw new IllegalArgumentException("It is most likely that one parameter in DoiDTO is invalid", e);
+ }
+
+ return result;
}
/**
+ * @param schemaLocation
+ * @return
+ */
+ private static SAXBuilder createValidationSAXBuilder(String schemaLocation)
+ {
+ java.net.URL url =
+ DoiMetaDataGenerator.class.getResource(schemaLocation);
+
+ SAXBuilder builder = new SAXBuilder(true);
+ builder.setFeature("http://apache.org/xml/features/validation/schema", true);
+
+ builder.setProperty(
+ "http://apache.org/xml/properties/schema/external-schemaLocation",
+ url.toString());
+ return builder;
+ }
+
+ /**
* Updates a String representation of a DOIMetaData XML document from an DoiDTO bean using an existing metadata
* document.
*
@@ -126,8 +169,12 @@
JDOMException
{
- Document document = ConverterUtils.xmlToDoc(metaDataDocument);
+ SAXBuilder builder = createValidationSAXBuilder(SCHEMA_LOCALTION);
+ // Implicit validation, it should not happen if the template is properly built
+ Document document = builder.build(new StringReader(metaDataDocument));
+
+
if ((doiDto.getCreators() != null) && (doiDto.getCreators().size() > 0))
{
ConverterUtils.updateElementValues(document, NAME_SPACE, CREATOR_NAME_XPATH, doiDto.getCreators());
@@ -155,8 +202,19 @@
{
ConverterUtils.updateElementValue(document, NAME_SPACE, IDENTIFIER_NAME_XPATH, doiDto.getIdentifier());
}
+
+ String result = ConverterUtils.outputTheXml(document);
- return ConverterUtils.outputTheXml(document);
+ try
+ {
+ document = builder.build(new StringReader(result));
+ }
+ catch (JDOMException e)
+ {
+ throw new IllegalArgumentException("It is most likely that one parameter in DoiDTO is invalid", e);
+ }
+
+ return result;
}
Modified: trunk/src/main/resources/DoiMetadataTemplate.xml
===================================================================
--- trunk/src/main/resources/DoiMetadataTemplate.xml 2012-07-30 07:46:49 UTC (rev 170)
+++ trunk/src/main/resources/DoiMetadataTemplate.xml 2012-08-02 02:17:06 UTC (rev 171)
@@ -15,10 +15,10 @@
limitations under the License.
-->
-<resource xmlns="http://datacite.org/schema/kernel-2.1"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://datacite.org/schema/kernel-2.1
-http://schema.datacite.org/meta/kernel-2.1/metadata.xsd">
+<resource xmlns="http://datacite.org/schema/kernel-2.2"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://datacite.org/schema/kernel-2.2
+http://schema.datacite.org/meta/kernel-2.2/metadata.xsd">
<identifier identifierType="DOI">10.2312/meyniana.2005.57.101</identifier>
<creators>
<creator>
Added: trunk/src/main/resources/schema/include/datacite-contributorType-v2.xsd
===================================================================
--- trunk/src/main/resources/schema/include/datacite-contributorType-v2.xsd (rev 0)
+++ trunk/src/main/resources/schema/include/datacite-contributorType-v2.xsd 2012-08-02 02:17:06 UTC (rev 171)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified">
+ <xs:simpleType name="contributorType">
+ <xs:annotation>
+ <xs:documentation>The type of contributor of the resource.</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ContactPerson"/>
+ <xs:enumeration value="DataCollector"/>
+ <xs:enumeration value="DataManager"/>
+ <xs:enumeration value="Distributor"/>
+ <xs:enumeration value="Editor"/>
+ <xs:enumeration value="Funder"/>
+ <xs:enumeration value="HostingInstitution"/>
+ <xs:enumeration value="Producer"/>
+ <xs:enumeration value="ProjectLeader"/>
+ <xs:enumeration value="ProjectMember"/>
+ <xs:enumeration value="RegistrationAgency"/>
+ <xs:enumeration value="RegistrationAuthority"/>
+ <xs:enumeration value="RelatedPerson"/>
+ <xs:enumeration value="RightsHolder"/>
+ <xs:enumeration value="Researcher"/>
+ <xs:enumeration value="Sponsor"/>
+ <xs:enumeration value="Supervisor"/>
+ <xs:enumeration value="WorkPackageLeader"/>
+ </xs:restriction>
+ </xs:simpleType>
+</xs:schema>
Added: trunk/src/main/resources/schema/include/datacite-dateType-v2.xsd
===================================================================
--- trunk/src/main/resources/schema/include/datacite-dateType-v2.xsd (rev 0)
+++ trunk/src/main/resources/schema/include/datacite-dateType-v2.xsd 2012-08-02 02:17:06 UTC (rev 171)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified">
+ <xs:simpleType name="dateType">
+ <xs:annotation>
+ <xs:documentation>The type of date. To indicate a date period, provide two dates, specifying the StartDate and the EndDate. To indicate the end of an embargo period, use Available. To indicate the start of an embargo period, use Submitted or Accepted, as appropriate.</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="Accepted"/><!--The date that the publisher accepted the resource into their system.-->
+ <xs:enumeration value="Available"/><!--The date the resource is made publicly available. May be a range.-->
+ <xs:enumeration value="Copyrighted"/><!--The specific, documented date at which the resource receives a copyrighted status, if applicable.-->
+ <xs:enumeration value="Created"/><!--The date the resource itself was put together; this could be a date range or a single date for a final component, e.g., the finalised file with all of the data.-->
+ <xs:enumeration value="EndDate"/><!--Use if any other date type covers a range-->
+ <xs:enumeration value="Issued"/><!--The date that the resource is published or distributed e.g. to a data center.-->
+ <xs:enumeration value="StartDate"/><!--Use if any other date type covers a range.-->
+ <xs:enumeration value="Submitted"/><!--The date the creator submits the resource to the publisher. This could be different from Accepted if the publisher then applies a selection process.-->
+ <xs:enumeration value="Updated"/><!--The date of the last update to the resource, when the resource is being added to. May be a range.-->
+ <xs:enumeration value="Valid"/><!--The date or date range during which the dataset or resources are accurate. May be a range.-->
+ </xs:restriction>
+ </xs:simpleType>
+</xs:schema>
Added: trunk/src/main/resources/schema/include/datacite-descriptionType-v2.xsd
===================================================================
--- trunk/src/main/resources/schema/include/datacite-descriptionType-v2.xsd (rev 0)
+++ trunk/src/main/resources/schema/include/datacite-descriptionType-v2.xsd 2012-08-02 02:17:06 UTC (rev 171)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified">
+ <xs:simpleType name="descriptionType">
+ <xs:annotation>
+ <xs:documentation>The type of the description.</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="Abstract"/>
+ <xs:enumeration value="SeriesInformation"/>
+ <xs:enumeration value="TableOfContents"/>
+ <xs:enumeration value="Other"/>
+ </xs:restriction>
+ </xs:simpleType>
+</xs:schema>
Added: trunk/src/main/resources/schema/include/datacite-relatedIdentifierType-v2.xsd
===================================================================
--- trunk/src/main/resources/schema/include/datacite-relatedIdentifierType-v2.xsd (rev 0)
+++ trunk/src/main/resources/schema/include/datacite-relatedIdentifierType-v2.xsd 2012-08-02 02:17:06 UTC (rev 171)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified">
+ <xs:simpleType name="relatedIdentifierType">
+ <xs:annotation>
+ <xs:documentation>The type of the RelatedIdentifier.</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ARK"/>
+ <xs:enumeration value="DOI"/>
+ <xs:enumeration value="EAN13"/>
+ <xs:enumeration value="EISSN"/>
+ <xs:enumeration value="Handle"/>
+ <xs:enumeration value="ISBN"/>
+ <xs:enumeration value="ISSN"/>
+ <xs:enumeration value="ISTC"/>
+ <xs:enumeration value="LISSN"/>
+ <xs:enumeration value="LSID"/>
+ <xs:enumeration value="PURL"/>
+ <xs:enumeration value="UPC"/>
+ <xs:enumeration value="URL"/>
+ <xs:enumeration value="URN"/>
+ </xs:restriction>
+ </xs:simpleType>
+</xs:schema>
Added: trunk/src/main/resources/schema/include/datacite-relationType-v2.xsd
===================================================================
--- trunk/src/main/resources/schema/include/datacite-relationType-v2.xsd (rev 0)
+++ trunk/src/main/resources/schema/include/datacite-relationType-v2.xsd 2012-08-02 02:17:06 UTC (rev 171)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified">
+ <xs:simpleType name="relationType">
+ <xs:annotation>
+ <xs:documentation>Description of the relationship of the resource being registered (A) and the related resource (B).</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="IsCitedBy"/><!--indicates that B includes A in a citation-->
+ <xs:enumeration value="Cites"/><!--indicates that A includes B in a citation-->
+ <xs:enumeration value="IsSupplementTo"/><!--indicates that A is a supplement to B-->
+ <xs:enumeration value="IsSupplementedBy"/><!--indicates that B is a supplement to A-->
+ <xs:enumeration value="IsContinuedBy"/><!--indicates A is continued by the work B-->
+ <xs:enumeration value="Continues"/><!--indicates A is a continuation of the work B-->
+ <xs:enumeration value="IsNewVersionOf"/><!--indicates B is a new edition of A, where the new edition has been modified or updated-->
+ <xs:enumeration value="IsPreviousVersionOf"/><!--indicates B is a previous edition of A-->
+ <xs:enumeration value="IsPartOf"/><!--indicates A is a portion of B-->
+ <xs:enumeration value="HasPart"/><!--indicates A includes the part B-->
+ <xs:enumeration value="IsReferencedBy"/><!--indicates A is used as a source of information by B-->
+ <xs:enumeration value="References"/><!--indicates B is used as a source of information for A-->
+ <xs:enumeration value="IsDocumentedBy"/><!--indicates B is documentation about/explaining A-->
+ <xs:enumeration value="Documents"/><!--indicates A is documentation about/explaining B-->
+ <xs:enumeration value="IsCompiledBy"/><!--indicates B is used to compile or create A-->
+ <xs:enumeration value="Compiles"/><!--indicates B is the result of a compile or creation event using A-->
+ <xs:enumeration value="IsVariantFormOf"/><!--indicates B is a variant or different form of A, e.g. calculated or calibrated form or different packaging-->
+ <xs:enumeration value="IsOriginalFormOf"/><!--indicates B is the original form of A-->
+ </xs:restriction>
+ </xs:simpleType>
+</xs:schema>
Added: trunk/src/main/resources/schema/include/datacite-resourceType-v2.xsd
===================================================================
--- trunk/src/main/resources/schema/include/datacite-resourceType-v2.xsd (rev 0)
+++ trunk/src/main/resources/schema/include/datacite-resourceType-v2.xsd 2012-08-02 02:17:06 UTC (rev 171)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified">
+ <xs:simpleType name="resourceType">
+ <xs:annotation>
+ <xs:documentation>The general type of a resource.</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="Collection"/>
+ <xs:enumeration value="Dataset"/>
+ <xs:enumeration value="Event"/>
+ <xs:enumeration value="Film"/>
+ <xs:enumeration value="Image"/>
+ <xs:enumeration value="InteractiveResource"/>
+ <xs:enumeration value="Model"/>
+ <xs:enumeration value="PhysicalObject"/>
+ <xs:enumeration value="Service"/>
+ <xs:enumeration value="Software"/>
+ <xs:enumeration value="Sound"/>
+ <xs:enumeration value="Text"/>
+ </xs:restriction>
+ </xs:simpleType>
+</xs:schema>
Added: trunk/src/main/resources/schema/include/datacite-titleType-v2.xsd
===================================================================
--- trunk/src/main/resources/schema/include/datacite-titleType-v2.xsd (rev 0)
+++ trunk/src/main/resources/schema/include/datacite-titleType-v2.xsd 2012-08-02 02:17:06 UTC (rev 171)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany --><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified">
+ <xs:simpleType name="titleType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="AlternativeTitle"/>
+ <xs:enumeration value="Subtitle"/>
+ <xs:enumeration value="TranslatedTitle"/>
+ </xs:restriction>
+ </xs:simpleType>
+</xs:schema>
Added: trunk/src/main/resources/schema/metadata.xsd
===================================================================
--- trunk/src/main/resources/schema/metadata.xsd (rev 0)
+++ trunk/src/main/resources/schema/metadata.xsd 2012-08-02 02:17:06 UTC (rev 171)
@@ -0,0 +1,316 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Revision history
+ 2010-08-26 Complete revision according to new common specification by the metadata work group after review. AJH, DTIC
+ 2010-11-17 Revised to current state of kernel review, FZ, TIB
+ 2011-01-17 Complete revsion after community review. FZ, TIB
+ 2011-03-17 Release of v2.1: added a namespace; mandatory properties got minLength; changes in the definitions of relationTypes
+ IsDocumentedBy/Documents and isCompiledBy/Compiles; changes type of property "Date" from xs:date to xs:string. FZ, TIB
+ 2011-06-27 v2.2: namespace: kernel-2.2, additions to controlled lists "resourceType", "contributorType", "relatedIdentifierType", and "descriptionType". Removal of intermediate include-files.
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-2.2" targetNamespace="http://datacite.org/schema/kernel-2.2" elementFormDefault="qualified" xml:lang="EN">
+ <xs:include schemaLocation="include/datacite-titleType-v2.xsd"/>
+ <xs:include schemaLocation="include/datacite-contributorType-v2.xsd"/>
+ <xs:include schemaLocation="include/datacite-dateType-v2.xsd"/>
+ <xs:include schemaLocation="include/datacite-resourceType-v2.xsd"/>
+ <xs:include schemaLocation="include/datacite-relationType-v2.xsd"/>
+ <xs:include schemaLocation="include/datacite-relatedIdentifierType-v2.xsd"/>
+ <xs:include schemaLocation="include/datacite-descriptionType-v2.xsd"/>
+ <xs:element name="resource">
+ <xs:annotation>
+ <xs:documentation>
+ Root element of a single record. This wrapper element is for XML implementation only and is not defined in the DataCite DOI standard.
+ Note: This is the case for any wrapper element within this schema!</xs:documentation>
+ <xs:documentation>No content in this wrapper element.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <!--REQUIRED FIELDS-->
+ <xs:element name="identifier">
+ <xs:annotation>
+ <xs:documentation>A persistent identifier that identifies a resource.</xs:documentation>
+ <xs:documentation>Currently, only DOI is allowed.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="doiType">
+ <xs:attribute name="identifierType" use="required" fixed="DOI"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="creators">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="creator" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>The main researchers involved working on the data, or the authors of the publication in priority order. May be a corporate/institutional or personal name.</xs:documentation>
+ <xs:documentation>Format: Family, Given.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="creatorName">
+ <xs:simpleType>
+ <xs:restriction base="nonemptycontentStringType"/>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="nameIdentifier" minOccurs="0">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="nonemptycontentStringType">
+ <xs:attribute name="nameIdentifierScheme" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="titles">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="title" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>A name or title by which a resource is known.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="nonemptycontentStringType">
+ <xs:attribute name="titleType" type="titleType" use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="publisher">
+ <xs:annotation>
+ <xs:documentation>A holder of the data (including archives as appropriate) or institution which submitted the work. Any others may be listed as contributors. This property will be used to formulate the citation, so consider the prominence of the role.</xs:documentation>
+ <xs:documentation>Examples: World Data Center for Climate (WDCC); GeoForschungsZentrum Potsdam (GFZ); Geological Institute, University of Tokyo </xs:documentation>
+ <xs:documentation>In the case of datasets, "publish" is understood to mean making the data available to the community of researchers.</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="nonemptycontentStringType"/>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="publicationYear">
+ <xs:annotation>
+ <xs:documentation>Year when the data is made publicly available. If an embargo period has been in effect, use the date when the embargo period ends.</xs:documentation>
+ <xs:documentation>YYYY</xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="yearType"/>
+ </xs:simpleType>
+ </xs:element>
+ <!--OPTIONAL FIELDS-->
+ <xs:element name="subjects" minOccurs="0">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="subject" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Subject, keywords, classification codes, or key phrases describing the resource.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="subjectScheme" use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="contributors" minOccurs="0">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="contributor" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>The institution or person responsible for collecting, creating, or otherwise contributing to the developement of the dataset.</xs:documentation>
+ <xs:documentation>The personal name format should be: Family, Given.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:element name="contributorName">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="nameIdentifier" minOccurs="0">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="nameIdentifierScheme" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="contributorType" type="contributorType" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="dates" minOccurs="0">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="date" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Different dates relevant to the work.</xs:documentation>
+ <xs:documentation>YYYY or YYYY-MM-DD or any other format described in W3CDTF (http://www.w3.org/TR/NOTE-datetime) </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="dateType" type="dateType" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="language" type="xs:language" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>Primary language of the resource. Allowed values from: ISO 639-2/B, ISO 639-3</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="resourceType" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>The type of a resource. You may enter an additional free text description.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:annotation>
+ <xs:documentation>Use this attribute to choose the general type of the resource from the controlled list.</xs:documentation>
+ </xs:annotation>
+ <xs:attribute name="resourceTypeGeneral" type="resourceType" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="alternateIdentifiers" minOccurs="0">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="alternateIdentifier" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>An identifier other than the primary identifier applied to the resource being registered. This may be any alphanumeric string which is unique within its domain of issue. The format is open</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="alternateIdentifierType" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="relatedIdentifiers" minOccurs="0">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="relatedIdentifier" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Identifiers of related resources. Use this property to indicate subsets of properties, as appropriate.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="relatedIdentifierType" type="relatedIdentifierType" use="required"/>
+ <xs:attribute name="relationType" type="relationType" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="sizes" minOccurs="0">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="size" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Unstructures size information about the resource. </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="formats" minOccurs="0">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="format" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>Technical format of the resource.</xs:documentation>
+ <xs:documentation>Use file extension or MIME type where possible.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="version" type="xs:string" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>Version number of the resource. If the primary resource has changed the version number increases.</xs:documentation>
+ <xs:documentation>Register a new DOI (or primary identifier) when the version of the resource changes to enable the citation of the exact version of a research dataset (or other resource). May be used in conjunction with properties 11 and 12 (AlternateIdentifier and RelatedIdentifier) to indicate various information updates.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="rights" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>Any rights information for this resource. Provide a rights management statement for the resource or reference a service providing such information. Include embargo information if applicable.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="descriptions" minOccurs="0">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="description" maxOccurs="unbounded">
+ <xs:complexType mixed="true">
+ <xs:choice>
+ <xs:element name="br" minOccurs="0" maxOccurs="unbounded">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:length value="0"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ </xs:choice>
+ <xs:attribute name="descriptionType" type="descriptionType" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="lastMetadataUpdate" type="xs:date" use="optional"/>
+ <xs:attribute name="metadataVersionNumber" type="xs:integer" use="optional"/>
+ <!--ADMINISTRATIVE FIELDS-->
+ </xs:complexType>
+ </xs:element>
+ <!-- TYPE DECLARATIONS -->
+ <!-- defines the value for a DOI: DOI must start with "10." -->
+ <xs:simpleType name="doiType">
+ <xs:restriction base="xs:token">
+ <xs:pattern value="[1][0][/.].*"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <!-- defines value for mandatory fields -->
+ <xs:simpleType name="nonemptycontentStringType">
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:attributeGroup name="nameId">
+ <xs:attribute name="nameIdentifier" type="xs:string" use="optional"/>
+ <xs:attribute name="nameIdentifierScheme" type="xs:string" use="optional"/>
+ </xs:attributeGroup>
+ <!-- defines the value for a year -->
+ <xs:simpleType name="yearType">
+ <xs:restriction base="xs:token">
+ <xs:pattern value="[\d]{4}"/>
+ </xs:restriction>
+ </xs:simpleType>
+</xs:schema>
Modified: trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java
===================================================================
--- trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java 2012-07-30 07:46:49 UTC (rev 170)
+++ trunk/src/test/java/au/csiro/doiclient/utils/TestDoiMetaDataGenerator.java 2012-08-02 02:17:06 UTC (rev 171)
@@ -1,5 +1,5 @@
/**
- * Copyright 2012, CSIRO Australia.
+ * Copyright 2010, CSIRO Australia.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,17 +15,14 @@
*/
package au.csiro.doiclient.utils;
+import au.csiro.doiclient.business.DoiDTO;
import java.util.ArrayList;
import java.util.List;
-
import junit.framework.TestCase;
-
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.xpath.XPath;
-import au.csiro.doiclient.business.DoiDTO;
-
/**
* Test case for the DoiMetaDataGenerator
*
@@ -107,6 +104,7 @@
Document document = ConverterUtils.xmlToDoc(doiMetaDataXML);
XPath xPath = XPath.newInstance(CREATOR_NAME_XPATH);
xPath.addNamespace("xsi", document.getRootElement().getNamespaceURI());
+ @SuppressWarnings("rawtypes")
List nodes = xPath.selectNodes(document);
assertEquals(6, nodes.size());
@@ -115,7 +113,67 @@
assertEquals("Phillips,David", ((Element) nodes.get(0)).getText());
}
+ /**
+ * Tests the validation of generation of DoiMetaData XML when invalid parameters are introduced
+ *
+ * @throws Exception
+ */
+ public final void testCreateDoiMetaDataXMLWithInvalidData() throws Exception
+ {
+ DoiDTO doiDTO = populateDummydoiDTO();
+ doiDTO.setPublicationYear("234");
+ try
+ {
+ DoiMetaDataGenerator.createDoiMetaDataXML(doiDTO);
+ fail("Validation for Publication Year passed even when we expected to fail");
+ }
+ catch (IllegalArgumentException ex)
+ {
+ // This is expected
+ }
+
+ doiDTO = populateDummydoiDTO();
+ doiDTO.setTitle(null);
+
+ try
+ {
+ DoiMetaDataGenerator.createDoiMetaDataXML(doiDTO);
+ fail("Validation for Title passed even when we expected to fail");
+ }
+ catch (IllegalArgumentException ex)
+ {
+ // This is expected
+ }
+
+ doiDTO = populateDummydoiDTO();
+ doiDTO.getCreators().clear();
+ doiDTO.getCreators().add(0, "");
+
+ try
+ {
+ DoiMetaDataGenerator.createDoiMetaDataXML(doiDTO);
+ fail("Validation for Creator passed even when we expected to fail");
+ }
+ catch (IllegalArgumentException ex)
+ {
+ // This is expected
+ }
+
+ doiDTO = populateDummydoiDTO();
+ doiDTO.setPublisher(null);
+
+ try
+ {
+ DoiMetaDataGenerator.createDoiMetaDataXML(doiDTO);
+ fail("Validation for Publisher passed even when we expected to fail");
+ }
+ catch (IllegalArgumentException ex)
+ {
+ // This is expected
+ }
+ }
+
/**
* Tests the updation of the identifier
*
@@ -135,6 +193,7 @@
Document document = ConverterUtils.xmlToDoc(updatedMetaData);
XPath xPath = XPath.newInstance(IDENTIFIER_NAME_XPATH);
xPath.addNamespace("xsi", document.getRootElement().getNamespaceURI());
+ @SuppressWarnings("rawtypes")
List nodes = xPath.selectNodes(document);
assertEquals(1, nodes.size());
@@ -153,7 +212,6 @@
DoiDTO dto = populateDummydoiDTO();
String doiMetaDataXML = DoiMetaDataGenerator.createDoiMetaDataXML(dto);
- String doi = "10.5072/08/4F5838BF44E5A";
List<String> creators = dto.getCreators();
creators.remove(3);
@@ -168,6 +226,7 @@
Document document = ConverterUtils.xmlToDoc(updatedMetaData);
XPath xPath = XPath.newInstance(CREATOR_NAME_XPATH);
xPath.addNamespace("xsi", document.getRootElement().getNamespaceURI());
+ @SuppressWarnings("rawtypes")
List nodes = xPath.selectNodes(document);
assertEquals(4, nodes.size());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|