DocumentSet.AddCollection Method (AnyUri, IEnumerable<XPathItem>)DocumentSet.AddCollection Method (AnyUri, IEnumerable(Of XPathItem))DocumentSet::AddCollection Method (AnyUri^, IEnumerable<XPathItem^>^)

Associates the specified items with the specified collection URI, or marks the collection URI as unavailable.

Syntax

Public Function AddCollection( _
    uri As AnyUri, _
    collection As IEnumerable(Of System.Xml.XPath.XPathItem) _
) As Boolean
public bool AddCollection(
    AnyUri uri,
    IEnumerable<System.Xml.XPath.XPathItem> collection
)
public:
bool AddCollection(
    AnyUri^ uri, 
    IEnumerable<System.Xml.XPath::XPathItem^>^ collection
)
 

Parameters

uri

Type: XmlPrime.AnyUriXmlPrime.AnyUriXmlPrime::AnyUri^

The collection URI to associate with collection, or null a null reference (Nothing in Visual Basic) nullptr to set the default collection.

collection

Type: System.Collections.Generic.IEnumerable<T>System.Collections.Generic.IEnumerable(Of T)System.Collections.Generic::IEnumerable<T>^

The collection of items to add to the DocumentSetDocumentSetDocumentSet, or null a null reference (Nothing in Visual Basic) nullptr if the collection is unavailable.

Return Value

Type: System.BooleanSystem.BooleanSystem::Boolean

trueTruetrue if the collection was added to the DocumentSetDocumentSetDocumentSet; falseFalsefalse otherwise.

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullException uri is null a null reference (Nothing in Visual Basic) nullptr.
ArgumentExceptionArgumentExceptionArgumentException
  • collection contains an element which is null a null reference (Nothing in Visual Basic) nullptr.
  • uri is not an absolute URI.
  • uri is already mapped to a collection.
  • A node in collection uses the wrong name table.
  • The document URI of a node in collection is not a valid lexical value for xs:anyURI.
  • The document URI of a node in collection is not absolute.
  • The document URI of a node in collection is not empty and the node is contained in a document that is not in the document set.

Remarks

If any item in collection is a document node with a document URI that is not empty, then the document should already be added to the document set.

If uri is already in the document set then no change is made and this method returns falseFalsefalse.

If collection is null a null reference (Nothing in Visual Basic) nullptr then during evaluation of an XQuery program, XSL transformation or XPath expression, fn:doc-available will return false for uri, and the fn:doc function will raise an FODC0002 error.