Exemplo n.º 1
0
        /// <summary>
		/// Compile a schema, delivered using an <c>XmlReader</c>. The resulting schema components are added
        /// to the cache.
        /// </summary>
        /// <remarks>
        /// The <c>XmlReader</c> is responsible for parsing the document; this method builds a tree
        /// representation of the document (in an internal Saxon format) and compiles it.
        /// The <c>XmlReader</c> is used as supplied; it is the caller's responsibility to ensure that
        /// its settings are appropriate for parsing a schema document (for example, that entity references
        /// are expanded and whitespace is retained).
        /// </remarks>
		/// <param name="reader">The <c>XmlReader</c> (that is, the XML parser) used to supply the source schema document</param>

        public void Compile(XmlReader reader)
        {
            JPullProvider pp = new JDotNetPullProvider(reader);
            pp.setPipelineConfiguration(config.makePipelineConfiguration());
            // pp = new PullTracer(pp);  /* diagnostics */
            JPullSource ss = new JPullSource(pp);
            ss.setSystemId(reader.BaseURI);
			schemaManager.load (ss);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add an instance document to the list of documents to be validated
        /// </summary>
        /// <param name="reader">Source document supplied as an <c>XmlReader</c></param>

        public void AddSource(XmlReader reader) {
            JPullProvider pp = new JDotNetPullProvider(reader);
            JPipelineConfiguration pipe = config.makePipelineConfiguration();
            pipe.setUseXsiSchemaLocation(schemaValidator.isUseXsiSchemaLocation());
            pp.setPipelineConfiguration(pipe);
            // pp = new PullTracer(pp);  /* diagnostics */
            JPullSource psource = new JPullSource(pp);
            psource.setSystemId(reader.BaseURI);
            sources.Add(psource);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Supply the instance document to be validated, in the form of an XmlReader.
        /// </summary>
        /// <remarks>
        /// The XmlReader is responsible for parsing the document; this method validates it.
        /// </remarks>
        /// <param name="reader">The <c>XmlReader</c> used to read and parse the instance
        /// document being validated. This is used as supplied. For conformance, use of a
        /// plain <c>XmlTextReader</c> is discouraged, because it does not expand entity
        /// references. This may cause validation failures.
        /// </param>

        public void SetSource(XmlReader reader)
        {
            JPullProvider          pp   = new JDotNetPullProvider(reader);
            JPipelineConfiguration pipe = config.makePipelineConfiguration();

            pipe.setUseXsiSchemaLocation(useXsiSchemaLocation);
            pp.setPipelineConfiguration(pipe);
            // pp = new PullTracer(pp);  /* diagnostics */
            JPullSource psource = new JPullSource(pp);

            psource.setSystemId(reader.BaseURI);
            this.source = psource;
            sources.Clear();
        }