1XML::LibXML::Devel::SetULsienreNCuomnbterri(b3u)ted PerlXMDLo:c:uLmiebnXtMaLt:i:oDnevel::SetLineNumber(3)
2
3
4

NAME

6       XML::LibXML::Devel::SetLineNumber - set the line number for an
7       XML::LibXML::Node
8

SYNOPSIS

10         use XML::LibXML::Devel::SetLineNumber;
11
12         my $node = $document->getElementsByTagName('foo')->get_node(1);
13         set_line_number($node, 8);
14         say $node->line_number;  # says "8"
15

DESCRIPTION

17       This module exports one function:
18
19       "set_line_number($node, $number)"
20           Sets a node's line number.
21
22       Why in name of all that is good and holy would you want to do that?
23       Frankly, you probably don't. And you probably shouldn't.
24
25       There's just about one sitution where it makes sense. If you are, say,
26       writing a parser for a non-XML format that happens to have an XML-like
27       data model, then you might wish to parse your format into an
28       XML::LibXML document with elements, attributes and so on. And you might
29       want all those nodes to return the correct line numbers when the
30       "line_number" method is called on them. Say, for instance that you're
31       working on HTML::HTML5::Parser.
32

THIS MODULE IS WELL DODGY

34       And you're a fool if you use it.
35
36       If you do feel you really must use this module, it's probably best to
37       load it like this:
38
39        eval {
40          require XML::LibXML::Devel::SetLineNumber;
41          import XML::LibXML::Devel::SetLineNumber;
42          1;
43        } or *set_line_number = sub { 1 };
44
45       Instead of the normal "use XML::LibXML::Devel::SetLineNumber".
46

SEE ALSO

48       XML::LibXML, XML::LibXML::Devel, XML::LibXML::Node.
49

AUTHOR

51       Toby Inkster <tobyink@cpan.org>.
52
54       Copyright (C) 2012 by Toby Inkster
55
56       This library is free software; you can redistribute it and/or modify it
57       under the same terms as Perl itself.
58

DISCLAIMER OF WARRANTIES

60       THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
61       WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
62       MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
63
64
65
66perl v5.30.0                      2019-07-2X6ML::LibXML::Devel::SetLineNumber(3)
Impressum