From: Oleg T. <he...@us...> - 2005-11-20 21:57:06
|
Update of /cvsroot/mvp-xml/Common/v2/src/Xsl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20469/v2/src/Xsl Modified Files: MvpXslTransform.cs Log Message: Index: MvpXslTransform.cs =================================================================== RCS file: /cvsroot/mvp-xml/Common/v2/src/Xsl/MvpXslTransform.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- MvpXslTransform.cs 19 Nov 2005 22:21:10 -0000 1.6 +++ MvpXslTransform.cs 20 Nov 2005 21:56:58 -0000 1.7 @@ -74,20 +74,43 @@ #region Load() method overloads - /// <summary> Loads the XSLT stylesheet contained in the IXPathNavigable</summary> - public void Load(IXPathNavigable ixn) { this.compiledTransform.Load(ixn); } + /// <summary> + /// Loads and compiles the style sheet contained in the <see cref="IXPathNavigable"/> object. + /// See also <see cref="XslCompiledTransform(IXPathNavigable)"/>. + /// </summary> + /// <param name="stylesheet">An object implementing the <see cref="IXPathNavigable"/> interface. + /// In the Microsoft .NET Framework, this can be either an <see cref="XmlNode"/> (typically an <see cref="XmlDocument"/>), + /// or an <see cref="XPathDocument"/> containing the style sheet.</param> + public void Load(IXPathNavigable stylesheet) { this.compiledTransform.Load(stylesheet); } - /// <summary> Loads the XSLT stylesheet specified by a URI</summary> + /// <summary> + /// Loads and compiles the style sheet located at the specified URI. + /// See also <see cref="XslCompiledTransform(String)"/>. + /// </summary> + /// <param name="stylesheetUri">The URI of the style sheet.</param> public void Load(string stylesheetUri) { this.compiledTransform.Load(stylesheetUri); } - /// <summary> Loads the XSLT stylesheet contained in the XmlReader</summary> - public void Load(XmlReader reader) { this.compiledTransform.Load(reader); } + /// <summary> + /// Compiles the style sheet contained in the <see cref="XmlReader"/>. + /// See also <see cref="XslCompiledTransform(XmlReader)"/>. + /// </summary> + /// <param name="stylesheet">An <see cref="XmlReader"/> containing the style sheet.</param> + public void Load(XmlReader stylesheet) { this.compiledTransform.Load(stylesheet); } /// <summary> - /// Compiles the XSLT style sheet contained in the IXPathNavigable. - /// The XmlResolver resolves any XSLT import or include elements and the + /// Compiles the XSLT style sheet contained in the <see cref="IXPathNavigable"/>. + /// The <see cref="XmlResolver"/> resolves any XSLT <c>import</c> or <c>include</c> elements and the /// XSLT settings determine the permissions for the style sheet. - /// </summary> + /// See also <see cref="XslCompiledTransform(IXPathNavigable, XsltSettings, XmlResolver)"/>. + /// </summary> + /// <param name="stylesheet">An object implementing the <see cref="IXPathNavigable"/> interface. + /// In the Microsoft .NET Framework, this can be either an <see cref="XmlNode"/> (typically an <see cref="XmlDocument"/>), + /// or an <see cref="XPathDocument"/> containing the style sheet.</param> + /// <param name="settings">The <see cref="XsltSettings"/> to apply to the style sheet. + /// If this is a null reference (Nothing in Visual Basic), the <see cref="XsltSettings.Default"> setting is applied.</param> + /// <param name="stylesheetResolver">The <see cref="XmlResolver"/> used to resolve any + /// style sheets referenced in XSLT <c>import</c> and <c>include</c> elements. If this is a + /// null reference (Nothing in Visual Basic), external resources are not resolved.</param> public void Load(IXPathNavigable stylesheet, XsltSettings settings, XmlResolver stylesheetResolver) { this.compiledTransform.Load(stylesheet, settings, stylesheetResolver); @@ -95,19 +118,33 @@ /// <summary> /// Loads and compiles the XSLT style sheet specified by the URI. - /// The XmlResolver resolves any XSLT import or include elements and the + /// The <see cref="XmlResolver"/> resolves any XSLT <c>import</c> or <c>include</c> elements and the /// XSLT settings determine the permissions for the style sheet. - /// </summary> + /// See also <see cref="XslCompiledTransform(string, XsltSettings, XmlResolver)"/>. + /// </summary> + /// <param name="stylesheetUri">The URI of the style sheet.</param> + /// <param name="settings">The <see cref="XsltSettings"/> to apply to the style sheet. + /// If this is a null reference (Nothing in Visual Basic), the <see cref="XsltSettings.Default"> setting is applied.</param> + /// <param name="stylesheetResolver">The <see cref="XmlResolver"/> used to resolve any + /// style sheets referenced in XSLT <c>import</c> and <c>include</c> elements. If this is a + /// null reference (Nothing in Visual Basic), external resources are not resolved.</param> public void Load(string stylesheetUri, XsltSettings settings, XmlResolver stylesheetResolver) { this.compiledTransform.Load(stylesheetUri, settings, stylesheetResolver); } /// <summary> - /// Compiles the XSLT style sheet contained in the XmlReader. - /// The XmlResolver resolves any XSLT import or include elements and the + /// Compiles the XSLT style sheet contained in the <see cref="XmlReader"/>. + /// The <see cref="XmlResolver"/> resolves any XSLT <c>import</c> or <c>include</c> elements and the /// XSLT settings determine the permissions for the style sheet. - /// </summary> + /// See also <see cref="XslCompiledTransform(XmlReader, XsltSettings, XmlResolver)"/>. + /// </summary> + /// <param name="stylesheet">The <see cref="XmlReader"/> containing the style sheet.</param> + /// <param name="settings">The <see cref="XsltSettings"/> to apply to the style sheet. + /// If this is a null reference (Nothing in Visual Basic), the <see cref="XsltSettings.Default"> setting is applied.</param> + /// <param name="stylesheetResolver">The <see cref="XmlResolver"/> used to resolve any + /// style sheets referenced in XSLT <c>import</c> and <c>include</c> elements. If this is a + /// null reference (Nothing in Visual Basic), external resources are not resolved.</param> public void Load(XmlReader stylesheet, XsltSettings settings, XmlResolver stylesheetResolver) { this.compiledTransform.Load(stylesheet, settings, stylesheetResolver); @@ -162,13 +199,15 @@ /// <summary> /// Transforms given <see cref="XmlInput"/> into <see cref="XmlOutput"/>. + /// The <see cref="XsltArgumentList"/> provides additional runtime arguments. /// </summary> - /// <param name="defaulDocument">Default input XML document</param> - /// <param name="args">Parameters</param> - /// <param name="output">Represents the transformation's output</param> - public void Transform(XmlInput defaultDocument, XsltArgumentList args, XmlOutput output) + /// <param name="input">Default input XML document.</param> + /// <param name="arguments">An <see cref="XsltArgumentList"/> containing the namespace-qualified + /// arguments used as input to the transform. This value can be a null reference (Nothing in Visual Basic).</param> + /// <param name="output">Represents the transformation's output.</param> + public void Transform(XmlInput input, XsltArgumentList arguments, XmlOutput output) { - if (defaultDocument == null) throw new ArgumentNullException("defaltDocument"); + if (input == null) throw new ArgumentNullException("defaltDocument"); XmlWriter xmlWriter = output.destination as XmlWriter; bool closeWriter = false; if (xmlWriter == null) @@ -223,7 +262,7 @@ } try { - TransformToWriter(defaultDocument, args, xmlWriter); + TransformToWriter(input, arguments, xmlWriter); } finally { @@ -260,12 +299,13 @@ /// <summary> /// Transforms given <see cref="XmlInput"/> into <see cref="XmlReader"/>. /// </summary> - /// <param name="defaulDocument">Default input XML document</param> - /// <param name="args">Parameters</param> - public XmlReader Transform(XmlInput defaultDocument, XsltArgumentList args) + /// <param name="input">Default input XML document</param> + /// <param name="arguments">An <see cref="XsltArgumentList"/> containing the namespace-qualified + /// arguments used as input to the transform. This value can be a null reference (Nothing in Visual Basic).</param> + public XmlReader Transform(XmlInput input, XsltArgumentList arguments) { XslReader r = new XslReader(this.compiledTransform); - r.StartTransform(defaultDocument, AddExsltExtensionObjects(args)); + r.StartTransform(input, AddExsltExtensionObjects(arguments)); return r; } @@ -349,9 +389,9 @@ { object command = this.compiledTransform.GetType().GetField( "command", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this.compiledTransform); - MethodInfo executeMethod = command.GetType().GetMethod("Execute", BindingFlags.Instance | BindingFlags.NonPublic, + MethodInfo executeMethod = command.GetType().GetMethod("Execute", BindingFlags.Instance | BindingFlags.Public, null, new Type[] { typeof(IXPathNavigable), typeof(XmlResolver), typeof(XsltArgumentList), typeof(XmlWriter) }, null); - executeMethod.Invoke(this.compiledTransform, + executeMethod.Invoke(command, new object[] { nav, resolver, AddExsltExtensionObjects(args), xmlWriter }); } |