Beispiel #1
0
        ///
        ///	 <summary> * searches for the first attribute occurence in the ancestor elements subelements<br>
        ///	 * e.g. the JobPriority in NodeInfo
        ///	 *  </summary>
        ///	 * <param name="element"> node name to look in </param>
        ///	 * <param name="attrib"> the attribute name </param>
        ///	 * <param name="nameSpaceURI"> the XML-namespace </param>
        ///	 * <param name="def"> the default if it does not exist
        ///	 * @since 200503 </param>
        ///	 * <returns> value of attribute found, empty string if not available </returns>
        ///
        public virtual string getAncestorElementAttribute(string element, string attrib, string nameSpaceURI, string def)
        {
            VElement v = getPoolChildren(null);

            // the last in list is the direct parent, the first is the original root

            for (int i = v.Count - 1; i >= 0; i--)
            {
                JDFAncestor ancestor = (JDFAncestor)v[i];
                KElement    e        = ancestor.getElement(element, nameSpaceURI, 0);
                if ((e != null) && (e.hasAttribute(attrib, nameSpaceURI, false)))
                {
                    return(e.getAttribute(attrib, nameSpaceURI, JDFConstants.EMPTYSTRING));
                }
            }
            return(def);
        }