//------------------------------------------------------------------------------- //------------------------------------------------------------------------------- private void CreateNamespaceManager() { thisNamespaceManager = Container.Resolve <INamespaceManager>(); thisNamespaceManager.AddNamespace("instance", this.XbrlRootNode.NamespaceURI); foreach (IAttribute CurrentAttribute in this.XbrlRootNode.Attributes) { if (CurrentAttribute.Prefix == "xmlns") { thisNamespaceManager.AddNamespace(CurrentAttribute.LocalName, CurrentAttribute.Value); } } }
/// <summary> /// Initializes a new instance of the <see cref="NancyRdfStartup"/> class. /// </summary> public NancyRdfStartup(INamespaceManager mapper, IWikibusConfiguration config) { mapper.SetBaseUri(new Uri(config.BaseResourceNamespace)); mapper.AddNamespace(Dc.Prefix, new Uri(Dc.BaseUri)); mapper.AddNamespace(Dcterms.Prefix, new Uri(Dcterms.BaseUri)); mapper.AddNamespace(Schema.Prefix, new Uri(Schema.BaseUri)); mapper.AddNamespace(Vocab.Hydra.Prefix, new Uri(Vocab.Hydra.BaseUri)); mapper.AddNamespace(Rdf.Prefix, new Uri(Rdf.BaseUri)); mapper.AddNamespace(Rdfs.Prefix, new Uri(Rdfs.BaseUri)); mapper.AddNamespace(Bibo.Prefix, new Uri(Bibo.BaseUri)); mapper.AddNamespace(Opus.Prefix, new Uri(Opus.BaseUri)); mapper.AddNamespace("lexvo", new Uri(Lexvo.iso639_1)); mapper.AddNamespace(Wbo.Prefix, new Uri(Wbo.BaseUri)); }
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------ internal LinkbaseDocument(string ContainingDocumentUri, string DocumentPath) { thisLinkbasePath = GetFullLinkbasePath(ContainingDocumentUri, DocumentPath); thisXmlDocument = Container.Resolve <IDocument>(); thisXmlDocument.Load(thisLinkbasePath); thisNamespaceManager = Container.Resolve <INamespaceManager>(); thisNamespaceManager.Document = thisXmlDocument; thisNamespaceManager.AddNamespace("default", XbrlDocument.XbrlLinkbaseNamespaceUri); thisLinkbaseNode = thisXmlDocument.SelectSingleNode("//default:linkbase", thisNamespaceManager); }