ResolvedDocument.GetFragment MethodResolvedDocument.GetFragment MethodResolvedDocument::GetFragment Method

Resolves a fragment identifier to a node in the document.

Syntax

Public Function GetFragment( _
    fragment As String _
) As System.Xml.XPath.XPathNavigator
public System.Xml.XPath.XPathNavigator GetFragment(
    string fragment
)
public:
virtual System.Xml.XPath::XPathNavigator^ GetFragment(
    String^ fragment
) sealed
 

Parameters

fragment

Type: System.StringSystem.StringSystem::String^

The fragment identifier.

Exceptions

ExceptionCondition
XdmExceptionXdmExceptionXdmException An XTRE1160 error is raised if the media type is not supported, or if the fragment is invalid for this media type.

Remarks

Currently fragments are supported only for the XML media types. These are text/xml, application/xml and */*+xml where * represents a series of characters. In this case only NCName fragments are resolved. If the fragment identifier is an XPointer expression or is not a valid NCName then a XTRE1160 XdmExceptionXdmExceptionXdmException is raised.

If the media type of this document is not known (MediaTypeMediaTypeMediaType is null a null reference (Nothing in Visual Basic) nullptr) then it is assumed to be text/xml, but if any errors would be raised then the root of the document is returned instead.