private bool LoadLocator(XmlNode locNode, Dictionary <string, string> discoveredSchemas, string schemaPath) { string href = null; string label = null; if (!Common.GetAttribute(locNode, HREF_TAG, ref href, errorList) || !Common.GetAttribute(locNode, LABEL_TAG, ref label, errorList)) { return(false); } if (string.IsNullOrEmpty(href)) { return(false); } LocatorBase locator = CreateLocator(href); locator.ParseHRef(errorList); LinkBase.AddDiscoveredSchema(schemaPath, locator.Xsd, discoveredSchemas); locator.AddLabel(label); if (locators.ContainsKey(locator.HRef)) { PresentationLocator oll = (PresentationLocator)locators[locator.HRef]; // add a new one, pointing to the same locator if (!oll.LabelArray.Contains(label)) { oll.AddLabel(label); } } else { locators[locator.HRef] = locator; } HybridDictionary hrefList = this.LabelHrefMapping[label] as HybridDictionary; if (hrefList == null) { hrefList = new HybridDictionary(); this.LabelHrefMapping[label] = hrefList; } hrefList[locator.HRef] = 1; return(true); }
public virtual bool LoadLocator(XmlNode locNode) { string href = null; string label = null; if (!Common.GetAttribute(locNode, HREF_TAG, ref href, errorList) || !Common.GetAttribute(locNode, LABEL_TAG, ref label, errorList)) { return(false); } LocatorBase locator = CreateLocator(href); locator.ParseHRef(errorList); locator.AddLabel(label); LocatorBase oll = null; if (locators.ContainsKey(label)) { oll = (LocatorBase)locators[label]; // add a new one, pointing to the same locator if (!oll.LabelArray.Contains(label)) { // BUG 1610 - create a new presentation locator, since two arcs could have different // priorities. PresentationLocator newPL = new PresentationLocator(); newPL.HRef = oll.HRef; newPL.UnpartitionedHref = oll.UnpartitionedHref; newPL.Xsd = oll.Xsd; // Add the label to the new presentation locator. This will differentiate the two locators. newPL.AddLabel(label); locators[label] = newPL; } } else { locators[label] = locator; } return(true); }
public virtual bool LoadLocator(XmlNode locNode) { string href = null; string label = null; if (!Common.GetAttribute(locNode, HREF_TAG, ref href, errorList) || !Common.GetAttribute(locNode, LABEL_TAG, ref label, errorList)) { return false; } LocatorBase locator = CreateLocator(href); locator.ParseHRef(errorList); locator.AddLabel(label); LocatorBase oll = null; if (locators.ContainsKey(label)) { oll = (LocatorBase)locators[label]; // add a new one, pointing to the same locator if (!oll.LabelArray.Contains(label)) { // BUG 1610 - create a new presentation locator, since two arcs could have different // priorities. PresentationLocator newPL = new PresentationLocator(); newPL.HRef = oll.HRef; newPL.UnpartitionedHref = oll.UnpartitionedHref; newPL.Xsd = oll.Xsd; // Add the label to the new presentation locator. This will differentiate the two locators. newPL.AddLabel(label); locators[label] = newPL; } } else { locators[label] = locator; } return true; }