Пример #1
0
        /// <summary>Sets an element or attribute value identified by an XPath-like query string.</summary>
        /// <remarks>
        ///   NOTE: This method makes calls to SIFXPathContext. If multiple calls to
        ///  <c>setElementOrAttribute</c> are being done, it is much more efficient to create
        ///  a new <c>SIFXPathContext</c> by calling <c>SIFXPathContext.newInstance(sdo)</c> and then
        /// calling <c>.setElementorAttributeon</c> on that SifXPathContext instance
        /// </remarks>
        /// <param name="xpath">An XPath-like query string that identifies identifies
        /// the element or attribute to set. The string must reference elements
        /// and attributes by their <i>version-independent</i> names.
        /// </param>
        /// <param name="valu">The value of the element or attribute
        /// </param>
        public virtual void SetElementOrAttribute(string xpath,
                                                  string valu)
        {
            SifVersion = Adk.SifVersion;
            SifXPathContext spc = SifXPathContext.NewSIFContext(this);

            spc.SetElementOrAttribute(xpath, valu);
        }
Пример #2
0
        /// <summary>Sets an element or attribute value identified by an XPath-like query string.</summary>
        /// <remarks>
        ///   NOTE: This method makes calls to SIFXPathContext. If multiple calls to
        ///  <c>setElementOrAttribute</c> are being done, it is much more efficient to create
        ///  a new <c>SifXPathContext</c> by calling <c>SifXPathContext.NewInstance(sdo)</c> and then
        /// calling <c>.SetElementorAttributeon</c> on that SifXPathContext instance
        /// </remarks>
        /// <param name="xpath">An XPath-like query string that identifies the element or
        /// attribute to set. The string must reference elements and attributes
        /// by their <i>version-independent</i> names.
        /// </param>
        /// <param name="valu">The value to assign to the element or attribute if the
        /// query string does not set a value; may be null
        /// </param>
        /// <param name="adaptor"> A data source may be used for variable
        /// substitutions within the query string
        /// </param>
        public virtual void SetElementOrAttribute(string xpath,
                                                  string valu,
                                                  IFieldAdaptor adaptor)
        {
            SifVersion = Adk.SifVersion;
            SifXPathContext spc = SifXPathContext.NewSIFContext(this);

            if (adaptor is IXPathVariableLibrary)
            {
                spc.AddVariables("", (IXPathVariableLibrary)adaptor);
            }
            spc.SetElementOrAttribute(xpath, valu);
        }