/// <summary> /// XML名前空間をインスタンス化します。 /// </summary> public XmlNamespacesItem(string expression) { try { TSqlScript script = (TSqlScript)TransactSQL._Parser.Parse(new StringReader($"WITH XMLNAMESPACES({expression}) SELECT 1"), out IList <ParseError> errors); if (errors.Count > 0 || script.Batches.Count != 1 || script.Batches[0].Statements.Count != 1 || !(script.Batches[0].Statements[0] is SelectStatement selectStatement) || selectStatement.WithCtesAndXmlNamespaces == null || selectStatement.WithCtesAndXmlNamespaces.XmlNamespaces == null || selectStatement.WithCtesAndXmlNamespaces.XmlNamespaces.XmlNamespacesElements.Count != 1) { throw new ArgumentException("指定された XML名前空間 の解析に失敗しました。"); } XmlNamespacesElement = selectStatement.WithCtesAndXmlNamespaces.XmlNamespaces.XmlNamespacesElements[0]; } catch (InvalidCastException) { throw new ArgumentException("指定された SELECT項目 の解析に失敗しました。"); } }
/// <summary> /// XML名前空間をインスタンス化します。 /// </summary> internal XmlNamespacesItem(XmlNamespacesElement xmlNamespacesElement) { XmlNamespacesElement = xmlNamespacesElement; }
public override void ExplicitVisit(XmlNamespacesElement fragment) { _fragments.Add(fragment); }
/// <summary> /// KzLib.SqlServer.TransactSql.ScriptDom.AddXmlNamespacesElementVisitor をインスタンス化します。 /// </summary> /// <param name="xmlNamespacesElement">追加する名前空間</param> public AddXmlNamespacesElementVisitor(XmlNamespacesElement xmlNamespacesElement) { XmlNamespacesElement = xmlNamespacesElement; }
public sealed override void ExplicitVisit(XmlNamespacesElement node) { base.ExplicitVisit(node); }
public override void ExplicitVisit(XmlNamespacesElement node) { this.action(node); }