DocumentSet.AddDocument Method (AnyUri, ResolvedDocument)DocumentSet.AddDocument Method (AnyUri, ResolvedDocument)DocumentSet::AddDocument Method (AnyUri^, ResolvedDocument^)

Adds the document represented by the specified ResolvedDocumentResolvedDocumentResolvedDocument to the set of available documents, and associates it with the specified document URI, or marks a document as unavailable.

Syntax

Public Function AddDocument( _
    uri As AnyUri, _
    document As ResolvedDocument _
) As Boolean
public bool AddDocument(
    AnyUri uri,
    ResolvedDocument document
)
public:
bool AddDocument(
    AnyUri^ uri, 
    ResolvedDocument^ document
)
 

Parameters

uri

Type: XmlPrime.AnyUriXmlPrime.AnyUriXmlPrime::AnyUri^

The document URI to associate with document.

document

Type: XmlPrime.ResolvedDocumentXmlPrime.ResolvedDocumentXmlPrime::ResolvedDocument^

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

Return Value

Type: System.BooleanSystem.BooleanSystem::Boolean

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

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullException uri is null a null reference (Nothing in Visual Basic) nullptr.
ArgumentExceptionArgumentExceptionArgumentException
  • uri is not an absolute URI.
  • The document uses the wrong name table.
  • The document URI of document is not empty and is different to uri.

Remarks

The document URI of the document contained in document must either be empty or equivalent to uri.

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

If document 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.