github.com/matislovas/ratago@v0.0.0-20240408115641-cc0857415a7a/xslt/util.go (about)

     1  package xslt
     2  
     3  import (
     4  	"io/ioutil"
     5  
     6  	"github.com/matislovas/gokogiri/xml"
     7  )
     8  
     9  func xmlReadFile(filename string) (doc *xml.XmlDocument, err error) {
    10  	data, err := ioutil.ReadFile(filename)
    11  	if err != nil {
    12  		return
    13  	}
    14  	doc, err = xml.Parse(data, xml.DefaultEncodingBytes, nil, xml.StrictParseOption, xml.DefaultEncodingBytes)
    15  	return
    16  }