Running examples in ‘datapack-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: updateMetadata
> ### Title: Update selected elements of the XML content of a DataObject in a
> ###   DataPackage (aka package member).
> ### Aliases: updateMetadata updateMetadata,DataPackage-method
> 
> ### ** Examples
> 
> # Create a DataObject and add it to the DataPackage
> dp <- new("DataPackage")
> sampleMeta <- system.file("./extdata/sample-eml.xml", package="datapack")
> id <- "1234"
> metaObj <- new("DataObject", id="1234", format="eml://ecoinformatics.org/eml-2.1.1", 
+                 file=sampleMeta)
> dp <- addMember(dp, metaObj)
> 
> # In the metadata object, insert the newly assigned data 
> xp <- sprintf("//dataTable/physical/distribution[../objectName/text()=\"%s\"]/online/url", 
+               "sample-data.csv") 
> newURL <- sprintf("https://cn.dataone.org/cn/v2/resolve/%s", "1234")
> dp <- updateMetadata(dp, id, xpath=xp, replacement=newURL)
Warning: expanded path length 5990 would be too long for
<?xml version="1.0"?>
<eml:eml xmlns:eml="eml://ecoinformatics.org/eml-2.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packageId="sample.1.1" scope="system" system="knb" xsi:schemaLocation="eml://ecoinformatics.org/eml-2.1.0 http://nis.lternet.edu/schemas/EML/eml-2.1.0/eml.xsd">
  <access authSystem="knb" order="allowFirst" scope="document">
    <allow>
      <principal>uid=jsmith,o=unaffiliated,dc=ecoinformatics,dc=org</principal>
      <permission>all</permission>
    </allow>
    <allow>
      <principal>public</principal>
      <permission>read</permission>
    </allow>
  </access>
  <dataset scope="document">
    <shortName>Sample test data</shortName>
    <title>Sample test data for R package "datapack"</title>
    <creator scope="document">
      <individualName>
        <salutation>Mr.</salutation>
        <givenName>John</givenName>
        <surName>Smith</surName>
      </individualName>
      <address scope="docume [... truncated]
Error in tryCatch({ : 
  No elements found in XML of DataObject with id: 1234 using xpath: //dataTable/physical/distribution[../objectName/text()="sample-data.csv"]/online/url
Calls: updateMetadata ... .local -> updateXML -> updateXML -> .local -> tryCatch
Execution halted