Documentation
¶
Index ¶
- Constants
- func ParseRelationships(zf *zip.ReadCloser, relsPath string) (map[string]Relationship, error)
- func ParseRelationshipsFromReader(zr *zip.Reader, relsPath string) (map[string]Relationship, error)
- func ReadFileFromZip(zr *zip.Reader, name string) ([]byte, error)
- func RelsPathFor(filePath string) string
- func ResolveTarget(basePath, target string) string
- type Relationship
- type Relationships
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 ¶
ParseRelationshipsFromReader parses rels from a zip.Reader.
func ReadFileFromZip ¶
ReadFileFromZip reads a file from a zip archive.
func RelsPathFor ¶
RelsPathFor returns the .rels path for a given file in the ZIP.
func ResolveTarget ¶
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.
Click to show internal directories.
Click to hide internal directories.