Project

Profile

Help

Revision c7deb2a9

Added by Debbie Lockett 6 months ago

.NET code updates: tidying up documentation comments, etc. for recent development work (e.g. Bug #4839)

View differences:

src/main/csharp/api/Saxon.Api/Configuration.cs
150 150
            processor = new JProcessor(config);
151 151
        }
152 152

  
153
        public ICollectionFinder CollectionFinder{  
153
        public ICollectionFinder CollectionFinder
154
		{  
154 155
            set {
155 156
                if (value != null)
156 157
                {
......
176 177

  
177 178
        }
178 179

  
180
		/// <summary>
181
		/// Register a specific URI and bind it to a specific <c>ResourceCollection</c>
182
		/// </summary>
183
		/// <param name="collectionURI">the collection URI to be registered. Must not be null.</param>
184
		/// <param name="collection">the ResourceCollection to be associated with this URI. Must not be null.</param>
179 185
        public void RegisterCollection(String collectionURI, IResourceCollection collection) {
180 186
            StandardCollectionFinder.RegisterCollection(collectionURI, collection);
181 187
            if (CollectionFinder is StandardCollectionFinder && collectionFinder != standardCollectionFinder) {
src/main/csharp/api/Saxon.Api/Destination.cs
25 25
using JAbstractDestination = net.sf.saxon.s9api.AbstractDestination;
26 26
using JAction = net.sf.saxon.s9api.Action;
27 27
using java.net;
28
using net.sf.saxon.@event;
29 28
using net.sf.saxon.s9api;
30
using net.sf.saxon.serialize;
31 29

  
32 30
namespace Saxon.Api
33 31
{
......
895 893
        }
896 894
    }
897 895

  
898
    /*
899
    /// <summary>
900
    /// A completely general functional interface for functions that take
901
    /// no argument, return void, and potentially throw a Exception
902
    /// </summary>
903
    public interface IAction {
904

  
905
        /// <summary>
906
        /// Perform the requested action
907
        /// </summary>
908
        void Act();
909

  
910
    } */
911

  
912
    /*internal class ActionImpl: net.sf.saxon.s9api.Action {
913

  
914
        private IAction action;
915
        public ActionImpl(IAction actioni) {
916
            action = actioni;
917
        }
918

  
919
        public void act()
920
        {
921
            try
922
            {
923
                action.Act();
924

  
925
            }
926
            catch (net.sf.saxon.s9api.SaxonApiException ex) {
927

  
928
                throw new DynamicError(ex);
929
            }
930

  
931
        }
932

  
933
    }*/
934

  
935 896

  
936 897
    internal class AbstractDestination : XmlDestination
937 898
    {
src/main/csharp/api/Saxon.Api/Errors.cs
263 263
            get { return reporter; }
264 264
        }
265 265

  
266

  
266
		/// <summary>
267
		/// This method is called internally in Saxon to report an error by adding it to the error list.
268
		/// </summary>
269
		/// <param name="xpe">details of the error to be reported</param>
267 270
        public void report(JXmlProcessingError xpe)
268 271
        {
269 272
            reporter.report(new XmlProcessingError(xpe));
......
301 304
        /// <summary>
302 305
        /// This method is called internally in Saxon to report an error by adding it to the error list.
303 306
        /// </summary>
304
        /// <param name="xpe"></param>
307
		/// <param name="xpe">details of the error to be reported</param>
305 308
        public void report(JXmlProcessingError xpe)
306 309
        {
307 310
            errorList.Add(new XmlProcessingError(xpe));
......
332 335
            get { return errorList; }
333 336
        }
334 337

  
335

  
338
		/// <summary>
339
		/// This method is called internally in Saxon to report an error by adding it to the error list.
340
		/// </summary>
341
		/// <param name="xpe">details of the error to be reported</param>
336 342
        public void report(JXmlProcessingError xpe)
337 343
        {
338 344
            errorList.Add(new StaticError(net.sf.saxon.trans.XPathException.fromXmlProcessingError(xpe)));
src/main/csharp/api/Saxon.Api/Extensibility.cs
16 16
using JItem = net.sf.saxon.om.Item;
17 17
using JResource = net.sf.saxon.lib.Resource;
18 18
using JResourceCollection = net.sf.saxon.lib.ResourceCollection;
19
using JResourceFactory = net.sf.saxon.lib.ResourceFactory;
19 20
using JStandardCollectionFinder = net.sf.saxon.resource.StandardCollectionFinder;
20 21
using JCollectionFinder = net.sf.saxon.lib.CollectionFinder;
21 22
using System.Collections.Generic;
22
using net.sf.saxon.expr;
23
using net.sf.saxon.lib;
24 23
using net.sf.saxon.om;
25 24
using java.util;
26 25
using net.sf.saxon;
......
425 424
        /// supplied to the fn:collection or fn:uri-collection against the staticbase URI</param>
426 425
        /// <returns>a ResourceCollection object representing the resources in the collection identified
427 426
        ///  by this collection URI. Result should not be null.</returns>
428
        IResourceCollection FindCollection(DynamicContext context, String collectionURI);
427
		/**public**/ IResourceCollection FindCollection(DynamicContext context, String collectionURI);
429 428

  
430 429

  
431 430
    }
......
446 445
        /// If the collection() or uri-collection() function
447 446
        /// was called with no arguments(to get the "default collection") this
448 447
        /// will be the URI of the default collection registered with the Configuration.</returns>
449
        String CollectionURI();
448
		/**public**/ String CollectionURI();
450 449

  
451 450
        /// <summary>
452 451
        /// Get the URIs of the resources in the collection. This supports the fn:uri-collection()
......
460 459
        /// <param name="context">context the XPath evaluation context</param>
461 460
        /// <returns>an iterator over the URIs of the resources in the collection. The URIs are represented
462 461
        /// as Strings.They should preferably be absolute URIs.</returns>
463
        List<String> GetResourceURIs(DynamicContext context);
462
		/**public**/ List<String> GetResourceURIs(DynamicContext context);
464 463

  
465 464
        /// <summary>
466 465
        /// Get the resources in the collection. This supports the fn:collection() function. It is not
......
471 470
        /// <param name="context">the XPath evaluation context</param>
472 471
        /// <returns>a List over the resources in the collection. This returns objects of class
473 472
        /// <c>Riesource</c>.</returns>
474
        List<IResource> GetResources(DynamicContext context);
473
		/**public**/ List<IResource> GetResources(DynamicContext context);
475 474

  
476 475

  
477 476
    }
......
506 505
    public class JarCollection : ResourceCollection
507 506
    {
508 507

  
508
		/// <summary>
509
		/// Create a JarCollection
510
		/// </summary>
511
		/// <param name="context">The XPath dynamic context</param>
512
		/// <param name="collectionURI">the collection URI used to identify this collection 
513
		/// (typically but not necessarily the location of the JAR file)</param>
514
		/// <param name="parameters">URI query parameters appearing on the collection URI</param>
509 515
        public JarCollection(DynamicContext context, String collectionURI, URIQueryParameters parameters)
510 516
        {
511 517
            resourceCollection = new net.sf.saxon.resource.JarCollection(context.context, collectionURI, parameters.Implementation());
......
514 520

  
515 521
    }
516 522

  
523
	/// <summary>
524
	/// CatalogCollection
525
	/// </summary>
517 526
    public class CatalogCollection : ResourceCollection
518 527
    {
519 528

  
......
644 653
        /// Get a URI that identifies this resource
645 654
        /// </summary>
646 655
        /// <returns>a URI identifying the resource</returns>
647
        String GetResourceURI();
656
		/**public**/ String GetResourceURI();
648 657

  
649 658
        /// <summary>
650 659
        /// Get an XDM Item holding the contents of this resource.
......
655 664
        /// for text resources, a map or array for JSON resources, a base64Binary value
656 665
        /// for binary resource.May also return null if the resource cannot be materialized
657 666
        /// and this is not to be treated as an error.</returns>
658
        XdmItem GetXdmItem(DynamicContext context);
667
		/**public**/ XdmItem GetXdmItem(DynamicContext context);
659 668

  
660 669
        /// <summary> 
661 670
        /// Get the media type (MIME type) of the resource if known
662 671
        /// </summary>
663 672
        /// <returns>the media type if known; otherwise null</returns>
664
        String GetContentType();
673
		/**public**/ String GetContentType();
665 674
    }
666 675

  
676
	/// <summary>
677
	/// ResourceCollection
678
	/// </summary>
667 679
    public class ResourceCollection : IResourceCollection
668 680
    {
669
        protected net.sf.saxon.lib.ResourceCollection resourceCollection;
681
		protected JResourceCollection resourceCollection;
670 682

  
671 683
        internal ResourceCollection()
672 684
        {
673 685
        }
674 686

  
675 687

  
676
        internal ResourceCollection(net.sf.saxon.lib.ResourceCollection rc) {
688
		internal ResourceCollection(JResourceCollection rc) {
677 689
            resourceCollection = rc;
678 690
        }
679 691

  
......
726 738
        /// </summary>
727 739
        /// <param name="proc">the Saxon Processor</param>
728 740
        /// <returns>the resource</returns>
729
        IResource MakeResource(Processor proc);
741
		/**public**/ IResource MakeResource(Processor proc);
730 742

  
731 743
    }
732 744

  
733
    internal class ResourceFactoryWrapper : net.sf.saxon.lib.ResourceFactory
745
    internal class ResourceFactoryWrapper : JResourceFactory
734 746
    {
735 747
        private IResourceFactory resourceFactory;
736 748
        private Processor proc;
......
752 764
    {
753 765
        internal JResource resource = null;
754 766

  
755
        public Resource() { resource = null; }
767
        public Resource() 
768
		{ 
769
			resource = null; 
770
		}
756 771

  
757
        public Resource(JResource rc) {
772
        public Resource(JResource rc) 
773
		{
758 774
            resource = rc;
759 775
        }
760 776

  
......
774 790
        }
775 791
    }
776 792

  
793
	/// <summary>
794
	/// BinaryResource
795
	/// </summary>
777 796
    public class BinaryResource : Resource {
778 797

  
779 798

  
780
        public BinaryResource(String href, String contentType, byte [] content) {
799
        public BinaryResource(String href, String contentType, byte[] content) {
781 800
            resource = new net.sf.saxon.resource.BinaryResource(href, contentType, content); 
782 801
        }
783 802

  
......
785 804
    }
786 805

  
787 806

  
788
    internal class ResourceWrapper : net.sf.saxon.lib.Resource
807
    internal class ResourceWrapper : JResource
789 808
    {
790 809

  
791 810
        IResource resource;
......
810 829
    }
811 830
    
812 831

  
813
    internal class CollectionFinderWrapper : net.sf.saxon.lib.CollectionFinder
832
    internal class CollectionFinderWrapper : JCollectionFinder
814 833
    {
815 834

  
816 835
        ICollectionFinder collectionFinder;
src/main/csharp/api/Saxon.Api/XPath.cs
904 904

  
905 905
    }
906 906

  
907
	/// <summary>
908
	/// A set of query parameters on a URI passed to the <c>collection()</c> or <c>document()</c> function.
909
	/// </summary>
910

  
907 911
    public class URIQueryParameters
908 912
    {
909 913

  
......
914 918
        public const int ON_ERROR_WARNING = 2;
915 919
        public const int ON_ERROR_IGNORE = 3;
916 920

  
921
		/// <summary>
922
		/// Create an object representing the query part of a URI
923
		/// </summary>
924
		/// <param name="query">the part of the URI after the "?" symbol</param>
925
		/// <param name="value">the Saxon Processor</param>
926

  
917 927
        public URIQueryParameters(String query, Processor proc)
918 928
        {
919 929
            uriQueryParameters = new net.sf.saxon.functions.URIQueryParameters(query, proc.Implementation);
920 930

  
921 931
        }
922 932

  
923
        internal net.sf.saxon.functions.URIQueryParameters Implementation() {
933
        internal net.sf.saxon.functions.URIQueryParameters Implementation() 
934
		{
924 935
            return uriQueryParameters;
925 936
        } 
926 937

  
927
        /*
928
        public static FileNameFilter MakeGlobFilter(String value) {
938
        /* public static FileNameFilter MakeGlobFilter(String value) 
939
        {
929 940
            return new FileNameFilter(net.sf.saxon.functions.URIQueryParameters.makeGlobFilter(value));
930 941
        } */
931 942

  
932
        public int ValidationMode() {
943
        public int ValidationMode() 
944
		{
933 945
            return uriQueryParameters.getValidationMode().intValue();
934 946
        }
935 947

  
936
        /*
937
        public FileNameFilter FileNameFilter
948
        /* public FileNameFilter FileNameFilter
938 949
        {
939 950
            get {
940 951
                return new FileNameFilter(uriQueryParameters.getFilenameFilter());
......
942 953
            
943 954
        }*/
944 955

  
945
        public bool GetRecurse() {
956
        public bool GetRecurse() 
957
		{
946 958
            return uriQueryParameters.getRecurse().booleanValue();
947 959
        }
948 960

  
949
        public int GetOnError() {
961
        public int GetOnError() 
962
		{
950 963
            return uriQueryParameters.getOnError().intValue();
951 964
        }
952 965

  
src/main/csharp/api/Saxon.Api/Xslt.cs
2054 2054

  
2055 2055
    /// <summary>An <code>Xslt30Transformer</code> represents a compiled and loaded stylesheet ready for execution.
2056 2056
    /// The <code>Xslt30Transformer</code> holds details of the dynamic evaluation context for the stylesheet.</summary>
2057

  
2058 2057
    /// <remarks><para>The <code>Xslt30Transformer</code> differs from <see cref="XsltTransformer"/> 
2059 2058
    /// in supporting new options
2060 2059
    /// for invoking a stylesheet, corresponding to facilities defined in the XSLT 3.0 specification. However,
......
2065 2064
    /// It is safe, however, to reuse the object within a single thread to run the same
2066 2065
    /// stylesheet several times. Running the stylesheet does not change the context
2067 2066
    /// that has been established.</para>
2068

  
2069 2067
    /// <para>An <code>Xslt30Transformer</code> is always constructed by running the <code>Load30</code>
2070 2068
    /// method of an <see cref="XsltExecutable"/>.</para>
2071

  
2072 2069
    /// <para>Unlike <code>XsltTransformer</code>, an <code>Xslt30Transformer</code> is not a <code>Destination</code>.
2073 2070
    /// To pipe the results of one transformation into another, the target should be an <code>XsltTransfomer</code>
2074 2071
    /// rather than an <code>Xslt30Transformer</code>.</para>
2075

  
2076 2072
    /// <para>Evaluation of an Xslt30Transformer proceeds in a number of phases:</para>
2077 2073
    /// <list type="number">
2078 2074
    /// <item>First, values may be supplied for stylesheet parameters and for the global context item. The

Also available in: Unified diff