You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(174) |
Nov
(85) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(56) |
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
(1) |
Jul
(132) |
Aug
(5) |
Sep
|
Oct
(314) |
Nov
(133) |
Dec
(18) |
2006 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Oleg T. <he...@us...> - 2005-10-30 13:56:07
|
Update of /cvsroot/mvp-xml/Global/v2/Common/Serialization In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28473/v2/Common/Serialization Added Files: .cvsignore Log Message: --- NEW FILE: .cvsignore --- bin obj *.user *.suo |
From: Oleg T. <he...@us...> - 2005-10-30 13:56:05
|
Update of /cvsroot/mvp-xml/Global/v2/Common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28473/v2/Common Added Files: .cvsignore Log Message: --- NEW FILE: .cvsignore --- bin obj *.user *.suo |
From: Oleg T. <he...@us...> - 2005-10-30 13:56:04
|
Update of /cvsroot/mvp-xml/Global/v2/Common/XPath In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28473/v2/Common/XPath Added Files: .cvsignore Log Message: --- NEW FILE: .cvsignore --- bin obj *.user *.suo |
From: Oleg T. <he...@us...> - 2005-10-30 13:56:04
|
Update of /cvsroot/mvp-xml/Global/v2/XPointer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28473/v2/XPointer Added Files: .cvsignore Log Message: --- NEW FILE: .cvsignore --- bin obj *.user *.suo |
From: Oleg T. <he...@us...> - 2005-10-30 13:54:12
|
Update of /cvsroot/mvp-xml/Global/v2/EXSLT/MultiOutput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27772/MultiOutput Log Message: Directory /cvsroot/mvp-xml/Global/v2/EXSLT/MultiOutput added to the repository |
From: Oleg T. <he...@us...> - 2005-10-30 13:53:40
|
Update of /cvsroot/mvp-xml/Global/v2/Common/XPath In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27539/XPath Log Message: Directory /cvsroot/mvp-xml/Global/v2/Common/XPath added to the repository |
From: Oleg T. <he...@us...> - 2005-10-30 13:53:40
|
Update of /cvsroot/mvp-xml/Global/v2/Common/Serialization In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27539/Serialization Log Message: Directory /cvsroot/mvp-xml/Global/v2/Common/Serialization added to the repository |
From: Oleg T. <he...@us...> - 2005-10-30 13:53:28
|
Update of /cvsroot/mvp-xml/Global/v2/Properties In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27473/Properties Log Message: Directory /cvsroot/mvp-xml/Global/v2/Properties added to the repository |
From: Oleg T. <he...@us...> - 2005-10-30 13:53:27
|
Update of /cvsroot/mvp-xml/Global/v2/EXSLT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27473/EXSLT Log Message: Directory /cvsroot/mvp-xml/Global/v2/EXSLT added to the repository |
From: Oleg T. <he...@us...> - 2005-10-30 13:53:27
|
Update of /cvsroot/mvp-xml/Global/v2/XInclude In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27473/XInclude Log Message: Directory /cvsroot/mvp-xml/Global/v2/XInclude added to the repository |
From: Oleg T. <he...@us...> - 2005-10-30 13:53:27
|
Update of /cvsroot/mvp-xml/Global/v2/XPointer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27473/XPointer Log Message: Directory /cvsroot/mvp-xml/Global/v2/XPointer added to the repository |
From: Oleg T. <he...@us...> - 2005-10-30 13:53:27
|
Update of /cvsroot/mvp-xml/Global/v2/Common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27473/Common Log Message: Directory /cvsroot/mvp-xml/Global/v2/Common added to the repository |
From: Oleg T. <he...@us...> - 2005-10-30 13:52:55
|
Update of /cvsroot/mvp-xml/Global/v2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27345/v2 Log Message: Directory /cvsroot/mvp-xml/Global/v2 added to the repository |
From: Oleg T. <he...@us...> - 2005-10-30 13:51:13
|
Update of /cvsroot/mvp-xml/XPointer/v1/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27116/v1/test Modified Files: XPointerTest.csproj Log Message: Index: XPointerTest.csproj =================================================================== RCS file: /cvsroot/mvp-xml/XPointer/v1/test/XPointerTest.csproj,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- XPointerTest.csproj 28 May 2005 20:15:04 -0000 1.5 +++ XPointerTest.csproj 30 Oct 2005 13:51:05 -0000 1.6 @@ -126,10 +126,6 @@ BuildAction = "None" /> <File - RelPath = "pubs.xml" - BuildAction = "EmbeddedResource" - /> - <File RelPath = "pubsNS.xml" BuildAction = "Content" /> |
From: Oleg T. <he...@us...> - 2005-10-30 13:51:13
|
Update of /cvsroot/mvp-xml/XPointer/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27116/v1/src Modified Files: AssemblyInfo.cs Log Message: Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/mvp-xml/XPointer/v1/src/AssemblyInfo.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- AssemblyInfo.cs 15 Jan 2005 14:44:34 -0000 1.3 +++ AssemblyInfo.cs 30 Oct 2005 13:51:05 -0000 1.4 @@ -12,7 +12,7 @@ [assembly: AssemblyVersion("1.3.*")] [assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("../../../../../Global/v1/mvp-xml.snk")] +[assembly: AssemblyKeyFile("../../../../../Global/mvp-xml.snk")] [assembly: AssemblyKeyName("")] #region Security Permissions |
Update of /cvsroot/mvp-xml/EXSLT/v2/src/Exslt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27047/v2/src/Exslt Modified Files: Exslt.csproj ExsltContext.cs ExsltDatesAndTimes.cs ExsltMath.cs ExsltNamespaces.cs ExsltStrings.cs ExsltTransform.cs Makefile Log Message: Index: ExsltNamespaces.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/src/Exslt/ExsltNamespaces.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ExsltNamespaces.cs 29 Oct 2005 21:14:35 -0000 1.2 +++ ExsltNamespaces.cs 30 Oct 2005 13:50:54 -0000 1.3 @@ -2,18 +2,30 @@ /// <summary> /// Exslt (and other) namespaces constants. /// </summary> - public static class ExsltNamespaces { + public static class ExsltNamespaces { + /// <summary>EXSLT Dates and Times module namespace</summary> public const string DatesAndTimes = "http://exslt.org/dates-and-times"; + /// <summary>EXSLT Math module namespace</summary> public const string Math = "http://exslt.org/math"; + /// <summary>EXSLT Random module namespace</summary> public const string Random = "http://exslt.org/random"; + /// <summary>EXSLT Regexp module namespace</summary> public const string RegularExpressions = "http://exslt.org/regular-expressions"; + /// <summary>EXSLT Sets module namespace</summary> public const string Sets = "http://exslt.org/sets"; + /// <summary>EXSLT Strings module namespace</summary> public const string Strings = "http://exslt.org/strings"; + /// <summary>GotDotNet Dates and Times module namespace</summary> public const string GDNDatesAndTimes = "http://gotdotnet.com/exslt/dates-and-times"; + /// <summary>GotDotNet Math module namespace</summary> public const string GDNMath = "http://gotdotnet.com/exslt/math"; + /// <summary>GotDotNet Regexp module namespace</summary> public const string GDNRegularExpressions = "http://gotdotnet.com/exslt/regular-expressions"; + /// <summary>GotDotNet Sets module namespace</summary> public const string GDNSets = "http://gotdotnet.com/exslt/sets"; + /// <summary>GotDotNet Strings module namespace</summary> public const string GDNStrings = "http://gotdotnet.com/exslt/strings"; + /// <summary>GotDotNet Dynamic module namespace</summary> public const string GDNDynamic = "http://gotdotnet.com/exslt/dynamic"; } } \ No newline at end of file Index: ExsltMath.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/src/Exslt/ExsltMath.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ExsltMath.cs 29 Oct 2005 21:14:35 -0000 1.2 +++ ExsltMath.cs 30 Oct 2005 13:50:54 -0000 1.3 @@ -236,8 +236,7 @@ /// <summary> /// Implements the following function /// number constant(string, number) - /// </summary> - /// <param name="number"></param> + /// </summary> /// <returns>The specified constant or NaN</returns> /// <remarks>This method only supports the constants /// E and PI. Also the precision parameter is ignored.</remarks> @@ -267,8 +266,7 @@ /// <summary> /// Implements the following function /// number random() - /// </summary> - /// <param name="x"></param> + /// </summary> /// <returns></returns> public double random() { Index: ExsltStrings.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/src/Exslt/ExsltStrings.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ExsltStrings.cs 16 Oct 2005 20:07:08 -0000 1.1 +++ ExsltStrings.cs 30 Oct 2005 13:50:54 -0000 1.2 @@ -1,302 +1,316 @@ #region Using using System; -using System.Xml.XPath; +using System.Xml.XPath; using System.Xml; using System.Text; using System.Text.RegularExpressions; using System.Web; #endregion -namespace Mvp.Xml.Exslt +namespace Mvp.Xml.Exslt { - /// <summary> - /// Implements the functions in the http://exslt.org/strings namespace - /// </summary> - public class ExsltStrings { - private readonly static char[] hexdigit = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; + /// <summary> + /// Implements the functions in the http://exslt.org/strings namespace + /// </summary> + public class ExsltStrings + { + private readonly static char[] hexdigit = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; #region tokenize() - /// <summary> - /// Implements the following function - /// node-set tokenize(string, string) - /// </summary> - /// <param name="str"></param> - /// <param name="delimiters"></param> - /// <param name="flags"></param> - /// <returns>This function breaks the input string into a sequence of strings, - /// treating any character in the list of delimiters as a separator. - /// The separators themselves are not returned. - /// The tokens are returned as a set of 'token' elements.</returns> - public XPathNodeIterator tokenize(string str, string delimiters) - { + /// <summary> + /// Implements the following function + /// node-set tokenize(string, string) + /// </summary> + /// <param name="str"></param> + /// <param name="delimiters"></param> + /// <returns>This function breaks the input string into a sequence of strings, + /// treating any character in the list of delimiters as a separator. + /// The separators themselves are not returned. + /// The tokens are returned as a set of 'token' elements.</returns> + public XPathNodeIterator tokenize(string str, string delimiters) + { - XmlDocument doc = new XmlDocument(); - doc.LoadXml("<tokens/>"); - - if (delimiters == String.Empty) + XmlDocument doc = new XmlDocument(); + doc.LoadXml("<tokens/>"); + + if (delimiters == String.Empty) { - foreach (char c in str) + foreach (char c in str) { - XmlElement elem = doc.CreateElement("token"); - elem.InnerText = c.ToString(); - doc.DocumentElement.AppendChild(elem); + XmlElement elem = doc.CreateElement("token"); + elem.InnerText = c.ToString(); + doc.DocumentElement.AppendChild(elem); } - } - else - { - foreach(string token in str.Split(delimiters.ToCharArray())) + } + else + { + foreach (string token in str.Split(delimiters.ToCharArray())) { - - XmlElement elem = doc.CreateElement("token"); - elem.InnerText = token; - doc.DocumentElement.AppendChild(elem); + + XmlElement elem = doc.CreateElement("token"); + elem.InnerText = token; + doc.DocumentElement.AppendChild(elem); } } - return doc.CreateNavigator().Select("//token"); - } + return doc.CreateNavigator().Select("//token"); + } - /// <summary> - /// Implements the following function - /// node-set tokenize(string) - /// </summary> - /// <param name="str"></param> - /// <param name="delimiters"></param> - /// <param name="flags"></param> - /// <returns>This function breaks the input string into a sequence of strings, - /// using the whitespace characters as a delimiter. - /// The separators themselves are not returned. - /// The tokens are returned as a set of 'token' elements.</returns> - public XPathNodeIterator tokenize(string str){ + /// <summary> + /// Implements the following function + /// node-set tokenize(string) + /// </summary> + /// <param name="str"></param> + /// <returns>This function breaks the input string into a sequence of strings, + /// using the whitespace characters as a delimiter. + /// The separators themselves are not returned. + /// The tokens are returned as a set of 'token' elements.</returns> + public XPathNodeIterator tokenize(string str) + { - Regex regex = new Regex("\\s+"); + Regex regex = new Regex("\\s+"); - XmlDocument doc = new XmlDocument(); - doc.LoadXml("<tokens/>"); - - foreach(string token in regex.Split(str)){ - - XmlElement elem = doc.CreateElement("token"); - elem.InnerText = token; - doc.DocumentElement.AppendChild(elem); - } + XmlDocument doc = new XmlDocument(); + doc.LoadXml("<tokens/>"); - return doc.CreateNavigator().Select("//token"); - } + foreach (string token in regex.Split(str)) + { + + XmlElement elem = doc.CreateElement("token"); + elem.InnerText = token; + doc.DocumentElement.AppendChild(elem); + } + + return doc.CreateNavigator().Select("//token"); + } #endregion #region replace() -/// <summary> -/// Implements the following function -/// string replace(string, string, string) -/// </summary> -/// <param name="str"></param> -/// <param name="oldValue"></param> -/// <param name="newValue"></param> -/// <returns></returns> -/// <remarks>This function has completely diffeerent semantics from the EXSLT function. -/// The description of the EXSLT function is confusing and furthermore no one has implemented -/// the described semantics which implies that others find the method problematic. Instead -/// this function is straightforward, it replaces all occurrences of oldValue with -/// newValue</remarks> - public string replace(string str, string oldValue, string newValue) + /// <summary> + /// Implements the following function + /// string replace(string, string, string) + /// </summary> + /// <param name="str"></param> + /// <param name="oldValue"></param> + /// <param name="newValue"></param> + /// <returns></returns> + /// <remarks>This function has completely diffeerent semantics from the EXSLT function. + /// The description of the EXSLT function is confusing and furthermore no one has implemented + /// the described semantics which implies that others find the method problematic. Instead + /// this function is straightforward, it replaces all occurrences of oldValue with + /// newValue</remarks> + public string replace(string str, string oldValue, string newValue) { - return str.Replace(oldValue, newValue); - } + return str.Replace(oldValue, newValue); + } #endregion #region padding() -/// <summary> -/// Implements the following function -/// string padding(number) -/// </summary> -/// <param name="number"></param> -/// <returns></returns> - public string padding(int number) { - string s = String.Empty; - - if(number < 0){ - return s; - }else{ - return s.PadLeft(number); - } - } - - /// <summary> - /// Implements the following function - /// string padding(number, string) - /// </summary> - /// <param name="number"></param> - /// <returns></returns> - public string padding(int number, string s) - { + /// <summary> + /// Implements the following function + /// string padding(number) + /// </summary> + /// <param name="number"></param> + /// <returns></returns> + public string padding(int number) + { + string s = String.Empty; - if(number < 0 || s == string.Empty) - { - return String.Empty; - } - else - { - StringBuilder sb = new StringBuilder(s); - - while(sb.Length < number) - { - sb.Append(s); + if (number < 0) + { + return s; + } + else + { + return s.PadLeft(number); + } } - if(sb.Length > number) - { - return sb.Remove(number, sb.Length - number).ToString(); - } - else + /// <summary> + /// Implements the following function + /// string padding(number, string) + /// </summary> + public string padding(int number, string s) { - return sb.ToString(); + + if (number < 0 || s == string.Empty) + { + return String.Empty; + } + else + { + StringBuilder sb = new StringBuilder(s); + + while (sb.Length < number) + { + sb.Append(s); + } + + if (sb.Length > number) + { + return sb.Remove(number, sb.Length - number).ToString(); + } + else + { + return sb.ToString(); + } + } } - } - } #endregion #region split() - /// <summary> - /// Implements the following function - /// node-set split(string) - /// </summary> - /// <param name="str"></param> - /// <remarks>This function breaks the input string into a sequence of strings, - /// using the space character as a delimiter. - /// The space character itself is never returned not even when there are - /// adjacent space characters. - /// </remarks> - /// <returns>The tokens are returned as a set of 'token' elements</returns> - public XPathNodeIterator split(string str) + /// <summary> + /// Implements the following function + /// node-set split(string) + /// </summary> + /// <param name="str"></param> + /// <remarks>This function breaks the input string into a sequence of strings, + /// using the space character as a delimiter. + /// The space character itself is never returned not even when there are + /// adjacent space characters. + /// </remarks> + /// <returns>The tokens are returned as a set of 'token' elements</returns> + public XPathNodeIterator split(string str) { - - XmlDocument doc = new XmlDocument(); - doc.LoadXml("<tokens/>"); - - foreach(string match in str.Split(new char[]{' '})){ - - if(!match.Equals(String.Empty)){ - XmlElement elem = doc.CreateElement("token"); - elem.InnerText = match; - doc.DocumentElement.AppendChild(elem); - } - } + XmlDocument doc = new XmlDocument(); + doc.LoadXml("<tokens/>"); - return doc.CreateNavigator().Select("//token"); - } + foreach (string match in str.Split(new char[] { ' ' })) + { - /// <summary> - /// Implements the following function - /// node-set split(string, string) - /// </summary> - /// <param name="str"></param> - /// <param name="delimiter"></param> - /// <remarks>This function breaks the input string into a sequence of strings, - /// using the space character as a delimiter. - /// The space character itself is never returned not even when there are - /// adjacent space characters. - /// </remarks> - /// <returns>The tokens are returned as a set of 'token' elements</returns> - public XPathNodeIterator split(string str, string delimiter){ - - XmlDocument doc = new XmlDocument(); - doc.LoadXml("<tokens/>"); - + if (!match.Equals(String.Empty)) + { + XmlElement elem = doc.CreateElement("token"); + elem.InnerText = match; + doc.DocumentElement.AppendChild(elem); + } + } - if(delimiter.Equals(String.Empty)){ - foreach(char match in str){ - - XmlElement elem = doc.CreateElement("token"); - elem.InnerText = match.ToString(); - doc.DocumentElement.AppendChild(elem); - } - }else{ - //since there is no String.Split(string) method we use the Regex class - //and escape special characters. - //. $ ^ { [ ( | ) * + ? \ - delimiter = delimiter.Replace("\\","\\\\").Replace("$", "\\$").Replace("^", "\\^"); - delimiter = delimiter.Replace("{", "\\{").Replace("[", "\\[").Replace("(", "\\("); - delimiter = delimiter.Replace("*","\\*").Replace(")", "\\)").Replace("|", "\\|"); - delimiter = delimiter.Replace("+", @"\+").Replace("?", "\\?").Replace(".", "\\."); - - Regex regex = new Regex(delimiter); + return doc.CreateNavigator().Select("//token"); + } - foreach(string match in regex.Split(str)){ - - if((!match.Equals(String.Empty)) && (!match.Equals(delimiter))){ - XmlElement elem = doc.CreateElement("token"); - elem.InnerText = match; - doc.DocumentElement.AppendChild(elem); - } - } - } + /// <summary> + /// Implements the following function + /// node-set split(string, string) + /// </summary> + /// <param name="str"></param> + /// <param name="delimiter"></param> + /// <remarks>This function breaks the input string into a sequence of strings, + /// using the space character as a delimiter. + /// The space character itself is never returned not even when there are + /// adjacent space characters. + /// </remarks> + /// <returns>The tokens are returned as a set of 'token' elements</returns> + public XPathNodeIterator split(string str, string delimiter) + { - return doc.CreateNavigator().Select("//token"); - } + XmlDocument doc = new XmlDocument(); + doc.LoadXml("<tokens/>"); + + + if (delimiter.Equals(String.Empty)) + { + foreach (char match in str) + { + + XmlElement elem = doc.CreateElement("token"); + elem.InnerText = match.ToString(); + doc.DocumentElement.AppendChild(elem); + } + } + else + { + //since there is no String.Split(string) method we use the Regex class + //and escape special characters. + //. $ ^ { [ ( | ) * + ? \ + delimiter = delimiter.Replace("\\", "\\\\").Replace("$", "\\$").Replace("^", "\\^"); + delimiter = delimiter.Replace("{", "\\{").Replace("[", "\\[").Replace("(", "\\("); + delimiter = delimiter.Replace("*", "\\*").Replace(")", "\\)").Replace("|", "\\|"); + delimiter = delimiter.Replace("+", @"\+").Replace("?", "\\?").Replace(".", "\\."); + + Regex regex = new Regex(delimiter); + + + foreach (string match in regex.Split(str)) + { + + if ((!match.Equals(String.Empty)) && (!match.Equals(delimiter))) + { + XmlElement elem = doc.CreateElement("token"); + elem.InnerText = match; + doc.DocumentElement.AppendChild(elem); + } + } + } + + return doc.CreateNavigator().Select("//token"); + } #endregion #region concat() - /// <summary> - /// Implements the following function - /// string concat(node-set) - /// </summary> - /// <param name="nodeset"></param> - /// <returns></returns> - public string concat(XPathNodeIterator nodeset) + /// <summary> + /// Implements the following function + /// string concat(node-set) + /// </summary> + /// <param name="nodeset"></param> + /// <returns></returns> + public string concat(XPathNodeIterator nodeset) { - StringBuilder sb = new StringBuilder(); - - while(nodeset.MoveNext()){ - sb.Append(nodeset.Current.Value); - } + StringBuilder sb = new StringBuilder(); - return sb.ToString(); - } + while (nodeset.MoveNext()) + { + sb.Append(nodeset.Current.Value); + } + + return sb.ToString(); + } #endregion - + #region align() - /// <summary> - /// Implements the following function - /// string str:align(string, string, string) - /// </summary> - /// <param name="str">String to align</param> - /// <param name="padding">String, within which to align</param> - /// <param name="alignment">left/right/center</param> - /// <returns>Aligned string.</returns> - public string align(string str, string padding, string alignment) + /// <summary> + /// Implements the following function + /// string str:align(string, string, string) + /// </summary> + /// <param name="str">String to align</param> + /// <param name="padding">String, within which to align</param> + /// <param name="alignment">left/right/center</param> + /// <returns>Aligned string.</returns> + public string align(string str, string padding, string alignment) { - if (str.Length > padding.Length) - return str.Substring(0, padding.Length); - else if (str.Length == padding.Length) - return str; - else { - switch (alignment) { - case "right": - return padding.Substring(0, padding.Length - str.Length) + str; - case "center": - int space = (padding.Length - str.Length)/2; - return padding.Substring(0, space) + str + - padding.Substring(str.Length + space); - default: - //Align to left by default - return str + padding.Substring(str.Length); - } - } - } - + if (str.Length > padding.Length) + return str.Substring(0, padding.Length); + else if (str.Length == padding.Length) + return str; + else + { + switch (alignment) + { + case "right": + return padding.Substring(0, padding.Length - str.Length) + str; + case "center": + int space = (padding.Length - str.Length) / 2; + return padding.Substring(0, space) + str + + padding.Substring(str.Length + space); + default: + //Align to left by default + return str + padding.Substring(str.Length); + } + } + } + /// <summary> /// Implements the following function /// string str:align(string, string) @@ -304,9 +318,10 @@ /// <param name="str">String to align</param> /// <param name="padding">String, within which to align</param> /// <returns>Aligned to left string.</returns> - public string align(string str, string padding) { + public string align(string str, string padding) + { return align(str, padding, "left"); - } + } #endregion @@ -352,20 +367,20 @@ /// <param name="encoding">A character encoding to use</param> /// <returns>The encoded string</returns> public string encodeUri(string str, bool encodeReserved, string encoding) - { + { Encoding enc = null; - try + try { enc = Encoding.GetEncoding(encoding); - } - catch + } + catch { //Not supported encoding, return empty string return String.Empty; } return encodeUriImpl(str, encodeReserved, enc); } - + /// <summary> /// Implements the following function /// string str:encode-uri(string, string, string) @@ -373,31 +388,38 @@ /// <param name="str">String to encode</param> /// <param name="encodeReserved">If true, will encode even the /// [RFC 2396] and [RFC 2732] "reserved characters"</param> - /// <param name="encoding">A character encoding to use</param> + /// <param name="enc">A character encoding to use</param> /// <returns>The encoded string</returns> private string encodeUriImpl(string str, bool encodeReserved, Encoding enc) { if (str == string.Empty) - return str; + return str; StringBuilder res = new StringBuilder(str.Length); char[] chars = str.ToCharArray(); - if (encodeReserved) + if (encodeReserved) { - for (int i=0; i<chars.Length; i++) + for (int i = 0; i < chars.Length; i++) { char c = chars[i]; - if ((c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9')) + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')) res.Append(c); - else + else { - switch (c) + switch (c) { - case '-':case '_':case '.':case '!':case '~':case '*': - case '\'':case '(':case ')': + case '-': + case '_': + case '.': + case '!': + case '~': + case '*': + case '\'': + case '(': + case ')': res.Append(c); break; case '%': - if (i<chars.Length-2 && IsHexDigit(chars[i+1]) && IsHexDigit(chars[i+2])) + if (i < chars.Length - 2 && IsHexDigit(chars[i + 1]) && IsHexDigit(chars[i + 2])) res.Append(c); else EncodeChar(res, enc, chars, i); @@ -408,26 +430,43 @@ } } } - } - else + } + else { - for (int i=0; i<chars.Length; i++) + for (int i = 0; i < chars.Length; i++) { char c = chars[i]; - if ((c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9')) + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')) res.Append(c); - else + else { - switch (c) + switch (c) { - case '-':case '_':case '.':case '!':case '~':case '*': - case '\'':case '(':case ')':case ';':case '/':case '?': - case ':':case '@':case '&':case '=':case '+':case '$': - case ',':case '[':case ']': + case '-': + case '_': + case '.': + case '!': + case '~': + case '*': + case '\'': + case '(': + case ')': + case ';': + case '/': + case '?': + case ':': + case '@': + case '&': + case '=': + case '+': + case '$': + case ',': + case '[': + case ']': res.Append(c); break; case '%': - if (i<chars.Length-2 && IsHexDigit(chars[i+1]) && IsHexDigit(chars[i+2])) + if (i < chars.Length - 2 && IsHexDigit(chars[i + 1]) && IsHexDigit(chars[i + 2])) res.Append(c); else EncodeChar(res, enc, chars, i); @@ -439,19 +478,19 @@ } } - } + } return res.ToString(); } - private void EncodeChar(StringBuilder res, Encoding enc, char[] str, int index) + private void EncodeChar(StringBuilder res, Encoding enc, char[] str, int index) { foreach (byte b in enc.GetBytes(str, index, 1)) - res.AppendFormat("%{0}{1}", hexdigit[b>>4], hexdigit[b&15]); + res.AppendFormat("%{0}{1}", hexdigit[b >> 4], hexdigit[b & 15]); } - - private bool IsHexDigit(char c) + + private bool IsHexDigit(char c) { - return (c>='0' && c<='9') || (c>='a' && c<='f') || (c>='A' && c<='F'); + return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); } #endregion @@ -493,19 +532,19 @@ /// <param name="encoding">A character encoding to use</param> /// <returns>The decoded string</returns> public string decodeUri(string str, string encoding) - { + { if (encoding == String.Empty) return String.Empty; Encoding enc = null; - try + try { enc = Encoding.GetEncoding(encoding); - } - catch + } + catch { //Not supported encoding, return empty string - return String.Empty; - } + return String.Empty; + } return decodeUriImpl(str, enc); } @@ -514,14 +553,14 @@ /// string str:decode-uri(string, string) /// </summary> /// <param name="str">String to decode</param> - /// <param name="encoding">A character encoding to use</param> + /// <param name="enc">A character encoding to use</param> /// <returns>The decoded string</returns> private string decodeUriImpl(string str, Encoding enc) { if (str == string.Empty) - return str; - return HttpUtility.UrlDecode(str, enc); + return str; + return HttpUtility.UrlDecode(str, enc); } #endregion - } + } } \ No newline at end of file Index: Exslt.csproj =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/src/Exslt/Exslt.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Exslt.csproj 29 Oct 2005 21:14:35 -0000 1.2 +++ Exslt.csproj 30 Oct 2005 13:50:54 -0000 1.3 @@ -55,7 +55,7 @@ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> <ConfigurationOverrideFile> </ConfigurationOverrideFile> - <DefineConstants>TRACE;NET11</DefineConstants> + <DefineConstants>TRACE</DefineConstants> <DocumentationFile> </DocumentationFile> <DebugSymbols>false</DebugSymbols> Index: Makefile =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/src/Exslt/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 29 Oct 2005 21:14:35 -0000 1.2 +++ Makefile 30 Oct 2005 13:50:54 -0000 1.3 @@ -10,7 +10,7 @@ @echo ########### Renaming methods... MethodRenamer.exe Mvp.Xml.Exslt.il Mvp.Xml.Exslt.Fixed.il @echo ########### Assembling library back... - ilasm Mvp.Xml.Exslt.Fixed.il /RESOURCE=Mvp.Xml.Exslt.res /DLL /OUTPUT=Mvp.Xml.Exslt.dll /KEY=../../../../Global/v1/mvp-xml.snk + ilasm Mvp.Xml.Exslt.Fixed.il /RESOURCE=Mvp.Xml.Exslt.res /DLL /OUTPUT=Mvp.Xml.Exslt.dll /KEY=../../../../Global/mvp-xml.snk nmake clean clean: Index: ExsltDatesAndTimes.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/src/Exslt/ExsltDatesAndTimes.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ExsltDatesAndTimes.cs 29 Oct 2005 21:14:35 -0000 1.2 +++ ExsltDatesAndTimes.cs 30 Oct 2005 13:50:54 -0000 1.3 @@ -18,7 +18,7 @@ { private CultureInfo ci = new CultureInfo("en-US"); - internal protected class ExsltDateTimeFactory + private class ExsltDateTimeFactory { /// <summary> /// Parse a date and time for format-date() @@ -115,7 +115,7 @@ } } - internal protected abstract class ExsltDateTime + internal abstract class ExsltDateTime { public DateTime d; public TimeSpan ts = new TimeSpan(TimeSpan.MinValue.Ticks); @@ -287,7 +287,7 @@ protected abstract string outputFormat {get;} } - internal protected class DateTimeTZ : ExsltDateTime + internal class DateTimeTZ : ExsltDateTime { public DateTimeTZ() : base(){} public DateTimeTZ(string inS) : base(inS){} @@ -313,7 +313,7 @@ } - internal protected class DateTZ : ExsltDateTime + internal class DateTZ : ExsltDateTime { public DateTZ() : base(){} public DateTZ(string inS) : base(inS){} @@ -341,7 +341,7 @@ } } - internal protected class TimeTZ : ExsltDateTime + internal class TimeTZ : ExsltDateTime { public TimeTZ(string inS) : base(inS){} public TimeTZ() : base(){} @@ -368,7 +368,7 @@ } } - internal protected class YearMonth : ExsltDateTime + internal class YearMonth : ExsltDateTime { public YearMonth() : base(){} public YearMonth(string inS) : base(inS){} @@ -395,7 +395,7 @@ } } - internal protected class YearTZ : ExsltDateTime + internal class YearTZ : ExsltDateTime { public YearTZ() : base(){} public YearTZ(string inS) : base(inS){} @@ -423,7 +423,7 @@ } } - internal protected class Month : ExsltDateTime + internal class Month : ExsltDateTime { public Month() : base(){} public Month(string inS) : base(inS){} @@ -451,7 +451,7 @@ } } - internal protected class Day : ExsltDateTime + internal class Day : ExsltDateTime { public Day() : base(){} public Day(string inS) : base(inS){} @@ -479,7 +479,7 @@ } } - internal protected class MonthDay : ExsltDateTime + internal class MonthDay : ExsltDateTime { public MonthDay() : base(){} public MonthDay(string inS) : base(inS){} @@ -582,7 +582,7 @@ /// </summary> /// <returns>The formtted date and time as a ISO8601 string</returns> - protected string dateTimeImpl(DateTimeTZ dtz) + internal string dateTimeImpl(DateTimeTZ dtz) { return dtz.ToString(); } @@ -1007,7 +1007,7 @@ /// number date:day-in-week(string) /// </summary> /// <returns>The day in the week of the specified date or NaN if the - /// date is invalid. <returns>The current day in the week. 1=Sunday, 2=Monday,...,7=Saturday + /// date is invalid. The current day in the week. 1=Sunday, 2=Monday,...,7=Saturday /// </returns> public double dayInWeek(string d){ try @@ -1359,7 +1359,11 @@ { return dayAbbreviation((int)DateTime.Now.DayOfWeek); } - + + /// <summary> + /// This wrapper method will be renamed during custom build + /// to provide conformant EXSLT function name. + /// </summary> public string dayAbbreviation_RENAME_ME() { return dayAbbreviation(); @@ -1510,7 +1514,7 @@ /// Implements the following function /// string date:format-date(string, string) /// </summary> - /// <param name="date">The date to format</param> + /// <param name="d">The date to format</param> /// <param name="format">One of the format strings understood by the /// Java 1.1 SimpleDateFormat method: /// @@ -1518,7 +1522,7 @@ ///------ ------- ------------ ------- ///G era designator (Text) AD ///y year (Number) 1996 - ///M month in year (Text & Number) July & 07 + ///M month in year (Text & Number) July & 07 ///d day in month (Number) 10 ///h hour in am/pm (1~12) (Number) 12 ///H hour in day (0~23) (Number) 0 @@ -1825,7 +1829,7 @@ /// string date:parse-date(string, string) /// BUGBUG: should use Java formatting strings, not Windows. /// </summary> - /// <param name="date">The date to parse</param> + /// <param name="d">The date to parse</param> /// <param name="format">One of the format strings understood by the /// DateTime.ToString(string) method.</param> /// <returns>The parsed date</returns> @@ -2042,8 +2046,8 @@ /// Implements the following function /// string:date:add-duration(string, string) /// </summary> - /// <param name="datetime">A date/time</param> - /// <param name="duration">the duration to add</param> + /// <param name="duration1">Initial duration</param> + /// <param name="duration2">the duration to add</param> /// <returns>The new time</returns> public string addDuration(string duration1, string duration2) { Index: ExsltTransform.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/src/Exslt/ExsltTransform.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ExsltTransform.cs 29 Oct 2005 21:14:35 -0000 1.2 +++ ExsltTransform.cs 30 Oct 2005 13:50:54 -0000 1.3 @@ -19,20 +19,35 @@ [Flags] public enum ExsltFunctionNamespace { + /// <summary>Nothing</summary> None = 0, + /// <summary>Dates and Times module</summary> DatesAndTimes = 1, + /// <summary>Math module</summary> Math = 2, + /// <summary>RegExp module</summary> RegularExpressions = 4, + /// <summary>Sets module</summary> Sets = 8, + /// <summary>Strings module</summary> Strings = 16, + /// <summary>GotDotNet Dates and Times module</summary> GDNDatesAndTimes = 32, + /// <summary>GotDotNet Sets module</summary> GDNSets = 64, + /// <summary>GotDotNet Math module</summary> GDNMath = 128, + /// <summary>GotDotNet RegExp module</summary> GDNRegularExpressions = 256, + /// <summary>GotDotNet Strings module</summary> GDNStrings = 512, + /// <summary>Random module</summary> Random = 1024, + /// <summary>GotDotNet Dynamic module</summary> GDNDynamic = 2056, + /// <summary>All EXSLT modules</summary> AllExslt = DatesAndTimes | Math | Random | RegularExpressions | Sets | Strings, + /// <summary>All modules</summary> All = DatesAndTimes | Math | Random | RegularExpressions | Sets | Strings | GDNDatesAndTimes | GDNSets | GDNMath | GDNRegularExpressions | GDNStrings | GDNDynamic } Index: ExsltContext.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/src/Exslt/ExsltContext.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ExsltContext.cs 29 Oct 2005 21:14:35 -0000 1.3 +++ ExsltContext.cs 30 Oct 2005 13:50:54 -0000 1.4 @@ -10,338 +10,354 @@ namespace Mvp.Xml.Exslt { - /// <summary> - /// Custom XsltContext for resolving EXSLT functions in - /// XPath-only environment. - /// </summary> - public class ExsltContext : XsltContext - { + /// <summary> + /// Custom XsltContext for resolving EXSLT functions in + /// XPath-only environment. + /// </summary> + public class ExsltContext : XsltContext + { - #region Private Fields and Properties + #region Private Fields and Properties - private XmlNameTable _nt; + private XmlNameTable _nt; - /// <summary> - /// 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; + /// <summary> + /// 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; - /// <summary> - /// Extension object which implements the functions in the http://exslt.org/math namespace - /// </summary> - private ExsltMath exsltMath = new ExsltMath(); + /// <summary> + /// Extension object which implements the functions in the http://exslt.org/math namespace + /// </summary> + private ExsltMath exsltMath = new ExsltMath(); - /// <summary> - /// Extension object which implements the functions in the http://exslt.org/dates-and-times namespace - /// </summary> - private ExsltDatesAndTimes exsltDatesAndTimes = new ExsltDatesAndTimes(); + /// <summary> + /// Extension object which implements the functions in the http://exslt.org/dates-and-times namespace + /// </summary> + private ExsltDatesAndTimes exsltDatesAndTimes = new ExsltDatesAndTimes(); - /// <summary> - /// Extension object which implements the functions in the http://exslt.org/regular-expressions namespace - /// </summary> - private ExsltRegularExpressions exsltRegularExpressions = new ExsltRegularExpressions(); + /// <summary> + /// Extension object which implements the functions in the http://exslt.org/regular-expressions namespace + /// </summary> + private ExsltRegularExpressions exsltRegularExpressions = new ExsltRegularExpressions(); - /// <summary> - /// Extension object which implements the functions in the http://exslt.org/strings namespace - /// </summary> - private ExsltStrings exsltStrings = new ExsltStrings(); + /// <summary> + /// Extension object which implements the functions in the http://exslt.org/strings namespace + /// </summary> + private ExsltStrings exsltStrings = new ExsltStrings(); - /// <summary> - /// Extension object which implements the functions in the http://exslt.org/sets namespace - /// </summary> - private ExsltSets exsltSets = new ExsltSets(); + /// <summary> + /// Extension object which implements the functions in the http://exslt.org/sets namespace + /// </summary> + private ExsltSets exsltSets = new ExsltSets(); - /// <summary> - /// Extension object which implements the functions in the http://exslt.org/random namespace - /// </summary> - private ExsltRandom exsltRandom = new ExsltRandom(); + /// <summary> + /// Extension object which implements the functions in the http://exslt.org/random namespace + /// </summary> + private ExsltRandom exsltRandom = new ExsltRandom(); - /// <summary> - /// Extension object which implements the functions in the http://gotdotnet.com/exslt/dates-and-times namespace - /// </summary> - private GDNDatesAndTimes gdnDatesAndTimes = new GDNDatesAndTimes(); + /// <summary> + /// Extension object which implements the functions in the http://gotdotnet.com/exslt/dates-and-times namespace + /// </summary> + private GDNDatesAndTimes gdnDatesAndTimes = new GDNDatesAndTimes(); - /// <summary> - /// Extension object which implements the functions in the http://gotdotnet.com/exslt/regular-expressions namespace - /// </summary> - private GDNRegularExpressions gdnRegularExpressions = new GDNRegularExpressions(); + /// <summary> + /// Extension object which implements the functions in the http://gotdotnet.com/exslt/regular-expressions namespace + /// </summary> + private GDNRegularExpressions gdnRegularExpressions = new GDNRegularExpressions(); - /// <summary> - /// Extension object which implements the functions in the http://gotdotnet.com/exslt/math namespace - /// </summary> - private GDNMath gdnMath = new GDNMath(); + /// <summary> + /// Extension object which implements the functions in the http://gotdotnet.com/exslt/math namespace + /// </summary> + private GDNMath gdnMath = new GDNMath(); - /// <summary> - /// Extension object which implements the functions in the http://gotdotnet.com/exslt/sets namespace - /// </summary> - private GDNSets gdnSets = new GDNSets(); + /// <summary> + /// Extension object which implements the functions in the http://gotdotnet.com/exslt/sets namespace + /// </summary> + private GDNSets gdnSets = new GDNSets(); - /// <summary> - /// Extension object which implements the functions in the http://gotdotnet.com/exslt/strings namespace - /// </summary> - private GDNStrings gdnStrings = new GDNStrings(); + /// <summary> + /// Extension object which implements the functions in the http://gotdotnet.com/exslt/strings namespace + /// </summary> + private GDNStrings gdnStrings = new GDNStrings(); - /// <summary> - /// Extension object which implements the functions in the http://gotdotnet.com/exslt/dynamic namespace - /// </summary> - private GDNDynamic gdnDynamic = new GDNDynamic(); + /// <summary> + /// Extension object which implements the functions in the http://gotdotnet.com/exslt/dynamic namespace + /// </summary> + private GDNDynamic gdnDynamic = new GDNDynamic(); - #endregion + #endregion - #region Constructors + #region Constructors - public ExsltContext(XmlNameTable nt) - : base((NameTable)nt) - { - _nt = nt; - AddExtensionNamespaces(); - } + /// <summary> + /// Creates new ExsltContext instance. + /// </summary> + public ExsltContext(XmlNameTable nt) + : base((NameTable)nt) + { + _nt = nt; + AddExtensionNamespaces(); + } - public ExsltContext(NameTable nt, ExsltFunctionNamespace supportedFunctions) - : this(nt) - { - SupportedFunctions = supportedFunctions; - } + /// <summary> + /// Creates new ExsltContext instance. + /// </summary> + public ExsltContext(NameTable nt, ExsltFunctionNamespace supportedFunctions) + : this(nt) + { + SupportedFunctions = supportedFunctions; + } - #endregion + #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); - RemoveNamespace("str", ExsltNamespaces.Strings); - 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); + #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); + RemoveNamespace("str", ExsltNamespaces.Strings); + 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.Math) > 0) - AddNamespace("math", ExsltNamespaces.Math); + //add extension objects as specified by SupportedFunctions + if ((this.SupportedFunctions & ExsltFunctionNamespace.Math) > 0) + AddNamespace("math", ExsltNamespaces.Math); - if ((this.SupportedFunctions & ExsltFunctionNamespace.DatesAndTimes) > 0) - AddNamespace("date", ExsltNamespaces.DatesAndTimes); + if ((this.SupportedFunctions & ExsltFunctionNamespace.DatesAndTimes) > 0) + AddNamespace("date", ExsltNamespaces.DatesAndTimes); - if ((this.SupportedFunctions & ExsltFunctionNamespace.RegularExpressions) > 0) - AddNamespace("regexp", ExsltNamespaces.RegularExpressions); + if ((this.SupportedFunctions & ExsltFunctionNamespace.RegularExpressions) > 0) + AddNamespace("regexp", ExsltNamespaces.RegularExpressions); - if ((this.SupportedFunctions & ExsltFunctionNamespace.Strings) > 0) - AddNamespace("str", ExsltNamespaces.Strings); + if ((this.SupportedFunctions & ExsltFunctionNamespace.Strings) > 0) + AddNamespace("str", ExsltNamespaces.Strings); - if ((this.SupportedFunctions & ExsltFunctionNamespace.Sets) > 0) - AddNamespace("set", ExsltNamespaces.Sets); + if ((this.SupportedFunctions & ExsltFunctionNamespace.Sets) > 0) + AddNamespace("set", ExsltNamespaces.Sets); - if ((this.SupportedFunctions & ExsltFunctionNamespace.Random) > 0) - AddNamespace("random", ExsltNamespaces.Random); + if ((this.SupportedFunctions & ExsltFunctionNamespace.Random) > 0) + AddNamespace("random", ExsltNamespaces.Random); - if ((this.SupportedFunctions & ExsltFunctionNamespace.GDNDatesAndTimes) > 0) - AddNamespace("date2", ExsltNamespaces.GDNDatesAndTimes); + if ((this.SupportedFunctions & ExsltFunctionNamespace.GDNDatesAndTimes) > 0) + AddNamespace("date2", ExsltNamespaces.GDNDatesAndTimes); - if ((this.SupportedFunctions & ExsltFunctionNamespace.GDNMath) > 0) - AddNamespace("math2", ExsltNamespaces.GDNMath); + if ((this.SupportedFunctions & ExsltFunctionNamespace.GDNMath) > 0) + AddNamespace("math2", ExsltNamespaces.GDNMath); - if ((this.SupportedFunctions & ExsltFunctionNamespace.GDNRegularExpressions) > 0) - AddNamespace("regexp2", ExsltNamespaces.GDNRegularExpressions); + if ((this.SupportedFunctions & ExsltFunctionNamespace.GDNRegularExpressions) > 0) + AddNamespace("regexp2", ExsltNamespaces.GDNRegularExpressions); - if ((this.SupportedFunctions & ExsltFunctionNamespace.GDNSets) > 0) - AddNamespace("set2", ExsltNamespaces.GDNSets); + 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); + } + #endregion - #region Public Properties - /// <summary> - /// Bitwise enumeration used to specify which EXSLT functions should be accessible to - /// in the ExsltContext. The default value is ExsltFunctionNamespace.All - /// </summary> - public ExsltFunctionNamespace SupportedFunctions - { - set - { - if (Enum.IsDefined(typeof(ExsltFunctionNamespace), value)) - _supportedFunctions = value; - } - get { return _supportedFunctions; } - } - #endregion + #region Public Properties + /// <summary> + /// Bitwise enumeration used to specify which EXSLT functions should be accessible to + /// in the ExsltContext. The default value is ExsltFunctionNamespace.All + /// </summary> + public ExsltFunctionNamespace SupportedFunctions + { + set + { + if (Enum.IsDefined(typeof(ExsltFunctionNamespace), value)) + _supportedFunctions = value; + } + get { return _supportedFunctions; } + } + #endregion - #region XsltContext Overrides - public override int CompareDocument(string baseUri, string nextbaseUri) - { - return 0; - } + #region XsltContext Overrides - public override bool PreserveWhitespace(XPathNavigator node) - { - return true; - } + /// <summary> + /// See <see cref="XsltContext.CompareDocument"/> + /// </summary> + public override int CompareDocument(string baseUri, string nextbaseUri) + { + return 0; + } - public override bool Whitespace - { - get { return true; } - } + /// <summary> + /// See <see cref="XsltContext.PreserveWhitespace"/> + /// </summary> + public override bool PreserveWhitespace(XPathNavigator node) + { + 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> + /// See <see cref="XsltContext.Whitespace"/> + /// </summary> + public override bool Whitespace + { + get { return true; } + } - /// <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); - 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 + /// <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> - /// Finds appropriate implementation for an extension function - public - /// method with the same number of arguments and compatible argument types. - /// </summary> - /// <param name="obj">Extension object</param> - /// <param name="name">Function name</param> - /// <param name="argTypes">Types of arguments</param> - /// <returns></returns> - private ExsltContextFunction GetExtensionFunctionImplementation(object obj, string name, XPathResultType[] argTypes) - { - //For each method in object's type - foreach (MethodInfo mi in obj.GetType().GetMethods()) - { - //We are interested in methods with given name - if (mi.Name == name) + /// <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) { - ParameterInfo[] parameters = mi.GetParameters(); - ////We are interested in methods with g... [truncated message content] |
From: Oleg T. <he...@us...> - 2005-10-30 13:51:04
|
Update of /cvsroot/mvp-xml/EXSLT/v1/src/Exslt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27047/v1/src/Exslt Modified Files: .cvsignore Makefile PostBuildEvent.bat Log Message: Index: .cvsignore =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v1/src/Exslt/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 20 Jul 2005 21:19:14 -0000 1.3 +++ .cvsignore 30 Oct 2005 13:50:54 -0000 1.4 @@ -2,4 +2,6 @@ obj *.user *.suo -*.vspscc \ No newline at end of file +*.vspscc +*.dll +*.pdb \ No newline at end of file Index: PostBuildEvent.bat =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v1/src/Exslt/PostBuildEvent.bat,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- PostBuildEvent.bat 19 Jul 2005 19:46:55 -0000 1.1 +++ PostBuildEvent.bat 30 Oct 2005 13:50:54 -0000 1.2 @@ -1,6 +1,6 @@ @echo off @echo ########### Setting environment variables -call "D:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\..\Tools\vsvars32.bat" +call "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\..\Tools\vsvars32.bat" nmake if errorlevel 1 goto CSharpReportError goto CSharpEnd Index: Makefile =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v1/src/Exslt/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile 19 Jul 2005 19:46:55 -0000 1.1 +++ Makefile 30 Oct 2005 13:50:54 -0000 1.2 @@ -10,7 +10,7 @@ @echo ########### Renaming methods... MethodRenamer.exe Mvp.Xml.Exslt.il Mvp.Xml.Exslt.Fixed.il @echo ########### Assembling library back... - ilasm Mvp.Xml.Exslt.Fixed.il /RESOURCE=Mvp.Xml.Exslt.res /DLL /OUTPUT=Mvp.Xml.Exslt.dll /KEY=../../../../Global/v1/mvp-xml.snk + ilasm Mvp.Xml.Exslt.Fixed.il /RESOURCE=Mvp.Xml.Exslt.res /DLL /OUTPUT=Mvp.Xml.Exslt.dll /KEY=../../../../Global/mvp-xml.snk nmake clean clean: |
From: Oleg T. <he...@us...> - 2005-10-30 13:51:04
|
Update of /cvsroot/mvp-xml/EXSLT/v2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27047/v2 Added Files: .cvsignore Log Message: --- NEW FILE: .cvsignore --- bin obj *.user *.suo |
From: Oleg T. <he...@us...> - 2005-10-30 13:48:36
|
Update of /cvsroot/mvp-xml/Common/v2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26596/v2/src Modified Files: AssemblyInfo.cs Common.csproj Removed Files: mvp-xml.snk Log Message: --- mvp-xml.snk DELETED --- Index: Common.csproj =================================================================== RCS file: /cvsroot/mvp-xml/Common/v2/src/Common.csproj,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Common.csproj 29 Oct 2005 21:13:10 -0000 1.7 +++ Common.csproj 30 Oct 2005 13:48:26 -0000 1.8 @@ -11,7 +11,8 @@ <AssemblyKeyContainerName> </AssemblyKeyContainerName> <AssemblyName>Mvp.Xml.Common</AssemblyName> - <AssemblyOriginatorKeyFile>mvp-xml.snk</AssemblyOriginatorKeyFile> + <AssemblyOriginatorKeyFile> + </AssemblyOriginatorKeyFile> <DefaultClientScript>JScript</DefaultClientScript> <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> <DefaultTargetSchema>IE50</DefaultTargetSchema> @@ -25,7 +26,7 @@ </FileUpgradeFlags> <UpgradeBackupLocation> </UpgradeBackupLocation> - <SignAssembly>true</SignAssembly> + <SignAssembly>false</SignAssembly> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <OutputPath>bin\Debug\</OutputPath> @@ -35,7 +36,8 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>DEBUG;TRACE</DefineConstants> - <DocumentationFile>bin\Debug\Mvp.Xml.Common.xml</DocumentationFile> + <DocumentationFile> + </DocumentationFile> <DebugSymbols>true</DebugSymbols> <FileAlignment>4096</FileAlignment> <NoStdLib>false</NoStdLib> @@ -153,9 +155,6 @@ <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> - <ItemGroup> - <None Include="mvp-xml.snk" /> - </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <PropertyGroup> <PreBuildEvent> Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/mvp-xml/Common/v2/src/AssemblyInfo.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AssemblyInfo.cs 16 Oct 2005 16:51:24 -0000 1.1 +++ AssemblyInfo.cs 30 Oct 2005 13:48:26 -0000 1.2 @@ -11,7 +11,6 @@ [assembly: AssemblyDescription("MVP XML Library - Common Module")] [assembly: AssemblyVersion("2.0.*")] - #region Security Permissions //[assembly: SecurityPermission(SecurityAction.RequestRefuse, UnmanagedCode=true)] |
From: Oleg T. <he...@us...> - 2005-10-30 13:48:35
|
Update of /cvsroot/mvp-xml/Common/v1/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26596/v1/src Modified Files: AssemblyInfo.cs Log Message: Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/mvp-xml/Common/v1/src/AssemblyInfo.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- AssemblyInfo.cs 15 Jan 2005 14:42:38 -0000 1.3 +++ AssemblyInfo.cs 30 Oct 2005 13:48:26 -0000 1.4 @@ -12,7 +12,7 @@ [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("../../../../../Global/v1/mvp-xml.snk")] +[assembly: AssemblyKeyFile("../../../../../Global/mvp-xml.snk")] [assembly: AssemblyKeyName("")] #region Security Permissions |
From: Oleg T. <he...@us...> - 2005-10-30 12:02:47
|
Update of /cvsroot/mvp-xml/EXSLT/v2/test/ExsltTest/results/EXSLT/Math In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8329/v2/test/ExsltTest/results/EXSLT/Math Modified Files: acos.xml Log Message: Index: acos.xml =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/test/ExsltTest/results/EXSLT/Math/acos.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- acos.xml 29 Oct 2005 21:14:35 -0000 1.2 +++ acos.xml 30 Oct 2005 12:02:31 -0000 1.3 @@ -1,5 +1,5 @@ <out> - <test1>1.0471975511965976</test1> + <test1>1.0471975511965978</test1> <test2>2.6905658417935307</test2> <test3>NaN</test3> <test4>NaN</test4> |
From: Oleg T. <he...@us...> - 2005-10-30 12:02:44
|
Update of /cvsroot/mvp-xml/EXSLT/v2/test/ExsltTest/results/GotDotNet/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8329/v2/test/ExsltTest/results/GotDotNet/Dynamic Modified Files: evaluate.xml Log Message: Index: evaluate.xml =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/test/ExsltTest/results/GotDotNet/Dynamic/evaluate.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- evaluate.xml 16 Oct 2005 20:13:08 -0000 1.1 +++ evaluate.xml 30 Oct 2005 12:02:31 -0000 1.2 @@ -10,7 +10,7 @@ <test5></test5> <test6></test6> <test7> - <order id="o44" xmlns:o="http://orders.com" xmlns="http://orders.com">Baz</order> + <order id="o44" xmlns="http://orders.com" xmlns:o="http://orders.com">Baz</order> </test7> <test8> <order id="o332" xmlns:o="http://orders.com">Shoes</order> @@ -19,11 +19,10 @@ <order id="o332" xmlns:o="http://orders.com">Shoes</order> </test9> <test10> - <order id="o11" xmlns:o="http://orders.com" xmlns="http://orders.com">Foo</order> + <order id="o11" xmlns="http://orders.com" xmlns:o="http://orders.com">Foo</order> </test10> - <test11></test11> <test12> - <order id="o11" xmlns:o="http://orders.com" xmlns="http://orders.com">Foo</order> + <order id="o11" xmlns="http://orders.com" xmlns:o="http://orders.com">Foo</order> </test12> <test13></test13> </out> \ No newline at end of file |
From: Oleg T. <he...@us...> - 2005-10-30 12:02:42
|
Update of /cvsroot/mvp-xml/EXSLT/v2/test/ExsltTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8329/v2/test/ExsltTest Modified Files: ExsltTest.cs ExsltTest.csproj Log Message: Index: ExsltTest.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/test/ExsltTest/ExsltTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ExsltTest.cs 16 Oct 2005 20:13:08 -0000 1.1 +++ ExsltTest.cs 30 Oct 2005 12:02:31 -0000 1.2 @@ -12,22 +12,29 @@ public class ExsltTest { public static void Main(string[] args) { - if (args.Length != 3) { - PrintUsage(); - return; - } - try { - XPathDocument doc = new XPathDocument(args[0]); - ExsltTransform xslt = new ExsltTransform(); - xslt.Load(args[1]); - xslt.MultiOutput = false; - using (FileStream fs = File.Create(args[2])) { - xslt.Transform(doc, null, fs); - } - } catch (Exception e) { - Console.Error.WriteLine("An exception occured: "); - Console.Error.WriteLine(e); - } + //GDNDynamicTests t = new GDNDynamicTests(); + //t.EvaluateTest(); + if (args.Length != 3) + { + PrintUsage(); + return; + } + try + { + XPathDocument doc = new XPathDocument(args[0]); + ExsltTransform xslt = new ExsltTransform(); + xslt.Load(args[1]); + xslt.MultiOutput = false; + using (FileStream fs = File.Create(args[2])) + { + xslt.Transform(doc, null, fs); + } + } + catch (Exception e) + { + Console.Error.WriteLine("An exception occured: "); + Console.Error.WriteLine(e); + } } private static void PrintUsage() { Index: ExsltTest.csproj =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/test/ExsltTest/ExsltTest.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ExsltTest.csproj 29 Oct 2005 21:14:35 -0000 1.2 +++ ExsltTest.csproj 30 Oct 2005 12:02:31 -0000 1.3 @@ -20,8 +20,7 @@ <OutputType>Exe</OutputType> <RootNamespace>ExsltTest</RootNamespace> <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> - <StartupObject> - </StartupObject> + <StartupObject>ExsltTest.ExsltTest</StartupObject> <FileUpgradeFlags> </FileUpgradeFlags> <UpgradeBackupLocation> |
From: Oleg T. <he...@us...> - 2005-10-30 12:02:42
|
Update of /cvsroot/mvp-xml/EXSLT/v2/src/Exslt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8329/v2/src/Exslt Modified Files: ExsltRandom.cs GDNDynamic.cs Log Message: Index: GDNDynamic.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/src/Exslt/GDNDynamic.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- GDNDynamic.cs 16 Oct 2005 20:07:08 -0000 1.1 +++ GDNDynamic.cs 30 Oct 2005 12:02:31 -0000 1.2 @@ -38,7 +38,7 @@ /// <returns>Result of evaluating given Xpath expression WRT to context node.</returns> /// <remarks>THIS FUNCTION IS NOT PART OF EXSLT!!!</remarks> public object evaluate(XPathNodeIterator contextNode, string expression, string namespaces) - { + { if (expression == String.Empty || contextNode == null) return String.Empty; if (contextNode.MoveNext()) @@ -58,7 +58,7 @@ } while (node.MoveToNextNamespace()); } if (namespaces != String.Empty) - { + { try { Regex regexp = new Regex(@"xmlns:(?<p>\w+)\s*=\s*(('(?<n>.+)')|(""(?<n>.+)""))\s*"); @@ -66,7 +66,7 @@ while (m.Success) { try - { + { context.AddNamespace(m.Groups["p"].Value, m.Groups["n"].Value); } @@ -75,12 +75,12 @@ } } catch {} - } - expr.SetContext(context); + } + expr.SetContext(context); return contextNode.Current.Evaluate(expr, contextNode); } catch - { + { //Any exception such as syntax error in XPath return String.Empty; } Index: ExsltRandom.cs =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/src/Exslt/ExsltRandom.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ExsltRandom.cs 16 Oct 2005 20:07:08 -0000 1.1 +++ ExsltRandom.cs 30 Oct 2005 12:02:31 -0000 1.2 @@ -79,6 +79,9 @@ XmlDocument doc = new XmlDocument(); doc.LoadXml("<randoms/>"); + if (seed == int.MinValue) + seed += 1; + Random rand = new Random(seed); //Negative number is bad idea - fallback to default |
From: Oleg T. <he...@us...> - 2005-10-30 12:02:42
|
Update of /cvsroot/mvp-xml/EXSLT/v2/test/ExsltTest/results/EXSLT/DatesAndTimes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8329/v2/test/ExsltTest/results/EXSLT/DatesAndTimes Modified Files: duration.xml Log Message: Index: duration.xml =================================================================== RCS file: /cvsroot/mvp-xml/EXSLT/v2/test/ExsltTest/results/EXSLT/DatesAndTimes/duration.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- duration.xml 16 Oct 2005 20:13:08 -0000 1.1 +++ duration.xml 30 Oct 2005 12:02:31 -0000 1.2 @@ -5,6 +5,5 @@ <test4>P730D</test4> <test5>P90D</test5> <test6>-P90D</test6> - <test7>PT0S</test7> <test8>PT0S</test8> </out> \ No newline at end of file |