func WriteRootFiles(book *EPUB, zipWriter *zip.Writer) error {
	for rfPath, rf := range book.RootFiles {
		rf.MetaData.(*MetaDataUnmarshal).XmlnsDc = "http://purl.org/dc/elements/1.1/"
		rf.MetaData.(*MetaDataUnmarshal).XmlnsOpf = "http://www.idpf.org/2007/opf"

		fmt.Println(rf.MetaData.(*MetaDataUnmarshal))

		rf.MetaData = TransformFromUnmarshal(rf.MetaData.(*MetaDataUnmarshal))

		fmt.Println(rf.MetaData.(*MetaDataMarshal))

		file, err := zipWriter.Create(rfPath)
		if err != nil {
			return err
		}
		_, err = file.Write([]byte(xml.Header))
		if err != nil {
			return err
		}
		enc := xml.NewEncoder(file)
		enc.Indent("", "  ")
		err = enc.Encode(rf)
		if err != nil {
			return err
		}

	}
	return nil
}
//WriteRootFiles serialize and write root files of epub
WriteRootFiles serialize and write root files of epub
// WriteRootFiles serialize and write root files of epub
func WriteRootFiles(book *EPUB, zipWriter *zip.Writer) error {
	for rfPath, rf := range book.RootFiles {
		rf.MetaData.(*MetaDataUnmarshal).XmlnsDc = "http://purl.org/dc/elements/1.1/"
		rf.MetaData.(*MetaDataUnmarshal).XmlnsOpf = "http://www.idpf.org/2007/opf"
		fmt.Println(rf.MetaData.(*MetaDataUnmarshal))
		rf.MetaData = TransformFromUnmarshal(rf.MetaData.(*MetaDataUnmarshal))
		fmt.Println(rf.MetaData.(*MetaDataMarshal))
		file, err := zipWriter.Create(rfPath)
		if err != nil {
			return err
		}
		_, err = file.Write([]byte(xml.Header))
		if err != nil {
			return err
		}
		enc := xml.NewEncoder(file)
		enc.Indent("", "  ")
		err = enc.Encode(rf)
		if err != nil {
			return err
		}
	}
	return nil
}
func WriteRootFiles ( book * EPUB , zipWriter * zip . Writer ) error { for rfPath , rf := range book . RootFiles { rf . MetaData . ( * MetaDataUnmarshal ) . XmlnsDc = " " rf . MetaData . ( * MetaDataUnmarshal ) . XmlnsOpf = " " fmt . Println ( rf . MetaData . ( * MetaDataUnmarshal ) ) rf . MetaData = TransformFromUnmarshal ( rf . MetaData . ( * MetaDataUnmarshal ) ) fmt . Println ( rf . MetaData . ( * MetaDataMarshal ) ) file , err := zipWriter . Create ( rfPath ) if err != nil { return err } _ , err = file . Write ( [ ] byte ( xml . Header ) ) if err != nil { return err } enc := xml . NewEncoder ( file ) enc . Indent ( " " , " " ) err = enc . Encode ( rf ) if err != nil { return err } } return nil }
WriteRootFiles serialize and write root files of epub
WriteRootFiles serialize and write root files of epub