public CopyFromIndexCommand(IndexedDocumentSource sourceIndex,
                                    string keyXPath, string sourceXPath, string targetXPath,
                                    string attributeValue, string ignoreCaseValue) : this()
        {
            BuildComponentExceptions.NotNull(sourceIndex, "sourceIndex");

            this.cache = sourceIndex;

            if (String.IsNullOrEmpty(keyXPath))
            {
                key = XPathExpression.Compile("string($key)");
            }
            else
            {
                key = XPathExpression.Compile(keyXPath);
            }

            source     = XPathExpression.Compile(sourceXPath);
            target     = targetXPath;
            attribute  = attributeValue;
            ignoreCase = ignoreCaseValue;
        }
Esempio n. 2
0
        public static ConceptualLinkInfo Create(XPathNavigator node)
        {
            BuildComponentExceptions.NotNull(node, "node");

            ConceptualLinkInfo info = new ConceptualLinkInfo();

            string tempText    = node.GetAttribute("target", String.Empty);
            int    anchorStart = tempText.IndexOf("#");

            if (anchorStart > 0)
            {
                // We retrieve the anchor text with the #...
                info._anchor = tempText.Substring(anchorStart);
                info._target = tempText.Substring(0, anchorStart);
            }
            else
            {
                info._target = tempText;
            }

            info._text = node.ToString().Trim();

            return(info);
        }