Skip to content

Imported XSD files are not supported #8

Description

@sotex

If the imported XSD file is not a local file, the No such file or directory will be misreported.
I simply modified the parseXSDFile function to satisfy my use. (Not a good modification)

func parseXSDFile(fname string) ([]xsdSchema, error) {
        if fname[0:4] == "http" {
                url := strings.Replace(fname,"http:/","http://",-1)
                url = strings.Replace(url,"https:/","https://",-1)
                res,err := http.Get(url)
                if err != nil {
                        return nil,err
                }
                f,err := os.Create(filepath.Base(fname))
                if err != nil {
                        return nil,err
                }
                defer f.Close()
                io.Copy(f,res.Body)
                fname = filepath.Base(fname)
        }
        f, err := os.Open(fname)
        if err != nil {
                return nil, err
        }
        defer f.Close()

        return parse(f, fname)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions