problem with Nokogiri::HTML::Element#line

Discussion in 'Ruby' started by malikb, Apr 22, 2009.

  1. malikb

    malikb Guest

    Hello,

    I have a problem with Nokogiri::HTML::Element#line, it always returns
    zero(0):

    html = Nokogiri::HTML(<<eohtml)
    <html>
    <head>
    <title>test test</title>
    </head>
    <body>
    Hello, world!
    </body>
    </html>
    eohtml

    html.xpath("/html/head/title")[0].line # 0
    html.xpath("/html/body")[0].line # 0

    if I replace Nokogiri::HTML with Nokogiri::XML, all going to be
    perfect.

    Nokogiri::HTML::Element extends Nokogiri::XML::Node, so, #line should
    return the line of the HTML node, isn't it?
     
    malikb, Apr 22, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HANM
    Replies:
    2
    Views:
    738
    Joseph Kesselman
    Jan 29, 2008
  2. Diogo Terror

    Nokogiri problem on Mac OS X

    Diogo Terror, Nov 21, 2008, in forum: Ruby
    Replies:
    3
    Views:
    149
    Diogo Terror
    Nov 25, 2008
  3. Jarmo Pertman
    Replies:
    2
    Views:
    132
    Jarmo Pertman
    May 21, 2009
  4. Priyank Shah
    Replies:
    5
    Views:
    180
    Priyank Shah
    Nov 15, 2010
  5. Replies:
    0
    Views:
    380
Loading...

Share This Page