-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Description
There is a problem while parcing xml document with CDATA block - parsing stops after first element.
Example file:
<?xml version="1.0" encoding="UTF-8" ?>
<offers>
<offer>
<title>Title1</title>
<description><![CDATA[Big description 1]]></description>
</offer>
<offer>
<title>Title2</title>
<description><![CDATA[Big description 2]]></description>
</offer>
<offer>
<title>Title3</title>
<description><![CDATA[Big description 3]]></description>
</offer>
</offers>
Example code:
import (
streamParser "github.com/tamerh/xml-stream-parser"
)
func main() {
f, _ := os.Open("example2.xml")
br := bufio.NewReaderSize(f, 65536)
parser := streamParser.NewXMLParser(br, "offer")
for xml := range parser.Stream() {
for tagName, _:= range xml.Childs {
fmt.Println(tagName)
}
}
}`
Metadata
Metadata
Assignees
Labels
No labels