File tree Expand file tree Collapse file tree 4 files changed +431
-14
lines changed Expand file tree Collapse file tree 4 files changed +431
-14
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ type Node struct {
50
50
NamespaceURI string
51
51
Attr []Attr
52
52
53
- level int // node level in the tree
53
+ level int // node level in the tree
54
+ LineNumber int // line number where this node appears in the source XML
54
55
}
55
56
56
57
type outputConfiguration struct {
@@ -122,6 +123,11 @@ func (n *Node) Level() int {
122
123
return n .level
123
124
}
124
125
126
+ // GetLineNumber returns the line number where this node appears in the source XML.
127
+ func (n * Node ) GetLineNumber () int {
128
+ return n .LineNumber
129
+ }
130
+
125
131
// InnerText returns the text between the start and end tags of the object.
126
132
func (n * Node ) InnerText () string {
127
133
var output func (* strings.Builder , * Node )
Original file line number Diff line number Diff line change 6
6
)
7
7
8
8
type ParserOptions struct {
9
- Decoder * DecoderOptions
9
+ Decoder * DecoderOptions
10
+ WithLineNumbers bool
10
11
}
11
12
12
13
func (options ParserOptions ) apply (parser * parser ) {
You can’t perform that action at this time.
0 commit comments