XsltCommand.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. //
  2. // System.Xml.Query.XsltCommand
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. // Atsushi Enomoto ([email protected])
  7. //
  8. // Copyright (C) Tim Coleman, 2003
  9. // Copyright (C) Atsushi Enomoto, 2004
  10. //
  11. //
  12. // Permission is hereby granted, free of charge, to any person obtaining
  13. // a copy of this software and associated documentation files (the
  14. // "Software"), to deal in the Software without restriction, including
  15. // without limitation the rights to use, copy, modify, merge, publish,
  16. // distribute, sublicense, and/or sell copies of the Software, and to
  17. // permit persons to whom the Software is furnished to do so, subject to
  18. // the following conditions:
  19. //
  20. // The above copyright notice and this permission notice shall be
  21. // included in all copies or substantial portions of the Software.
  22. //
  23. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  27. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  28. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  29. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  30. //
  31. #if NET_2_0
  32. using System.IO;
  33. using System.Security.Policy;
  34. using System.Text;
  35. using System.Xml;
  36. using System.Xml.XPath;
  37. namespace System.Xml.Query
  38. {
  39. public sealed class XsltCommand
  40. {
  41. [MonoTODO]
  42. public XsltCommand ()
  43. {
  44. }
  45. [MonoTODO]
  46. public event QueryEventHandler OnMessageEvent;
  47. // Compile
  48. [MonoTODO]
  49. public void Compile (string stylesheetUri)
  50. {
  51. Compile (stylesheetUri, new XmlUrlResolver (), null);
  52. }
  53. [MonoTODO]
  54. public void Compile (string stylesheetUri, XmlResolver resolver)
  55. {
  56. Compile (stylesheetUri, resolver, null);
  57. }
  58. [MonoTODO]
  59. public void Compile (string stylesheetUri, XmlResolver resolver, Evidence evidence)
  60. {
  61. using (XmlReader reader = XmlReader.Create (stylesheetUri)) {
  62. Compile (reader, resolver, evidence);
  63. }
  64. }
  65. [MonoTODO]
  66. public void Compile (XmlReader reader)
  67. {
  68. Compile (reader, new XmlUrlResolver ());
  69. }
  70. [MonoTODO]
  71. public void Compile (XmlReader reader, XmlResolver resolver)
  72. {
  73. Compile (reader, resolver, null);
  74. }
  75. [MonoTODO]
  76. public void Compile (XmlReader reader, XmlResolver resolver, Evidence evidence)
  77. {
  78. throw new NotImplementedException ();
  79. }
  80. // Execute
  81. [MonoTODO]
  82. public void Execute (string contextDocumentUri, XmlWriter results)
  83. {
  84. Execute (contextDocumentUri, new XmlUrlResolver (), null, results);
  85. }
  86. [MonoTODO ("Null args allowed?")]
  87. public void Execute (
  88. IXPathNavigable contextDocument,
  89. XmlWriter results)
  90. {
  91. Execute (contextDocument, new XmlUrlResolver (), null, results);
  92. }
  93. [MonoTODO]
  94. public void Execute (string contextDocumentUri, string resultDocumentUri)
  95. {
  96. XmlWriter xw = XmlWriter.Create (resultDocumentUri);
  97. try {
  98. Execute (new XPathDocument (contextDocumentUri), xw);
  99. } finally {
  100. xw.Close ();
  101. }
  102. }
  103. [MonoTODO]
  104. public void Execute (
  105. IXPathNavigable contextDocument,
  106. XmlResolver resolver,
  107. XmlArgumentList argList,
  108. Stream results)
  109. {
  110. Execute (contextDocument, resolver, argList, results);
  111. }
  112. [MonoTODO]
  113. public void Execute (
  114. IXPathNavigable contextDocument,
  115. XmlResolver dataSources,
  116. XmlArgumentList argList,
  117. TextWriter results)
  118. {
  119. Execute (contextDocument, dataSources, argList, results);
  120. }
  121. [MonoTODO]
  122. public void Execute (
  123. IXPathNavigable contextDocument,
  124. XmlResolver dataSources,
  125. XmlArgumentList argList,
  126. XmlWriter results)
  127. {
  128. throw new NotImplementedException ();
  129. }
  130. [MonoTODO]
  131. public void Execute (
  132. string contextDocumentUri,
  133. XmlResolver dataSources,
  134. XmlArgumentList argList,
  135. Stream results)
  136. {
  137. XmlWriter w = XmlWriter.Create (results);
  138. Execute (contextDocumentUri, dataSources, argList, w);
  139. }
  140. [MonoTODO]
  141. public void Execute (
  142. string contextDocumentUri,
  143. XmlResolver dataSources,
  144. XmlArgumentList argList,
  145. TextWriter results)
  146. {
  147. XmlWriter w = XmlWriter.Create (results);
  148. Execute (contextDocumentUri, dataSources, argList, w);
  149. }
  150. [MonoTODO]
  151. public void Execute (
  152. string contextDocumentUri,
  153. XmlResolver dataSources,
  154. XmlArgumentList argList,
  155. XmlWriter results)
  156. {
  157. throw new NotImplementedException ();
  158. }
  159. }
  160. }
  161. #endif // NET_2_0