getLineNumber              package:XML              R Documentation

_D_e_t_e_r_m_i_n_e _t_h_e _l_i_n_e _n_u_m_b_e_r _o_f _a_n (_i_n_t_e_r_n_a_l) _X_M_L _n_o_d_e

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     getLineNumber(node, ...)

_A_r_g_u_m_e_n_t_s:

    node: the node whose line number is of interest

     ...: additional parameters for methods should they be defined.

_V_a_l_u_e:

     An integer.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang

_R_e_f_e_r_e_n_c_e_s:

     libxml2

_S_e_e _A_l_s_o:

     'xmlParse' 'getNodeSet' 'xpathApply'

_E_x_a_m_p_l_e_s:

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

