Update of /cvsroot/mvp-xml/EXSLT/v1/src/Exslt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15352/v1/src/Exslt Modified Files: AssemblyInfo.cs Exslt.csproj ExsltContext.cs ExsltMath.cs ExsltNamespaces.cs ExsltNodeList.cs ExsltSets.cs ExsltTransform.cs Log Message: Index: ExsltNamespaces.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v1/src/Exslt/ExsltNamespaces.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ExsltNamespaces.cs 15 Oct 2005 22:11:16 -0000 1.2 +++ ExsltNamespaces.cs 22 Oct 2005 21:18:07 -0000 1.3 @@ -2,7 +2,8 @@ /// <summary> /// Exslt (and other) namespaces constants. /// </summary> - public class ExsltNamespaces { + public class ExsltNamespaces { + public const string Common = "http://exslt.org/common"; public const string DatesAndTimes = "http://exslt.org/dates-and-times"; public const string Math = "http://exslt.org/math"; public const string Random = "http://exslt.org/random"; Index: ExsltMath.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v1/src/Exslt/ExsltMath.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ExsltMath.cs 15 Oct 2005 22:11:16 -0000 1.2 +++ ExsltMath.cs 22 Oct 2005 21:18:07 -0000 1.3 @@ -3,7 +3,6 @@ using System; using System.Xml; using System.Xml.XPath; -using System.Collections.Generic; #endregion @@ -130,11 +129,11 @@ /// <returns>All the nodes that contain the min value in the nodeset</returns> public XPathNodeIterator lowest(XPathNodeIterator iterator){ - IList<XPathNavigator> newList = new List<XPathNavigator>(); + ExsltNodeList newList = new ExsltNodeList(); double min, t; if(iterator.Count == 0){ - return newList; + return ExsltCommon.ExsltNodeListToXPathNodeIterator(newList); } Index: ExsltNodeList.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v1/src/Exslt/ExsltNodeList.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ExsltNodeList.cs 15 Oct 2005 22:11:16 -0000 1.2 +++ ExsltNodeList.cs 22 Oct 2005 21:18:07 -0000 1.3 @@ -1,7 +1,7 @@ #region using using System; -using System.Collections.Generic; +using System.Collections; using System.Xml.XPath; #endregion @@ -19,7 +19,7 @@ /// <summary> /// The inner arraylist used by this class. /// </summary> - internal IList<XPathNavigator> innerList = new List<XPathNavigator>(); + internal ArrayList innerList = new ArrayList(); #endregion @@ -52,7 +52,7 @@ /// in the iterator are placed in the list. /// </summary> /// <param name="iterator">The iterator to load the nodelist from</param> - public ExsltNodeList(XPathNodeIterator iterator): this(iterator, false) {} + public ExsltNodeList(XPathNodeIterator iterator): this(iterator, false){;} @@ -91,17 +91,18 @@ /// Returns an enumerator for the entire list. /// </summary> /// <returns>An enumerator for the entire list</returns> - public IEnumerator<XPathNavigator> GetEnumerator(){ + public IEnumerator GetEnumerator(){ return this.innerList.GetEnumerator(); } /// <summary> /// Adds an item to the list /// </summary> - /// <param name="value">The item to add</param> - public void Add( XPathNavigator nav){ + /// <param name="value">The item to add</param> + /// <returns>The position into which the new element was inserted</returns> + public int Add( XPathNavigator nav){ - this.innerList.Add(nav); + return this.innerList.Add(nav); } @@ -152,7 +153,7 @@ /// <returns>The index of value if found in the list; otherwise, -1.</returns> public int IndexOf( object value ){ - return this.innerList.IndexOf(value as XPathNavigator); + return this.innerList.IndexOf(value); } /// <summary> Index: Exslt.csproj =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v1/src/Exslt/Exslt.csproj,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Exslt.csproj 15 Oct 2005 21:24:17 -0000 1.3 +++ Exslt.csproj 22 Oct 2005 21:18:07 -0000 1.4 @@ -1,163 +1,214 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <ProjectType>Local</ProjectType> - <ProductVersion>8.0.50215</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{BA694D9F-6B1E-4038-AC81-BF1640C07D90}</ProjectGuid> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ApplicationIcon> - </ApplicationIcon> - <AssemblyKeyContainerName> - </AssemblyKeyContainerName> - <AssemblyName>Mvp.Xml.Exslt</AssemblyName> - <AssemblyOriginatorKeyFile> - </AssemblyOriginatorKeyFile> - <DefaultClientScript>JScript</DefaultClientScript> - <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> - <DefaultTargetSchema>IE50</DefaultTargetSchema> - <DelaySign>false</DelaySign> - <OutputType>Library</OutputType> - <RootNamespace>Mvp.Xml.Exslt</RootNamespace> - <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> - <StartupObject> - </StartupObject> - <FileUpgradeFlags> - </FileUpgradeFlags> - <UpgradeBackupLocation> - </UpgradeBackupLocation> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <OutputPath>.\</OutputPath> - <AllowUnsafeBlocks>false</AllowUnsafeBlocks> - <BaseAddress>285212672</BaseAddress> - <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> - <ConfigurationOverrideFile> - </ConfigurationOverrideFile> - <DefineConstants>DEBUG;TRACE;NET11</DefineConstants> - <DocumentationFile> - </DocumentationFile> - <DebugSymbols>true</DebugSymbols> - <FileAlignment>4096</FileAlignment> - <NoStdLib>false</NoStdLib> - <NoWarn> - </NoWarn> - <Optimize>false</Optimize> - <RegisterForComInterop>false</RegisterForComInterop> - <RemoveIntegerChecks>false</RemoveIntegerChecks> - <TreatWarningsAsErrors>false</TreatWarningsAsErrors> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <OutputPath>.\</OutputPath> - <AllowUnsafeBlocks>false</AllowUnsafeBlocks> - <BaseAddress>285212672</BaseAddress> - <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> - <ConfigurationOverrideFile> - </ConfigurationOverrideFile> - <DefineConstants>TRACE;NET11</DefineConstants> - <DocumentationFile> - </DocumentationFile> - <DebugSymbols>false</DebugSymbols> - <FileAlignment>4096</FileAlignment> - <NoStdLib>false</NoStdLib> - <NoWarn> - </NoWarn> - <Optimize>true</Optimize> - <RegisterForComInterop>false</RegisterForComInterop> - <RemoveIntegerChecks>false</RemoveIntegerChecks> - <TreatWarningsAsErrors>false</TreatWarningsAsErrors> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="System"> - <Name>System</Name> - </Reference> - <Reference Include="System.Data"> - <Name>System.Data</Name> - </Reference> - <Reference Include="System.Drawing"> - <Name>System.Drawing</Name> - </Reference> - <Reference Include="System.Web"> - <Name>System.Web</Name> - </Reference> - <Reference Include="System.Windows.Forms"> - <Name>System.Windows.Forms</Name> - </Reference> - <Reference Include="System.Xml"> - <Name>System.XML</Name> - </Reference> - </ItemGroup> - <ItemGroup> - <Compile Include="AssemblyInfo.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="ExsltContext.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="ExsltContextFunction.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="ExsltDatesAndTimes.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="ExsltMath.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="ExsltNamespaces.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="ExsltNodeList.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="ExsltRandom.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="ExsltRegularExpressions.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="ExsltSets.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="ExsltStrings.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="ExsltTransform.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="GDNDatesAndTimes.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="GDNDynamic.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="GDNMath.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="GDNRegularExpressions.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="GDNSets.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="GDNStrings.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="MultiOutput\MultiXmlTextWriter.cs"> - <SubType>Code</SubType> - </Compile> - <Compile Include="MultiOutput\OutputState.cs"> - <SubType>Code</SubType> - </Compile> - <Content Include="Makefile" /> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> - <PropertyGroup> - <PreBuildEvent> - </PreBuildEvent> - <PostBuildEvent>@echo ########### Setting environment variables -call "$(DevEnvDir)..\Tools\vsvars32.bat" -nmake</PostBuildEvent> - </PropertyGroup> -</Project> \ No newline at end of file +<VisualStudioProject> + <CSHARP + ProjectType = "Local" + ProductVersion = "7.10.3077" + SchemaVersion = "2.0" + ProjectGuid = "{BA694D9F-6B1E-4038-AC81-BF1640C07D90}" + > + <Build> + <Settings + ApplicationIcon = "" + AssemblyKeyContainerName = "" + AssemblyName = "Mvp.Xml.Exslt" + AssemblyOriginatorKeyFile = "" + DefaultClientScript = "JScript" + DefaultHTMLPageLayout = "Grid" + DefaultTargetSchema = "IE50" + DelaySign = "false" + OutputType = "Library" + PreBuildEvent = "" + PostBuildEvent = '@echo ########### Setting environment variables
call "$(DevEnvDir)..\Tools\vsvars32.bat"
nmake' + RootNamespace = "Mvp.Xml.Exslt" + RunPostBuildEvent = "OnBuildSuccess" + StartupObject = "" + > + <Config + Name = "Debug" + AllowUnsafeBlocks = "false" + BaseAddress = "285212672" + CheckForOverflowUnderflow = "false" + ConfigurationOverrideFile = "" + DefineConstants = "DEBUG;TRACE;NET11" + DocumentationFile = "" + DebugSymbols = "true" + FileAlignment = "4096" + IncrementalBuild = "true" + NoStdLib = "false" + NoWarn = "" + Optimize = "false" + OutputPath = ".\" + RegisterForComInterop = "false" + RemoveIntegerChecks = "false" + TreatWarningsAsErrors = "false" + WarningLevel = "4" + /> + <Config + Name = "Release" + AllowUnsafeBlocks = "false" + BaseAddress = "285212672" + CheckForOverflowUnderflow = "false" + ConfigurationOverrideFile = "" + DefineConstants = "TRACE;NET11" + DocumentationFile = "" + DebugSymbols = "false" + FileAlignment = "4096" + IncrementalBuild = "false" + NoStdLib = "false" + NoWarn = "" + Optimize = "true" + OutputPath = ".\" + RegisterForComInterop = "false" + RemoveIntegerChecks = "false" + TreatWarningsAsErrors = "false" + WarningLevel = "4" + /> + </Settings> + <References> + <Reference + Name = "System" + AssemblyName = "System" + HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll" + /> + <Reference + Name = "System.Data" + AssemblyName = "System.Data" + HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll" + /> + <Reference + Name = "System.XML" + AssemblyName = "System.Xml" + HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll" + /> + <Reference + Name = "System.Drawing" + AssemblyName = "System.Drawing" + HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Drawing.dll" + /> + <Reference + Name = "System.Windows.Forms" + AssemblyName = "System.Windows.Forms" + HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Windows.Forms.dll" + /> + <Reference + Name = "System.Web" + AssemblyName = "System.Web" + HintPath = "C:\WINNT\Microsoft.NET\Framework\v1.0.3705\System.Web.dll" + /> + </References> + </Build> + <Files> + <Include> + <File + RelPath = "AssemblyInfo.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ExsltCommon.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ExsltContext.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ExsltContextFunction.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ExsltDatesAndTimes.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ExsltMath.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ExsltNamespaces.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ExsltNodeList.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ExsltRandom.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ExsltRegularExpressions.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ExsltSets.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ExsltStrings.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ExsltTransform.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "GDNDatesAndTimes.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "GDNDynamic.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "GDNMath.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "GDNRegularExpressions.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "GDNSets.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "GDNStrings.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Makefile" + BuildAction = "Content" + /> + <File + RelPath = "MultiOutput\MultiXmlTextWriter.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "MultiOutput\OutputState.cs" + SubType = "Code" + BuildAction = "Compile" + /> + </Include> + </Files> + </CSHARP> +</VisualStudioProject> + Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v1/src/Exslt/AssemblyInfo.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AssemblyInfo.cs 15 Oct 2005 21:24:17 -0000 1.2 +++ AssemblyInfo.cs 22 Oct 2005 21:18:07 -0000 1.3 @@ -32,7 +32,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("2.0.*")] +[assembly: AssemblyVersion("1.3.*")] // // In order to sign your assembly you must specify a key to use. Refer to the Index: ExsltTransform.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v1/src/Exslt/ExsltTransform.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ExsltTransform.cs 15 Oct 2005 22:11:16 -0000 1.4 +++ ExsltTransform.cs 22 Oct 2005 21:18:07 -0000 1.5 @@ -73,13 +73,18 @@ /// <summary> /// The XslTransform object wrapped by this class. /// </summary> - private XslCompiledTransform xslTransform; + private XslTransform xslTransform; /// <summary> /// Bitwise enumeration used to specify which EXSLT functions should be accessible to /// the ExsltTransform object. The default value is ExsltFunctionNamespace.All /// </summary> - private ExsltFunctionNamespace _supportedFunctions = ExsltFunctionNamespace.All; + private ExsltFunctionNamespace _supportedFunctions = ExsltFunctionNamespace.All; + + /// <summary> + /// Extension object which implements the functions in the http://exslt.org/common namespace + /// </summary> + private ExsltCommon exsltCommon = new ExsltCommon(); /// <summary> /// Extension object which implements the functions in the http://exslt.org/math namespace @@ -189,7 +194,7 @@ /// Constructor initializes class. /// </summary> public ExsltTransform(){ - this.xslTransform = new XslCompiledTransform(); + this.xslTransform = new XslTransform(); } #endregion Index: ExsltContext.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v1/src/Exslt/ExsltContext.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ExsltContext.cs 15 Oct 2005 22:11:16 -0000 1.3 +++ ExsltContext.cs 22 Oct 2005 21:18:07 -0000 1.4 @@ -24,7 +24,12 @@ /// Bitwise enumeration used to specify which EXSLT functions should be accessible to /// in the ExsltContext object. The default value is ExsltFunctionNamespace.All /// </summary> - private ExsltFunctionNamespace _supportedFunctions = ExsltFunctionNamespace.All; + private ExsltFunctionNamespace _supportedFunctions = ExsltFunctionNamespace.All; + + /// <summary> + /// Extension object which implements the functions in the http://exslt.org/common namespace + /// </summary> + private ExsltCommon exsltCommon = new ExsltCommon(); /// <summary> /// Extension object which implements the functions in the http://exslt.org/math namespace @@ -102,63 +107,68 @@ } #endregion - - #region Private methods - private void AddExtensionNamespaces() - { - //remove all our extension objects in case the ExsltContext is being reused - RemoveNamespace("math", ExsltNamespaces.Math); - RemoveNamespace("date", ExsltNamespaces.DatesAndTimes); - RemoveNamespace("regexp", ExsltNamespaces.RegularExpressions); + + private void AddExtensionNamespaces() { + //remove all our extension objects in case the ExsltContext is being reused + RemoveNamespace("exsl", ExsltNamespaces.Common); + RemoveNamespace("math", ExsltNamespaces.Math); + RemoveNamespace("date", ExsltNamespaces.DatesAndTimes); + RemoveNamespace("regexp", ExsltNamespaces.RegularExpressions); RemoveNamespace("str", ExsltNamespaces.Strings); - RemoveNamespace("set", ExsltNamespaces.Sets); - RemoveNamespace("random", ExsltNamespaces.Random); + RemoveNamespace("set", ExsltNamespaces.Sets); + RemoveNamespace("random", ExsltNamespaces.Random); RemoveNamespace("date2", ExsltNamespaces.GDNDatesAndTimes); RemoveNamespace("math2", ExsltNamespaces.GDNMath); RemoveNamespace("regexp2", ExsltNamespaces.GDNRegularExpressions); RemoveNamespace("set2", ExsltNamespaces.GDNSets); RemoveNamespace("str2", ExsltNamespaces.GDNStrings); RemoveNamespace("dyn2", ExsltNamespaces.GDNDynamic); + + //add extension objects as specified by SupportedFunctions + if((this.SupportedFunctions & ExsltFunctionNamespace.Common) > 0) + AddNamespace("exsl", ExsltNamespaces.Common); - //add extension objects as specified by SupportedFunctions - if ((this.SupportedFunctions & ExsltFunctionNamespace.Math) > 0) + if((this.SupportedFunctions & ExsltFunctionNamespace.Math) > 0) AddNamespace("math", ExsltNamespaces.Math); - if ((this.SupportedFunctions & ExsltFunctionNamespace.DatesAndTimes) > 0) + if((this.SupportedFunctions & ExsltFunctionNamespace.DatesAndTimes) > 0) AddNamespace("date", ExsltNamespaces.DatesAndTimes); - if ((this.SupportedFunctions & ExsltFunctionNamespace.RegularExpressions) > 0) + if((this.SupportedFunctions & ExsltFunctionNamespace.RegularExpressions) > 0) AddNamespace("regexp", ExsltNamespaces.RegularExpressions); - if ((this.SupportedFunctions & ExsltFunctionNamespace.Strings) > 0) + if((this.SupportedFunctions & ExsltFunctionNamespace.Strings) > 0) AddNamespace("str", ExsltNamespaces.Strings); - if ((this.SupportedFunctions & ExsltFunctionNamespace.Sets) > 0) + if((this.SupportedFunctions & ExsltFunctionNamespace.Sets) > 0) AddNamespace("set", ExsltNamespaces.Sets); - if ((this.SupportedFunctions & ExsltFunctionNamespace.Random) > 0) + if((this.SupportedFunctions & ExsltFunctionNamespace.Random) > 0) AddNamespace("random", ExsltNamespaces.Random); - - if ((this.SupportedFunctions & ExsltFunctionNamespace.GDNDatesAndTimes) > 0) + + if((this.SupportedFunctions & ExsltFunctionNamespace.GDNDatesAndTimes) > 0) AddNamespace("date2", ExsltNamespaces.GDNDatesAndTimes); - - if ((this.SupportedFunctions & ExsltFunctionNamespace.GDNMath) > 0) + + if((this.SupportedFunctions & ExsltFunctionNamespace.GDNMath) > 0) AddNamespace("math2", ExsltNamespaces.GDNMath); - - if ((this.SupportedFunctions & ExsltFunctionNamespace.GDNRegularExpressions) > 0) + + if((this.SupportedFunctions & ExsltFunctionNamespace.GDNRegularExpressions) > 0) AddNamespace("regexp2", ExsltNamespaces.GDNRegularExpressions); - - if ((this.SupportedFunctions & ExsltFunctionNamespace.GDNSets) > 0) + + if((this.SupportedFunctions & ExsltFunctionNamespace.GDNSets) > 0) AddNamespace("set2", ExsltNamespaces.GDNSets); + + if((this.SupportedFunctions & ExsltFunctionNamespace.GDNStrings) > 0) + AddNamespace("str2", ExsltNamespaces.GDNStrings); - if ((this.SupportedFunctions & ExsltFunctionNamespace.GDNStrings) > 0) - AddNamespace("str2", ExsltNamespaces.GDNStrings); - - if ((this.SupportedFunctions & ExsltFunctionNamespace.GDNDynamic) > 0) - AddNamespace("dyn2", ExsltNamespaces.GDNDynamic); - } - #endregion - + if((this.SupportedFunctions & ExsltFunctionNamespace.GDNDynamic) > 0) + AddNamespace("dyn2", ExsltNamespaces.GDNDynamic); + } + + public override int CompareDocument(string baseUri, string nextbaseUri) { + return 0; + } + #region Public Properties /// <summary> /// Bitwise enumeration used to specify which EXSLT functions should be accessible to @@ -172,78 +182,69 @@ get { return _supportedFunctions; } } #endregion - - #region XsltContext Overrides - public override int CompareDocument(string baseUri, string nextbaseUri) - { - return 0; - } - - public override bool PreserveWhitespace(XPathNavigator node) - { - return true; - } - - public override bool Whitespace - { - get { return true; } - } - - /// <summary> - /// Resolves variables. - /// </summary> - /// <param name="prefix">The variable's prefix</param> - /// <param name="name">The variable's name</param> - /// <returns></returns> - public override IXsltContextVariable ResolveVariable(string prefix, string name) - { - return null; - } - - /// <summary> - /// Resolves custom function in XPath expression. - /// </summary> - /// <param name="prefix">The prefix of the function as it appears in the XPath expression.</param> - /// <param name="name">The name of the function.</param> - /// <param name="argTypes">An array of argument types for the function being resolved. - /// This allows you to select between methods with the same name (for example, overloaded - /// methods). </param> + + + public override bool PreserveWhitespace(XPathNavigator node) { + return true; + } + + public override bool Whitespace { + get { return true; } + } + + /// <summary> + /// Resolves variables. + /// </summary> + /// <param name="prefix">The variable's prefix</param> + /// <param name="name">The variable's name</param> + /// <returns></returns> + public override IXsltContextVariable ResolveVariable(string prefix, string name) { + return null; + } + + /// <summary> + /// Resolves custom function in XPath expression. + /// </summary> + /// <param name="prefix">The prefix of the function as it appears in the XPath expression.</param> + /// <param name="name">The name of the function.</param> + /// <param name="argTypes">An array of argument types for the function being resolved. + /// This allows you to select between methods with the same name (for example, overloaded + /// methods). </param> /// <returns>An IXsltContextFunction representing the function.</returns> - public override IXsltContextFunction ResolveFunction(string prefix, string name, - XPathResultType[] argTypes) - { - switch (LookupNamespace(_nt.Get(prefix))) - { - case ExsltNamespaces.DatesAndTimes: - return GetExtensionFunctionImplementation(exsltDatesAndTimes, name, argTypes); - case ExsltNamespaces.Math: - return GetExtensionFunctionImplementation(exsltMath, name, argTypes); - case ExsltNamespaces.RegularExpressions: - return GetExtensionFunctionImplementation(exsltRegularExpressions, name, argTypes); - case ExsltNamespaces.Sets: - return GetExtensionFunctionImplementation(exsltSets, name, argTypes); - case ExsltNamespaces.Strings: - return GetExtensionFunctionImplementation(exsltStrings, name, argTypes); - case ExsltNamespaces.Random: - return GetExtensionFunctionImplementation(exsltRandom, name, argTypes); + public override IXsltContextFunction ResolveFunction(string prefix, string name, + XPathResultType[] argTypes) { + switch (LookupNamespace(_nt.Get(prefix))) { + case ExsltNamespaces.Common: + return GetExtensionFunctionImplementation(exsltCommon, name, argTypes); + case ExsltNamespaces.DatesAndTimes: + return GetExtensionFunctionImplementation(exsltDatesAndTimes, name, argTypes); + case ExsltNamespaces.Math: + return GetExtensionFunctionImplementation(exsltMath, name, argTypes); + case ExsltNamespaces.RegularExpressions: + return GetExtensionFunctionImplementation(exsltRegularExpressions, name, argTypes); + case ExsltNamespaces.Sets: + return GetExtensionFunctionImplementation(exsltSets, name, argTypes); + case ExsltNamespaces.Strings: + return GetExtensionFunctionImplementation(exsltStrings, name, argTypes); + case ExsltNamespaces.Random: + return GetExtensionFunctionImplementation(exsltRandom, name, argTypes); case ExsltNamespaces.GDNDatesAndTimes: - return GetExtensionFunctionImplementation(gdnDatesAndTimes, name, argTypes); - case ExsltNamespaces.GDNMath: - return GetExtensionFunctionImplementation(gdnMath, name, argTypes); - case ExsltNamespaces.GDNRegularExpressions: - return GetExtensionFunctionImplementation(gdnRegularExpressions, name, argTypes); - case ExsltNamespaces.GDNSets: - return GetExtensionFunctionImplementation(gdnSets, name, argTypes); - case ExsltNamespaces.GDNStrings: - return GetExtensionFunctionImplementation(gdnStrings, name, argTypes); - case ExsltNamespaces.GDNDynamic: - return GetExtensionFunctionImplementation(gdnDynamic, name, argTypes); - default: - throw new XPathException(string.Format("Unrecognized extension function namespace: prefix='{0}', namespace URI='{1}'", - prefix, LookupNamespace(_nt.Get(prefix))), null); - } - } - #endregion + return GetExtensionFunctionImplementation(gdnDatesAndTimes, name, argTypes); + case ExsltNamespaces.GDNMath: + return GetExtensionFunctionImplementation(gdnMath, name, argTypes); + case ExsltNamespaces.GDNRegularExpressions: + return GetExtensionFunctionImplementation(gdnRegularExpressions, name, argTypes); + case ExsltNamespaces.GDNSets: + return GetExtensionFunctionImplementation(gdnSets, name, argTypes); + case ExsltNamespaces.GDNStrings: + return GetExtensionFunctionImplementation(gdnStrings, name, argTypes); + case ExsltNamespaces.GDNDynamic: + return GetExtensionFunctionImplementation(gdnDynamic, name, argTypes); + default: + throw new XPathException(string.Format("Unrecognized extension function namespace: prefix='{0}', namespace URI='{1}'", + prefix, LookupNamespace(_nt.Get(prefix))), null); + } + } /// <summary> /// Finds appropriate implementation for an extension function - public Index: ExsltSets.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v1/src/Exslt/ExsltSets.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ExsltSets.cs 15 Oct 2005 21:24:17 -0000 1.3 +++ ExsltSets.cs 22 Oct 2005 21:18:07 -0000 1.4 @@ -47,7 +47,7 @@ } } - return nodelist1; + return ExsltCommon.ExsltNodeListToXPathNodeIterator(nodelist1); } /// <summary> /// Implements an optimized algorithm for the following function |