Share via


GetLineNumber

 

Gets the line number where the reader is positioned in the document.

Syntax

  
HRESULT GetLineNumber ([out] UINT * pcwchLineNumber);  

Arguments

pcwchLineNumber
Returns the line number.

Return Value

Returns S_OK if no error is generated.

Remarks

This method is most useful for reporting the line number if an error occurs.

The starting number is 1. For example, if the XML document is <root/> and the reader is on <, the line number is 1 and the line position is 1.

When you are about to read a node that contains whitespace and text, this method returns the line number of the first non-whitespace text. This may not be what you expect; you may expect the line number of the start of the node. However, XmlLite's focus is on high performance, and for performance the reader advances to the first non-whitespace text. This method returns the line number where the reader is currently positioned in the document, not the line number of the start of the next node.

Requirements

Header: XmlLite.h

Library: XmlLite.lib

See Also

GetLinePosition
IXmlReader Methods