Beispiel #1
0
func verifyDocs(origData, faksData []byte) (errs []error) {
	orig, faks := xmlx.New(), xmlx.New()
	err := orig.LoadBytes(origData, nil)
	if err == nil {
		if err = faks.LoadBytes(faksData, nil); err == nil {
			errs = verifyNode(orig.Root, faks.Root)
		}
	}
	return
}
Beispiel #2
0
func convert(srcFile []byte, retDoc, retBytes bool) (doc *xmlx.Document, dstFile []byte, err error) {
	doc, surfaceImages, surfaceNodes, skipped = xmlx.New(), map[string]string{}, nil, false
	if err = doc.LoadBytes(srcFile, nil); err != nil {
		doc = nil
		return
	}
	srcDoc = doc
	processNode(doc.Root)
	srcDoc = nil
	if skipped {
		if retBytes {
			dstFile = srcFile
		}
	} else {
		for _, sn := range surfaceNodes {
			delNode(sn.Parent)
		}
		if retBytes {
			dstFile = doc.SaveBytes()
		}
	}
	if !retDoc {
		doc = nil
	}
	surfaceImages, surfaceNodes = nil, nil
	return
}
Beispiel #3
0
func loadSpecXml() {
	specDoc = xmlx.New()
	if err := specDoc.LoadBytes(uio.ReadBinaryFile(util.GopathSrcGithub("go3d", "go-ngine", "_tools", "buildtools", "ng-gogl-imp-version-checker", "opengl.xml"), true), nil); err != nil {
		panic(err)
	}
}