xml

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

package xml provides functionality to parse resources from a draw.io XML file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diagram

type Diagram struct {
	XMLName      xml.Name     `xml:"diagram"`
	MxGraphModel MxGraphModel `xml:"mxGraphModel"`
}

Diagram represents the diagram element within the draw.io XML file.

type Geometry

type Geometry struct {
	XMLName  xml.Name `xml:"mxGeometry"`
	X        *float64 `xml:"x,attr,omitempty"`
	Y        *float64 `xml:"y,attr,omitempty"`
	Width    float64  `xml:"width,attr,omitempty"`
	Height   float64  `xml:"height,attr,omitempty"`
	Relative string   `xml:"relative,attr,omitempty"`
	As       string   `xml:"as,attr,omitempty"`
}

Geometry represents the geometry element within a cell of the draw.io XML file.

type MxCell

type MxCell struct {
	XMLName  xml.Name  `xml:"mxCell"`
	ID       string    `xml:"id,attr"`
	Value    string    `xml:"value,attr,omitempty"`
	Style    string    `xml:"style,attr,omitempty"`
	Parent   string    `xml:"parent,attr,omitempty"`
	Vertex   string    `xml:"vertex,attr,omitempty"`
	Edge     string    `xml:"edge,attr,omitempty"`
	Source   string    `xml:"source,attr,omitempty"`
	Target   string    `xml:"target,attr,omitempty"`
	Geometry *Geometry `xml:"mxGeometry,omitempty"`
}

MxCell represents a cell element within the draw.io XML file.

type MxFile

type MxFile struct {
	XMLName xml.Name `xml:"mxfile"`
	Diagram Diagram  `xml:"diagram"`
}

MxFile represents the root element of the draw.io XML file.

func Parse

func Parse(fileName string) (*MxFile, error)

Parse parses a draw.io XML file and returns an MxFile struct.

type MxGraphModel

type MxGraphModel struct {
	XMLName xml.Name `xml:"mxGraphModel"`
	Root    Root     `xml:"root"`
}

MxGraphModel represents the graph model element within the draw.io XML file.

type Root

type Root struct {
	XMLName xml.Name `xml:"root"`
	MxCells []MxCell `xml:"mxCell"`
}

Root represents the root element within the graph model of the draw.io XML file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL