Пример #1
0
        private void HandleElement(XmlElementContext context)
        {
            string    str;
            Transform transform = context.ConstructTransform(out str);

            if (transform != null)
            {
                bool         supressWarnings = this.logger.SupressWarnings;
                XmlAttribute namedItem       = context.Element.Attributes.GetNamedItem(SupressWarnings, TransformNamespace) as XmlAttribute;
                if (namedItem != null)
                {
                    bool flag2 = Convert.ToBoolean(namedItem.Value, CultureInfo.InvariantCulture);
                    this.logger.SupressWarnings = flag2;
                }
                try
                {
                    this.OnApplyingTransform();
                    transform.Execute(context, str);
                    this.OnAppliedTransform();
                }
                catch (Exception exception)
                {
                    this.HandleException(exception, context);
                }
                finally
                {
                    this.logger.SupressWarnings = supressWarnings;
                }
            }
            this.TransformLoop(context);
        }
Пример #2
0
        private void HandleElement(XmlElementContext context)
        {
            string    argumentString;
            Transform transform = context.ConstructTransform(out argumentString);

            if (transform != null)
            {
                bool fOriginalSupressWarning = logger.SupressWarnings;

                XmlAttribute SupressWarningsAttribute = context.Element.Attributes.GetNamedItem(XmlTransformation.SupressWarnings, XmlTransformation.TransformNamespace) as XmlAttribute;
                if (SupressWarningsAttribute != null)
                {
                    bool fSupressWarning = System.Convert.ToBoolean(SupressWarningsAttribute.Value, System.Globalization.CultureInfo.InvariantCulture);
                    logger.SupressWarnings = fSupressWarning;
                }

                try
                {
                    OnApplyingTransform();

                    transform.Execute(context, argumentString);

                    OnAppliedTransform();
                }
                catch (Exception ex)
                {
                    HandleException(ex, context);
                }
                finally
                {
                    // reset back the SupressWarnings back per node
                    logger.SupressWarnings = fOriginalSupressWarning;
                }
            }

            // process children
            TransformLoop(context);
        }