Closed alchem1ster closed 1 year ago
If add fmt.Println(n)
above io.EOF condition:
&{0xc000028500 0xc000028b00 0xc000028f80 0xc000028a00 <nil> 2 item [] 3}
&{0xc000028500 0xc000029180 0xc000029600 0xc000029080 <nil> 2 item [] 3}
<nil>
your code had a bug on if err != nil { fmt.Println(n) }
for {
n, err := p.Read()
if err == io.EOF {
break
}
if err != nil {
// fmt.Println(n)
panic(err)
}
fmt.Println(n)
}
@zhengchun Right. Thank you! I just used the snippet from README, that is not entirely clear. I thought my code should be in place of the ellipsis : https://github.com/antchfx/xmlquery#parse-an-xml-in-a-stream-fashion-simple-case-advanced-element-filtering
Thanks for report this issue. I will update this sample code.
Windows 10 Pro 22H2 x64 Golang 1.20.1 github.com/antchfx/xmlquery v1.3.15 winlibs build version gcc-12.2.0-llvm-15.0.7-mingw-w64msvcrt-10.0.0-r4
test.xml
code
Here's just nothing going on. Immediately io.EOF condition is triggered.