diff --git a/cmd/build.go b/cmd/build.go index 3239142..51cb114 100644 --- a/cmd/build.go +++ b/cmd/build.go @@ -61,12 +61,16 @@ should be enough for the next successful build).`, panic(err) } root := doc.SelectElement("rdf:RDF") - for _, z := range root.FindElements("[link:type]") { + for _, z := range root.FindElements("[name()='link:type']") { doc := etree.NewDocument() - doc.SetRoot(z.Copy()) + doc.SetRoot(z.Parent().Copy()) + if z.Text() != "application/pdf" { + continue + } + fmt.Println(z.Text()) fmt.Println("~ ~ ~ ~") fmt.Println(doc.WriteTo(os.Stdout)) - elm := root.FindElement(fmt.Sprintf("[@rdf:resource='%s']", z.SelectAttr("rdf:about").Value)) + elm := root.FindElement(fmt.Sprintf("[@rdf:resource='%s']", z.Parent().SelectAttr("rdf:about").Value)) doc.SetRoot(elm.Parent().Copy()) fmt.Println("+++++") fmt.Println(doc.WriteTo(os.Stdout))