rdfloader

package
v0.0.0-...-752599d Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const WHITESPACE = 1<<'\t' | 1<<'\n' | 1<<'\r' | 1<<' '

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Name       string
	SchemaName string
	Value      string
}

An attribute is of the form schemaName:tagName="value" which exists inside an opening tag. For example:- If the opening tag is:

	<rdf:RDF
		xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    	xmlns:doap="http://usefulinc.com/ns/doap#">

Attributes are given by :-

  1. SchemaName=xmlns, Name=rdf, Value=http://www.w3.org/1999/02/22-rdf-syntax-ns#
  2. SchemaName=xmlns, Name=doap, Value=http://usefulinc.com/ns/doap#

type Block

type Block struct {
	// A block is a valid sub-xml.
	// for example:
	// 		1. <tag />
	// 		2. <tag attr="attr" />
	//      3. <tag> value </tag>
	//      4. <parent> <child> value </child> </parent>
	OpeningTag Tag
	Value      string
	Children   []*Block
}

type Pair

type Pair struct {
	First  interface{}
	Second interface{}
}

type Tag

type Tag struct {
	SchemaName string
	Name       string
	Attrs      []Attribute
}

type XMLReader

type XMLReader struct {
	// contains filtered or unexported fields
}

func XMLReaderFromFileObject

func XMLReaderFromFileObject(fileObject *bufio.Reader) XMLReader

func XMLReaderFromFilePath

func XMLReaderFromFilePath(filePath string) (xmlReader XMLReader, err error)

func (*XMLReader) CloseFileObj

func (xmlReader *XMLReader) CloseFileObj()

func (*XMLReader) Read

func (xmlReader *XMLReader) Read() (rootBlock Block, err error)

Jump to

Keyboard shortcuts

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