Skip to content

Library for parsing XML files produced by DISAG OpticScore

License

Notifications You must be signed in to change notification settings

DBX12/disag-xml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DISAG xml

This library is intended for parsing the result.xml files produced by the OpticScore server by DISAG. Since the documentation of the format is sparse, some elements have been reverse engineered.

This project is not affiliated with or endorsed by DISAG.

Structure

The naming of the fields is taken from the XML structure and might not match colloquial use of the terms.

Result      contains meta information about the file and source system
|
+- Shooters collection of participants participating in a specific discipline (e.g. weapon and age bracket)
   |
   +- Shooter   contains infromation about the partiipant (name, club, etc) 
      |
      +- Shots  collection of Series items
         |
         +- Series  collection of Shots, usually all shot on the same date
            |
            +- Shot a single shot with information about its scoring

Example usage

package main

import (
	"encoding/xml"
	"github.com/dbx12/disag-xml/result"
	"os"
)

func readResultXml(filePath string) (*result.Result, error) {
	bts, err := os.ReadFile(filePath)
	if err != nil {
		return nil, err
	}
	r := &result.Result{}

	err = xml.Unmarshal(bts, r)
	if err != nil {
		return nil, err
	}
	return r, nil
}

License

This library is available under the terms of the GPLv3 as outlined in LICENSE.

About

Library for parsing XML files produced by DISAG OpticScore

Topics

Resources

License

Stars

Watchers

Forks

Languages