XmlDocRepository.ResolveInheritDoc Method
- Namespace
- Kampute.DocToolkit.XmlDoc
- Assembly
- Kampute.DocToolkit.dll
Definition
Resolves the
inheritdoc elements in the specified XML element.protected virtual bool ResolveInheritDoc(XElement element)Parameters
elementXElement- The element to resolve its
inheritdocelement.
Returns
Exceptions
- ArgumentNullException
- Thrown when
elementisnull.

inheritdocelement by finding the base member's documentation and merging it into the current element.If an
inheritdocelement has acrefattribute, it uses that to find the base member. If not, it attempts to infer the inherited member from the current element'snameattribute. If the base member's documentation is found, its child elements are copied into the current element, and theinheritdocelement is removed.If an
inheritdocelement has apathattribute, only the elements its XPath expression selects from the base member's documentation are copied. The expression is evaluated against a document whose root element is the base member'smemberelement, with that element as the context node; a rooted expression is taken relative to thememberelement, so/summaryandsummaryboth select the base member's summary. An invalid expression, or one that selects no elements, inherits nothing.Inherited elements do not override locally defined elements. An inherited element is skipped when the current element locally defines an element with the same name that refers to the same target through its
name,cref, orhrefattribute, or, for elements without such an attribute, any element with the same name.Distinct inherited elements are preserved even when they refer to the same target, such as multiple exception conditions for the same exception type. Identical inherited elements are copied only once.