diff --git a/README.md b/README.md index 139a638..027948e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Interface to libxml2, with DOM interface. [![Build Status](https://travis-ci.org/lestrrat-go/libxml2.svg?branch=master)](https://travis-ci.org/lestrrat-go/libxml2) -[![GoDoc](https://godoc.org/github.com/lestrrat-go/libxml2?status.svg)](https://godoc.org/github.com/lestrrat-go/libxml2) +[![GoDoc](https://godoc.org/github.com/icysoft/libxml2?status.svg)](https://godoc.org/github.com/icysoft/libxml2) # Index @@ -13,7 +13,7 @@ Interface to libxml2, with DOM interface. ## Why? -I needed to write [go-xmlsec](https://github.com/lestrrat-go/xmlsec). This means we need to build trees using libxml2, and then muck with it in xmlsec: Two separate packages in Go means we cannot (safely) pass around `C.xmlFooPtr` objects (also, you pay a penalty for pointer types). This package carefully avoid references to `C.xmlFooPtr` types and uses uintptr to pass data around, so other libraries that needs to interact with libxml2 can safely interact with it. +I needed to write [go-xmlsec](https://github.com/icysoft/libxml2/xmlsec). This means we need to build trees using libxml2, and then muck with it in xmlsec: Two separate packages in Go means we cannot (safely) pass around `C.xmlFooPtr` objects (also, you pay a penalty for pointer types). This package carefully avoid references to `C.xmlFooPtr` types and uses uintptr to pass data around, so other libraries that needs to interact with libxml2 can safely interact with it. ## Status @@ -72,10 +72,10 @@ import ( "log" "net/http" - "github.com/lestrrat-go/libxml2" - "github.com/lestrrat-go/libxml2/parser" - "github.com/lestrrat-go/libxml2/types" - "github.com/lestrrat-go/libxml2/xpath" + "github.com/icysoft/libxml2" + "github.com/icysoft/libxml2/parser" + "github.com/icysoft/libxml2/types" + "github.com/icysoft/libxml2/xpath" ) func ExampleXML() { @@ -153,8 +153,8 @@ import ( "os" "path/filepath" - "github.com/lestrrat-go/libxml2" - "github.com/lestrrat-go/libxml2/xsd" + "github.com/icysoft/libxml2" + "github.com/icysoft/libxml2/xsd" ) func ExampleXSD() { @@ -212,7 +212,7 @@ BenchmarkXmlpathXmlpath-4 500000 11737 ns/op 721 B/op BenchmarkLibxml2Xmlpath-4 1000000 7627 ns/op 368 B/op 15 allocs/op BenchmarkEncodingXMLDOM-4 2000000 4079 ns/op 4560 B/op 9 allocs/op BenchmarkLibxml2DOM-4 1000000 11454 ns/op 264 B/op 7 allocs/op -ok github.com/lestrrat-go/libxml2 37.597s +ok github.com/icysoft/libxml2 37.597s ``` ## FAQ @@ -280,11 +280,11 @@ See the first FAQ entry. ### I can't build this library statically -See prior discussion: https://github.com/lestrrat-go/libxml2/issues/62 +See prior discussion: https://github.com/icysoft/libxml2/issues/62 ## See Also -* https://github.com/lestrrat-go/xmlsec +* https://github.com/icysoft/libxml2/xmlsec ## Credits diff --git a/clib/clib.go b/clib/clib.go index ee62213..3ceda9e 100644 --- a/clib/clib.go +++ b/clib/clib.go @@ -1,5 +1,4 @@ /* - Package clib holds all of the dirty C interaction for go-libxml2. Although this package is visible to the outside world, the API in this @@ -16,7 +15,6 @@ Please DO NOT rely on this API and expect that it will keep backcompat. When the need arises, it WILL be changed, and if you are not ready for it, your code WILL break in horrible horrible ways. You have been warned. - */ package clib @@ -343,8 +341,8 @@ import ( "unicode/utf8" "unsafe" - "github.com/lestrrat-go/libxml2/internal/debug" - "github.com/lestrrat-go/libxml2/internal/option" + "github.com/icysoft/libxml2/internal/debug" + "github.com/icysoft/libxml2/internal/option" "github.com/pkg/errors" ) diff --git a/dom/c14n_test.go b/dom/c14n_test.go index aad7a94..fc0ed02 100644 --- a/dom/c14n_test.go +++ b/dom/c14n_test.go @@ -3,8 +3,8 @@ package dom_test import ( "testing" - "github.com/lestrrat-go/libxml2" - "github.com/lestrrat-go/libxml2/dom" + "github.com/icysoft/libxml2" + "github.com/icysoft/libxml2/dom" "github.com/stretchr/testify/assert" ) diff --git a/dom/document_test.go b/dom/document_test.go index 6a0a194..94cbaaf 100644 --- a/dom/document_test.go +++ b/dom/document_test.go @@ -3,9 +3,9 @@ package dom_test import ( "testing" - "github.com/lestrrat-go/libxml2/clib" - "github.com/lestrrat-go/libxml2/dom" - "github.com/lestrrat-go/libxml2/types" + "github.com/icysoft/libxml2/clib" + "github.com/icysoft/libxml2/dom" + "github.com/icysoft/libxml2/types" "github.com/stretchr/testify/assert" ) diff --git a/dom/dom.go b/dom/dom.go index 04188e6..0ce8212 100644 --- a/dom/dom.go +++ b/dom/dom.go @@ -3,7 +3,7 @@ package dom import ( "sync" - "github.com/lestrrat-go/libxml2/xpath" + "github.com/icysoft/libxml2/xpath" ) var docPool sync.Pool diff --git a/dom/interface.go b/dom/interface.go index 0b6fe2d..b2100af 100644 --- a/dom/interface.go +++ b/dom/interface.go @@ -3,7 +3,7 @@ package dom import ( "errors" - "github.com/lestrrat-go/libxml2/clib" + "github.com/icysoft/libxml2/clib" ) var ( diff --git a/dom/node.go b/dom/node.go index 5597563..264e441 100644 --- a/dom/node.go +++ b/dom/node.go @@ -1,9 +1,9 @@ package dom import ( - "github.com/lestrrat-go/libxml2/clib" - "github.com/lestrrat-go/libxml2/types" - "github.com/lestrrat-go/libxml2/xpath" + "github.com/icysoft/libxml2/clib" + "github.com/icysoft/libxml2/types" + "github.com/icysoft/libxml2/xpath" "github.com/pkg/errors" ) diff --git a/dom/node_attr.go b/dom/node_attr.go index 252855d..879b326 100644 --- a/dom/node_attr.go +++ b/dom/node_attr.go @@ -1,7 +1,7 @@ package dom import ( - "github.com/lestrrat-go/libxml2/clib" + "github.com/icysoft/libxml2/clib" ) // Free releases the underlying C struct diff --git a/dom/node_document.go b/dom/node_document.go index ce1d118..5ecc665 100644 --- a/dom/node_document.go +++ b/dom/node_document.go @@ -1,8 +1,8 @@ package dom import ( - "github.com/lestrrat-go/libxml2/clib" - "github.com/lestrrat-go/libxml2/types" + "github.com/icysoft/libxml2/clib" + "github.com/icysoft/libxml2/types" "github.com/pkg/errors" ) diff --git a/dom/node_element.go b/dom/node_element.go index 3d8da4d..41843df 100644 --- a/dom/node_element.go +++ b/dom/node_element.go @@ -5,8 +5,8 @@ import ( "errors" "strings" - "github.com/lestrrat-go/libxml2/clib" - "github.com/lestrrat-go/libxml2/types" + "github.com/icysoft/libxml2/clib" + "github.com/icysoft/libxml2/types" ) // SetNamespace sets up a new namespace on the given node. diff --git a/dom/node_namespace.go b/dom/node_namespace.go index 8a06064..2065a65 100644 --- a/dom/node_namespace.go +++ b/dom/node_namespace.go @@ -1,7 +1,7 @@ package dom import ( - "github.com/lestrrat-go/libxml2/clib" + "github.com/icysoft/libxml2/clib" ) // URI returns the namespace URL @@ -19,4 +19,3 @@ func (n *Namespace) Free() { clib.XMLNamespaceFree(n) n.ptr = 0 } - diff --git a/dom/node_test.go b/dom/node_test.go index 5bc5d5c..de8f035 100644 --- a/dom/node_test.go +++ b/dom/node_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "github.com/lestrrat-go/libxml2/clib" - "github.com/lestrrat-go/libxml2/types" + "github.com/icysoft/libxml2/clib" + "github.com/icysoft/libxml2/types" "github.com/stretchr/testify/assert" ) diff --git a/dom/node_text.go b/dom/node_text.go index b539bb4..220e381 100644 --- a/dom/node_text.go +++ b/dom/node_text.go @@ -1,7 +1,7 @@ package dom import ( - "github.com/lestrrat-go/libxml2/clib" + "github.com/icysoft/libxml2/clib" ) func (n *CDataSection) Literal() (string, error) { diff --git a/dom/node_wrap.go b/dom/node_wrap.go index 29dc199..a2ee777 100644 --- a/dom/node_wrap.go +++ b/dom/node_wrap.go @@ -5,8 +5,8 @@ package dom import ( "fmt" - "github.com/lestrrat-go/libxml2/clib" - "github.com/lestrrat-go/libxml2/types" + "github.com/icysoft/libxml2/clib" + "github.com/icysoft/libxml2/types" ) func wrapNamespaceNode(ptr uintptr) *Namespace { diff --git a/dom/serialize.go b/dom/serialize.go index e95bf05..f06a207 100644 --- a/dom/serialize.go +++ b/dom/serialize.go @@ -1,8 +1,8 @@ package dom import ( - "github.com/lestrrat-go/libxml2/clib" - "github.com/lestrrat-go/libxml2/types" + "github.com/icysoft/libxml2/clib" + "github.com/icysoft/libxml2/types" ) // Serialize produces serialization of the document, canonicalized. diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..ac86672 --- /dev/null +++ b/go.mod @@ -0,0 +1,12 @@ +module github.com/icysoft/libxml2 + +go 1.20 + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/testify v1.8.4 // indirect + gopkg.in/xmlpath.v1 v1.0.0-20140413065638-a146725ea6e7 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..58344e7 --- /dev/null +++ b/go.sum @@ -0,0 +1,13 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/xmlpath.v1 v1.0.0-20140413065638-a146725ea6e7 h1:zibSPXbkfB1Dwl76rJgLa68xcdHu42qmFTe6vAnU4wA= +gopkg.in/xmlpath.v1 v1.0.0-20140413065638-a146725ea6e7/go.mod h1:wo0SW5T6XqIKCCAge330Cd5sm+7VI6v85OrQHIk50KM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/html.go b/html.go index f4a2a40..ed41198 100644 --- a/html.go +++ b/html.go @@ -4,10 +4,10 @@ import ( "bytes" "io" - "github.com/lestrrat-go/libxml2/clib" - "github.com/lestrrat-go/libxml2/dom" - "github.com/lestrrat-go/libxml2/parser" - "github.com/lestrrat-go/libxml2/types" + "github.com/icysoft/libxml2/clib" + "github.com/icysoft/libxml2/dom" + "github.com/icysoft/libxml2/parser" + "github.com/icysoft/libxml2/types" "github.com/pkg/errors" ) diff --git a/html_test.go b/html_test.go index 0a393bf..12e9114 100644 --- a/html_test.go +++ b/html_test.go @@ -3,8 +3,8 @@ package libxml2_test import ( "testing" - "github.com/lestrrat-go/libxml2" - "github.com/lestrrat-go/libxml2/xpath" + "github.com/icysoft/libxml2" + "github.com/icysoft/libxml2/xpath" "github.com/stretchr/testify/assert" ) diff --git a/internal/cmd/genwrapnode/genwrapnode.go b/internal/cmd/genwrapnode/genwrapnode.go index 4b8f765..a799db8 100644 --- a/internal/cmd/genwrapnode/genwrapnode.go +++ b/internal/cmd/genwrapnode/genwrapnode.go @@ -26,7 +26,7 @@ func _main() error { buf.WriteString("\n\n// Auto-generated by internal/cmd/genwrapnode/genwrapnode.go. DO NOT EDIT!") buf.WriteString("\n\nimport (") buf.WriteString("\n\"fmt\"\n") - for _, lib := range []string{"github.com/lestrrat-go/libxml2/clib", "github.com/lestrrat-go/libxml2/types"} { + for _, lib := range []string{"github.com/icysoft/libxml2/clib", "github.com/icysoft/libxml2/types"} { fmt.Fprintf(&buf, "\n%s", strconv.Quote(lib)) } buf.WriteString("\n)") diff --git a/libxml2_bench_test.go b/libxml2_bench_test.go index a376715..806df8b 100644 --- a/libxml2_bench_test.go +++ b/libxml2_bench_test.go @@ -9,9 +9,9 @@ import ( "path/filepath" "testing" - "github.com/lestrrat-go/libxml2" - "github.com/lestrrat-go/libxml2/dom" - "github.com/lestrrat-go/libxml2/xpath" + "github.com/icysoft/libxml2" + "github.com/icysoft/libxml2/dom" + "github.com/icysoft/libxml2/xpath" "github.com/stretchr/testify/assert" "gopkg.in/xmlpath.v1" ) @@ -108,7 +108,7 @@ func BenchmarkLibxml2Xmlpath(b *testing.B) { } type Foo struct { - XMLName xml.Name `xml:"https://github.com/lestrrat-go/libxml2/foo foo:foo"` + XMLName xml.Name `xml:"https://github.com/icysoft/libxml2/foo foo:foo"` Field1 string Field2 string `xml:",attr"` } @@ -128,7 +128,7 @@ func BenchmarkEncodingXMLDOM(b *testing.B) { func BenchmarkLibxml2DOM(b *testing.B) { var buf bytes.Buffer - const nsuri = `https://github.com/lestrrat-go/libxml2/foo` + const nsuri = `https://github.com/icysoft/libxml2/foo` f := Foo{ Field1: "Hello, World!", Field2: "Hello, Attribute!", diff --git a/libxml2_example_test.go b/libxml2_example_test.go index 33086e2..348850e 100644 --- a/libxml2_example_test.go +++ b/libxml2_example_test.go @@ -4,10 +4,10 @@ import ( "log" "net/http" - "github.com/lestrrat-go/libxml2" - "github.com/lestrrat-go/libxml2/parser" - "github.com/lestrrat-go/libxml2/types" - "github.com/lestrrat-go/libxml2/xpath" + "github.com/icysoft/libxml2" + "github.com/icysoft/libxml2/parser" + "github.com/icysoft/libxml2/types" + "github.com/icysoft/libxml2/xpath" ) func ExampleXML() { diff --git a/parser.go b/parser.go index e88ed98..2ba924f 100644 --- a/parser.go +++ b/parser.go @@ -3,8 +3,8 @@ package libxml2 import ( "io" - "github.com/lestrrat-go/libxml2/parser" - "github.com/lestrrat-go/libxml2/types" + "github.com/icysoft/libxml2/parser" + "github.com/icysoft/libxml2/types" ) // Parse parses the given buffer and returns a Document. diff --git a/parser/parser.go b/parser/parser.go index 06bd266..f4651ec 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -4,9 +4,9 @@ import ( "bytes" "io" - "github.com/lestrrat-go/libxml2/clib" - "github.com/lestrrat-go/libxml2/dom" - "github.com/lestrrat-go/libxml2/types" + "github.com/icysoft/libxml2/clib" + "github.com/icysoft/libxml2/dom" + "github.com/icysoft/libxml2/types" "github.com/pkg/errors" ) diff --git a/parser_test.go b/parser_test.go index 1bacea1..1aa708f 100644 --- a/parser_test.go +++ b/parser_test.go @@ -4,11 +4,11 @@ import ( "regexp" "testing" - "github.com/lestrrat-go/libxml2/dom" - "github.com/lestrrat-go/libxml2/types" + "github.com/icysoft/libxml2/dom" + "github.com/icysoft/libxml2/types" - "github.com/lestrrat-go/libxml2/clib" - "github.com/lestrrat-go/libxml2/parser" + "github.com/icysoft/libxml2/clib" + "github.com/icysoft/libxml2/parser" "github.com/stretchr/testify/assert" ) @@ -54,16 +54,16 @@ var ( stdXMLDecl, // only XML Declaration "", // comment only is like an empty document `]>`, // no good either ... - "", // single tag (tag mismatch) - "foo", // trailing junk - "foo", // leading junk - "", // bad attribute - `&", // bad char - `&//0x20;`, // bad chart - "r/>", // bad encoding - "&foo;", // undefind entity - ">", // unterminated entity + "", // single tag (tag mismatch) + "foo", // trailing junk + "foo", // leading junk + "", // bad attribute + `&", // bad char + `&//0x20;`, // bad chart + "r/>", // bad encoding + "&foo;", // undefind entity + ">", // unterminated entity stdXMLDecl + `]>`, // bad placed entity stdXMLDecl + `]>`, // even worse "", // bad comment diff --git a/types/interface.go b/types/interface.go index 9b665b9..df4aff4 100644 --- a/types/interface.go +++ b/types/interface.go @@ -1,6 +1,6 @@ package types -import "github.com/lestrrat-go/libxml2/clib" +import "github.com/icysoft/libxml2/clib" // PtrSource defines the interface for things that is backed by // a C backend diff --git a/xml_test.go b/xml_test.go index 9d002e4..0888389 100644 --- a/xml_test.go +++ b/xml_test.go @@ -5,10 +5,10 @@ import ( "os" "testing" - "github.com/lestrrat-go/libxml2/dom" - "github.com/lestrrat-go/libxml2/parser" - "github.com/lestrrat-go/libxml2/types" - "github.com/lestrrat-go/libxml2/xpath" + "github.com/icysoft/libxml2/dom" + "github.com/icysoft/libxml2/parser" + "github.com/icysoft/libxml2/types" + "github.com/icysoft/libxml2/xpath" "github.com/stretchr/testify/assert" ) diff --git a/xpath/interface.go b/xpath/interface.go index 6850aa6..65d946b 100644 --- a/xpath/interface.go +++ b/xpath/interface.go @@ -1,8 +1,8 @@ package xpath import ( - "github.com/lestrrat-go/libxml2/clib" - "github.com/lestrrat-go/libxml2/types" + "github.com/icysoft/libxml2/clib" + "github.com/icysoft/libxml2/types" ) const ( diff --git a/xpath/iterator.go b/xpath/iterator.go index 2debfbb..c11e082 100644 --- a/xpath/iterator.go +++ b/xpath/iterator.go @@ -1,7 +1,7 @@ package xpath import ( - "github.com/lestrrat-go/libxml2/types" + "github.com/icysoft/libxml2/types" ) // NodeIterator is a way to get at a list of nodes returned @@ -40,4 +40,4 @@ func (n *NodeIterator) Next() bool { func (n *NodeIterator) Node() types.Node { return n.curnode -} \ No newline at end of file +} diff --git a/xpath/util.go b/xpath/util.go index 93fd201..42f919e 100644 --- a/xpath/util.go +++ b/xpath/util.go @@ -1,6 +1,6 @@ package xpath -import "github.com/lestrrat-go/libxml2/types" +import "github.com/icysoft/libxml2/types" // String returns the string component of the result, and as a side effect // releases the Result by calling Free() on it. Use this if you do not @@ -39,7 +39,7 @@ func Number(r types.XPathResult, err error) float64 { } // NodeList returns the nodes associated with this result, and as a side effect -// releases the result by calling Free() on it. Use this if you do not +// releases the result by calling Free() on it. Use this if you do not // really care about the error value from Find(). func NodeList(r types.XPathResult, err error) types.NodeList { if err != nil { diff --git a/xpath/xpath.go b/xpath/xpath.go index 6f4800a..f58900c 100644 --- a/xpath/xpath.go +++ b/xpath/xpath.go @@ -1,5 +1,4 @@ /* - Package xpath contains tools to handle XPath evaluation. Because of a very quirky dependency between this package and the @@ -7,8 +6,8 @@ github.com/lestrrat/libxml2/dom package, you MUST import both packages to properly use it. import ( - "github.com/lestrrat-go/libxml2/dom" - "github.com/lestrrat-go/libxml2/xpath" + "github.com/icysoft/libxml2/dom" + "github.com/icysoft/libxml2/xpath" ) Or, if you have no use for dom package in your program, and you @@ -18,15 +17,14 @@ yourself just to appease the compiler: func init() { dom.SetupXPathCallback() } - */ package xpath import ( "fmt" - "github.com/lestrrat-go/libxml2/clib" - "github.com/lestrrat-go/libxml2/types" + "github.com/icysoft/libxml2/clib" + "github.com/icysoft/libxml2/types" "github.com/pkg/errors" ) @@ -53,7 +51,7 @@ func (x Object) Bool() bool { // WrapNodeFunc is a function that gets called when Object.NodeList() // is called. This is necessary because during the call to NodeList(), // the underlying C pointers are materialized to objects in a different -// package ("github.com/lestrrat-go/libxml2/dom"), and said package +// package ("github.com/icysoft/libxml2/dom"), and said package // uses this package... Yes, a circular dependency. // // Normally this means that both pacckages should live under the same @@ -61,7 +59,7 @@ func (x Object) Bool() bool { // we have decided they warrant to be separated. // // So this WrapNodeFunc is our workaround for this problem: when -// github.com/lestrrat-go/libxml2/dom is loaded, it automatically +// github.com/icysoft/libxml2/dom is loaded, it automatically // initializes this function to an appropriate function on the fly. var WrapNodeFunc func(uintptr) (types.Node, error) diff --git a/xpath/xpath_test.go b/xpath/xpath_test.go index e127814..6627387 100644 --- a/xpath/xpath_test.go +++ b/xpath/xpath_test.go @@ -3,8 +3,8 @@ package xpath_test import ( "testing" - "github.com/lestrrat-go/libxml2" - "github.com/lestrrat-go/libxml2/xpath" + "github.com/icysoft/libxml2" + "github.com/icysoft/libxml2/xpath" "github.com/stretchr/testify/assert" ) diff --git a/xsd/interface.go b/xsd/interface.go index 6177f41..2684866 100644 --- a/xsd/interface.go +++ b/xsd/interface.go @@ -1,6 +1,6 @@ package xsd -import "github.com/lestrrat-go/libxml2/internal/option" +import "github.com/icysoft/libxml2/internal/option" // Schema represents an XML schema. type Schema struct { diff --git a/xsd/option.go b/xsd/option.go index 0a356b2..20531dd 100644 --- a/xsd/option.go +++ b/xsd/option.go @@ -5,7 +5,7 @@ import ( "os" "path/filepath" - "github.com/lestrrat-go/libxml2/internal/option" + "github.com/icysoft/libxml2/internal/option" ) // WithPath provides a hint to the XSD parser as to where the diff --git a/xsd/xsd.go b/xsd/xsd.go index bf3e46c..0acad3d 100644 --- a/xsd/xsd.go +++ b/xsd/xsd.go @@ -3,22 +3,21 @@ // // This is basically all you need to do: // -// schema, err := xsd.Parse(xsdsrc) -// if err != nil { -// panic(err) -// } -// defer schema.Free() -// if err := schema.Validate(doc); err != nil{ -// for _, e := range err.(SchemaValidationErr).Error() { -// println(e.Error()) -// } -// } -// +// schema, err := xsd.Parse(xsdsrc) +// if err != nil { +// panic(err) +// } +// defer schema.Free() +// if err := schema.Validate(doc); err != nil{ +// for _, e := range err.(SchemaValidationErr).Error() { +// println(e.Error()) +// } +// } package xsd import ( - "github.com/lestrrat-go/libxml2/clib" - "github.com/lestrrat-go/libxml2/types" + "github.com/icysoft/libxml2/clib" + "github.com/icysoft/libxml2/types" "github.com/pkg/errors" ) @@ -28,7 +27,6 @@ const ValueVCCreate = 1 // Schema instance. Make sure to call Free() on the instance // when you are done with it. - func Parse(buf []byte, options ...Option) (*Schema, error) { // xsd.WithURI(...) sptr, err := clib.XMLSchemaParse(buf, options...) diff --git a/xsd_test.go b/xsd_test.go index 2be5dc8..f7b3284 100644 --- a/xsd_test.go +++ b/xsd_test.go @@ -8,8 +8,8 @@ import ( "path/filepath" "testing" - "github.com/lestrrat-go/libxml2" - "github.com/lestrrat-go/libxml2/xsd" + "github.com/icysoft/libxml2" + "github.com/icysoft/libxml2/xsd" "github.com/stretchr/testify/assert" )