Re: [go-nuts] using the xml package with data with complex name spacing

2020-12-14 Thread 'Dan Kortschak' via golang-nuts
On Mon, 2020-12-14 at 13:53 +, Sam Whited wrote:
> In the example you provided it is working as expected. The element
> you're unmarshaling is in the "
> http://www.w3.org/1999/02/22-rdf-syntax-ns#; namespace (it has an
> "rdf"
> prefix) but the thing you're unmarshaling it into expects
> "http://purl.obolibrary.org/obo/go/subsets/goslim_yeast.owl#; because
> you
> put that in the tag.
> 
> If you change the namespace in the struct to the correct one
> everything will work.
> 
> —Sam

Thanks, Sam. I figured it would be something simple like that.

I ended up skirting the issue; I do start with parsing the token stream
and then using the Decoder.DecodeElement on specific start elements
(for reasons entirely unrelated to the original questions).

Dan


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/6f77aef8da7260a47cbb8e428b0bfb074100403a.camel%40kortschak.io.


Re: [go-nuts] using the xml package with data with complex name spacing

2020-12-14 Thread Sam Whited
In the example you provided it is working as expected. The element
you're unmarshaling is in the "
http://www.w3.org/1999/02/22-rdf-syntax-ns#; namespace (it has an "rdf"
prefix) but the thing you're unmarshaling it into expects
"http://purl.obolibrary.org/obo/go/subsets/goslim_yeast.owl#; because you
put that in the tag.

If you change the namespace in the struct to the correct one everything will 
work.

—Sam

On Sun, Dec 13, 2020, at 22:25, 'Dan Kortschak' via golang-nuts wrote:
> I'm needing to consume some XML which has a namespace
> identifier reused.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/cefacd09-2b91-407e-939e-22b920969644%40www.fastmail.com.


[go-nuts] using the xml package with data with complex name spacing

2020-12-13 Thread 'Dan Kortschak' via golang-nuts
I'm needing to consume some XML which has a namespace identifier
reused.

http://purl.obolibrary.org/obo/go/subsets/goslim_yeast.owl#;
 xml:base="http://purl.obolibrary.org/obo/go/subsets/goslim_yeast.owl;
 xmlns:go="http://purl.obolibrary.org/obo/go#;
 xmlns:obo="http://purl.obolibrary.org/obo/;
 xmlns:owl="http://www.w3.org/2002/07/owl#;
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#;
 xmlns:xml="http://www.w3.org/XML/1998/namespace;
 xmlns:xsd="http://www.w3.org/2001/XMLSchema#;
 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#;
 
xmlns:terms="http://www.geneontology.org/formats/oboInOwl#http://purl.org/dc/terms/;
 xmlns:oboInOwl="http://www.geneontology.org/formats/oboInOwl#;>;
http://purl.obolibrary.org/obo/go/subsets/goslim_yeast.owl;>;
http://purl.obolibrary.org/obo/go/2020-12-08/subsets/goslim_yeast.owl"/>;







I'm wondering if I can do this with out directly interacting with a
token stream.

https://play.golang.org/p/5y0LGh-MbGE

thanks


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c260a95b4229b48d4fce89c84f3c094079229caf.camel%40kortschak.io.