ooxml

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NSRelationships = "http://schemas.openxmlformats.org/package/2006/relationships"
	NSContentTypes  = "http://schemas.openxmlformats.org/package/2006/content-types"

	// DOCX namespaces
	NSWordprocessingML = "http://schemas.openxmlformats.org/wordprocessingml/2006/main"
	NSDrawingML        = "http://schemas.openxmlformats.org/drawingml/2006/main"
	NSRelDoc           = "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
	NSOMML             = "http://schemas.openxmlformats.org/officeDocument/2006/math"

	// Presentation namespaces
	NSPresentationML = "http://schemas.openxmlformats.org/presentationml/2006/main"
)

Common OOXML namespaces.

Variables

This section is empty.

Functions

func ParseRelationships

func ParseRelationships(zf *zip.ReadCloser, relsPath string) (map[string]Relationship, error)

ParseRelationships parses a .rels file from the ZIP.

func ParseRelationshipsFromReader

func ParseRelationshipsFromReader(zr *zip.Reader, relsPath string) (map[string]Relationship, error)

ParseRelationshipsFromReader parses rels from a zip.Reader.

func ReadFileFromZip

func ReadFileFromZip(zr *zip.Reader, name string) ([]byte, error)

ReadFileFromZip reads a file from a zip archive.

func RelsPathFor

func RelsPathFor(filePath string) string

RelsPathFor returns the .rels path for a given file in the ZIP.

func ResolveTarget

func ResolveTarget(basePath, target string) string

ResolveTarget resolves a relative target path against a base path.

Types

type Relationship

type Relationship struct {
	ID         string `xml:"Id,attr"`
	Type       string `xml:"Type,attr"`
	Target     string `xml:"Target,attr"`
	TargetMode string `xml:"TargetMode,attr"`
}

Relationship represents an OOXML relationship.

type Relationships

type Relationships struct {
	XMLName       xml.Name       `xml:"Relationships"`
	Relationships []Relationship `xml:"Relationship"`
}

Relationships is the root element for .rels files.

Jump to

Keyboard shortcuts

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