getLineNumber {XML}R Documentation

Determine the line number of an (internal) XML node

Description

This function is used to query the location of an internal/C-level XML node within its original "file". This gives us the line number. It can be combined with docName to determine the name of the file and so identify the node location.

This is useful when we identify a node with a particular charactestic and want to view/edit the original document, e.g. when authoring an Docbook article.

Usage

getLineNumber(node, ...)

Arguments

node the node whose line number is of interest
... additional parameters for methods should they be defined.

Value

An integer.

Author(s)

Duncan Temple Lang

References

libxml2

See Also

xmlParse getNodeSet xpathApply

Examples

f = system.file("exampleData", "xysize.svg", package = "XML")
doc = xmlParse(f)
e = getNodeSet(doc, "//ellipse")
sapply(e, getLineNumber)

[Package XML version 2.5-1 Index]