Project

Profile

Help

How to connect?
Download (26.2 KB) Statistics
| Branch: | Tag: | Revision:

he / tags / 9.4.0.7 / hen / csource / api / Saxon.Api / Destination.cs @ b0b00ab2

1
using System;
2
using System.IO;
3
using System.Xml;
4
using System.Collections;
5
using JConfiguration = net.sf.saxon.Configuration;
6
using JPipelineConfiguration = net.sf.saxon.@event.PipelineConfiguration;
7
using JReceiver = net.sf.saxon.@event.Receiver;
8
using JSink = net.sf.saxon.@event.Sink;
9
using JProperties = java.util.Properties;
10
using JOutputStream = java.io.OutputStream;
11
using JWriter = java.io.Writer;
12
using JFileOutputStream = java.io.FileOutputStream;
13
using JXPathException = net.sf.saxon.trans.XPathException;
14
using JResult = javax.xml.transform.Result;
15
using JStreamResult = javax.xml.transform.stream.StreamResult;
16
using JBuilder = net.sf.saxon.@event.Builder;
17
using JTinyBuilder = net.sf.saxon.tree.tiny.TinyBuilder;
18
using JLinkedTreeBuilder = net.sf.saxon.tree.linked.LinkedTreeBuilder;
19
using net.sf.saxon.@event;
20
using net.sf.saxon.lib;
21
using net.sf.saxon.om;
22
using net.sf.saxon.value;
23
using net.sf.saxon.query;
24
using net.sf.saxon.dotnet;
25

    
26

    
27
namespace Saxon.Api
28
{
29

    
30

    
31

    
32
    /// <summary>
33
    /// An abstract destination for the results of a query or transformation
34
    /// </summary>
35
    /// <remarks>
36
    /// <para>Note to implementors: To implement a new kind of destination, you need
37
    /// to supply a method <c>getResult</c> which returns an implementation of
38
    /// the JAXP <c>Result</c> interface. Optionally, if the destination
39
    /// performs serialization, you can also implement <c>getOutputProperties</c>,
40
    /// which returns the properties used for serialization.
41
    /// </para>
42
    /// </remarks>
43

    
44

    
45
    public abstract class XmlDestination
46
    {
47

    
48
        /// <summary>
49
        /// Get a <c>Result</c> to which the XML document can be sent as a series
50
        /// of events. This method is intended primarily for internal use.
51
        /// </summary>
52
        /// <remarks>
53
        /// The returned value must be an implementation of the JAXP <c>Result</c> interface that is
54
        /// recognized by Saxon.
55
        /// </remarks>
56
        /// <param name="pipe">Configuration information for use by the implementation</param>
57

    
58
        public abstract JResult GetResult(JPipelineConfiguration pipe);
59

    
60
        /// <summary>
61
        /// Get a set of <c>Properties</c> representing the parameters to the serializer.
62
        /// The default implementation returns an empty set of properties.
63
        /// </summary>
64

    
65
        public virtual JProperties GetOutputProperties()
66
        {
67
            return new JProperties();
68
        }
69

    
70
        /// <summary>
71
        /// Close the Destination, releasing any resources that need to be released.
72
        /// </summary>
73
        /// <remarks>
74
        /// This method is called by the system on completion of a query or transformation.
75
        /// Some kinds of Destination may need to close an output stream, others might
76
        /// not need to do anything. The default implementation does nothing.
77
        /// </remarks>
78

    
79
        public virtual void Close()
80
        {
81
        }
82

    
83

    
84
    }
85

    
86
    /// <summary>
87
    /// A <c>Serializer</c> takes a tree representation of XML and turns
88
    /// it into lexical XML markup.
89
    /// </summary>
90
    /// <remarks>
91
    /// Note that this is serialization in the sense of the W3C XSLT and XQuery specifications.
92
    /// Unlike the class <c>System.Xml.Serialization.XmlSerializer</c>, this object does not
93
    /// serialize arbitrary CLI objects.
94
    /// </remarks>
95

    
96
    public class Serializer : XmlDestination
97
    {
98

    
99
        private JProperties props = new JProperties();
100
        private JOutputStream outputStream = null;
101
        private JWriter writer = null;
102
        private bool mustClose = true;
103

    
104

    
105
        /// <summary>QName identifying the serialization parameter "method". If the method
106
        /// is a user-defined method, then it is given as a QName in Clark notation, that is
107
        /// "{uri}local".</summary>
108

    
109
        public static readonly QName METHOD =
110
            new QName("", "method");
111

    
112
        /// <summary>QName identifying the serialization parameter "byte-order-mark"</summary>
113

    
114
        public static readonly QName BYTE_ORDER_MARK =
115
            new QName("", "byte-order-mark");
116

    
117
        /// <summary>QName identifying the serialization parameter "cdata-section-elements".
118
        /// The value of this parameter is given as a space-separated list of expanded QNames in
119
        /// Clark notation, that is "{uri}local".</summary>
120

    
121
        public static readonly QName CDATA_SECTION_ELEMENTS =
122
            new QName("", "cdata-section-elements");
123

    
124
        /// <summary>QName identifying the serialization parameter "doctype-public"</summary>
125

    
126
        public static readonly QName DOCTYPE_PUBLIC =
127
            new QName("", "doctype-public");
128

    
129
        /// <summary>QName identifying the serialization parameter "doctype-system"</summary>
130

    
131
        public static readonly QName DOCTYPE_SYSTEM =
132
            new QName("", "doctype-system");
133

    
134
        /// <summary>QName identifying the serialization parameter "encoding"</summary>
135

    
136
        public static readonly QName ENCODING =
137
            new QName("", "encoding");
138

    
139
        /// <summary>QName identifying the serialization parameter "escape-uri-attributes".
140
        /// The value is the string "yes" or "no".</summary>
141

    
142
        public static readonly QName ESCAPE_URI_ATTRIBUTES =
143
            new QName("", "escape-uri-attributes");
144

    
145
        /// <summary>QName identifying the serialization parameter "include-content-type".
146
        /// The value is the string "yes" or "no".</summary>
147

    
148
        public static readonly QName INCLUDE_CONTENT_TYPE =
149
            new QName("", "include-content-type");
150

    
151
        /// <summary>QName identifying the serialization parameter "indent".
152
        /// The value is the string "yes" or "no".</summary>
153

    
154
        public static readonly QName INDENT =
155
            new QName("", "indent");
156

    
157
        /// <summary>QName identifying the serialization parameter "media-type".</summary>
158

    
159
        public static readonly QName MEDIA_TYPE =
160
            new QName("", "media-type");
161

    
162
        /// <summary>QName identifying the serialization parameter "normalization-form"</summary>
163

    
164
        public static readonly QName NORMALIZATION_FORM =
165
            new QName("", "normalization-form");
166

    
167
        /// <summary>QName identifying the serialization parameter "omit-xml-declaration".
168
        /// The value is the string "yes" or "no".</summary>
169

    
170
        public static readonly QName OMIT_XML_DECLARATION =
171
            new QName("", "omit-xml-declaration");
172

    
173
        /// <summary>QName identifying the serialization parameter "standalone".
174
        /// The value is the string "yes" or "no" or "omit".</summary>
175

    
176
        public static readonly QName STANDALONE =
177
            new QName("", "standalone");
178

    
179
        /// <summary>QName identifying the serialization parameter "suppress-indentation"
180
        /// (introduced in XSLT/XQuery 3.0). Previously available as "saxon:suppress-indentation"
181
        /// The value is the string "yes" or "no" or "omit".</summary>
182

    
183
        public static readonly QName SUPPRESS_INDENTATION =
184
            new QName("", "suppress-indentation");
185

    
186
        /// <summary>QName identifying the serialization parameter "undeclare-prefixes".
187
        /// The value is the string "yes" or "no".</summary>
188

    
189
        public static readonly QName UNDECLARE_PREFIXES =
190
            new QName("", "undeclare-prefixes");
191

    
192
        /// <summary>QName identifying the serialization parameter "use-character-maps".
193
        /// This is available only with XSLT. The value of the parameter is a list of expanded QNames
194
        /// in Clark notation giving the names of character maps defined in the XSLT stylesheet.</summary>
195

    
196
        public static readonly QName USE_CHARACTER_MAPS =
197
            new QName("", "use-character-maps");
198

    
199
        /// <summary>QName identifying the serialization parameter "version"</summary>
200

    
201
        public static readonly QName VERSION =
202
            new QName("", "version");
203

    
204
        private const String SAXON = NamespaceConstant.SAXON;
205

    
206

    
207
        /// <summary>QName identifying the serialization parameter "saxon:character-representation"</summary>
208

    
209

    
210
        public static readonly QName SAXON_CHARACTER_REPRESENTATION =
211
            new QName(SAXON, "saxon:character-representation");
212

    
213
        /// <summary>QName identifying the serialization parameter "saxon:indent-spaces". The value
214
        /// is an integer (represented as a string) indicating the amount of indentation required.
215
        /// If specified, this parameter overrides indent="no".</summary>
216

    
217
        public static readonly QName SAXON_INDENT_SPACES =
218
            new QName(SAXON, "saxon:indent-spaces");
219

    
220
        /// <summary>QName identifying the serialization parameter "saxon:double-space". The value of this 
221
        /// parameter is given as a space-separated list of expanded QNames in Clark notation, that is 
222
        /// "{uri}local"; each QName identifies an element that should be preceded by an extra blank line within
223
        /// indented output.</summary>
224

    
225
        public static readonly QName SAXON_DOUBLE_SPACE =
226
            new QName(SAXON, "saxon:double-space");
227

    
228
        /// <summary>QName identifying the serialization parameter "saxon:double-space". The value of this 
229
        /// parameter is given as a space-separated list of expanded QNames in Clark notation, that is 
230
        /// "{uri}local"; each QName identifies an element whose content should not be indented even when
231
        /// indent=yes is specified.</summary>
232

    
233
        public static readonly QName SAXON_SUPPRESS_INDENTATION =
234
            new QName(SAXON, "saxon:suppress-indentation");
235

    
236
        /// <summary>QName identifying the serialization parameter "saxon:next-in-chain". This
237
        /// is available only with XSLT, and identifies the URI of a stylesheet that is to be used to
238
        /// process the results before passing them to their final destination.</summary>
239

    
240
        public static readonly QName NEXT_IN_CHAIN =
241
            new QName(SAXON, "saxon:next-in-chain");
242

    
243
        /// <summary>QName identifying the serialization parameter "saxon:require-well-formed". The
244
        /// value is the string "yes" or "no". If set to "yes", the output must be a well-formed
245
        /// document, or an error will be reported. ("Well-formed" here means that the document node
246
        /// must have exactly one element child, and no text node children other than whitespace-only
247
        /// text nodes).</summary>
248

    
249
        public static readonly QName SAXON_REQUIRE_WELL_FORMED =
250
            new QName(SAXON, "saxon:require-well-formed");
251

    
252

    
253
        /// <summary>Create a Serializer</summary>
254

    
255
        public Serializer()
256
        {
257
        }
258

    
259
        /// <summary>Set a serialization property</summary>
260
        /// <remarks>In the case of XSLT, properties set within the serializer override
261
        /// any properties set in <c>xsl:output</c> declarations in the stylesheet.
262
        /// Similarly, with XQuery, they override any properties set in the Query
263
        /// prolog using <c>declare option saxon:output</c>.</remarks>
264
        /// <example>
265
        ///   <code>
266
        ///     Serializer qout = new Serializer();
267
        ///     qout.SetOutputProperty(Serializer.METHOD, "xml");
268
        ///     qout.SetOutputProperty(Serializer.INDENT, "yes");
269
        ///     qout.SetOutputProperty(Serializer.SAXON_INDENT_SPACES, "1");
270
        ///   </code>
271
        /// </example> 
272
        /// <param name="name">The name of the serialization property to be set</param>
273
        /// <param name="value">The value to be set for the serialization property. May be null
274
        /// to unset the property (that is, to set it back to the default value).</param>
275

    
276
        public void SetOutputProperty(QName name, String value)
277
        {
278
            props.setProperty(name.ClarkName, value);
279
        }
280

    
281
        /// <summary>Specify the destination of the serialized output, in the
282
        /// form of a file name</summary>
283
        /// <param name="filename">The name of the file to receive the serialized output</param>
284
        /// <exception>Throws a <c>DynamicError</c> if it is not possible to create an output
285
        /// stream to write to this file, for example, if the filename is in a directory
286
        /// that does not exist.</exception>
287

    
288
        public void SetOutputFile(String filename)
289
        {
290
            try
291
            {
292
                outputStream = new JFileOutputStream(filename);
293
                mustClose = true;
294
            }
295
            catch (java.io.IOException err)
296
            {
297
                JXPathException e = new JXPathException(err);
298
                throw new DynamicError(e);
299
            }
300
        }
301

    
302
        /// <summary>Specify the destination of the serialized output, in the
303
        /// form of a <c>Stream</c></summary>
304
        /// <remarks>Saxon will not close the stream on completion; this is the
305
        /// caller's responsibility.</remarks>
306
        /// <param name="stream">The stream to which the output will be written.
307
        /// This must be a stream that allows writing.</param>
308

    
309
        public void SetOutputStream(Stream stream)
310
        {
311
            outputStream = new DotNetOutputStream(stream);
312
            mustClose = false;
313
        }
314

    
315
        /// <summary>Specify the destination of the serialized output, in the
316
        /// form of a <c>TextWriter</c></summary>
317
        /// <remarks>Note that when writing to a <c>TextWriter</c>, character encoding is
318
        /// the responsibility of the <c>TextWriter</c>, not the <c>Serializer</c>. This
319
        /// means that the encoding requested in the output properties is ignored; it also
320
        /// means that characters that cannot be represented in the target encoding will
321
        /// use whatever fallback representation the <c>TextWriter</c> defines, rather than
322
        /// being represented as XML character references.</remarks>
323
        /// <param name="textWriter">The stream to which the output will be written.
324
        /// This must be a stream that allows writing. Saxon will not close the
325
        /// <c>textWriter</c> on completion; this is the caller's responsibility.</param>
326

    
327
        public void SetOutputWriter(TextWriter textWriter)
328
        {
329
            writer = new DotNetWriter(textWriter);
330
            mustClose = false;
331
        }
332

    
333
        internal JReceiver GetReceiver(JConfiguration config)
334
        {
335
            JPipelineConfiguration pipe = config.makePipelineConfiguration();
336
            return config.getSerializerFactory().getReceiver(
337
                    GetResult(pipe),
338
                    pipe,
339
                    GetOutputProperties());
340

    
341
        }
342

    
343

    
344
        /// <summary inherit="yes"/>
345

    
346
        public override JResult GetResult(JPipelineConfiguration pipe)
347
        {
348
            if (outputStream != null)
349
            {
350
                return new JStreamResult(outputStream);
351
            }
352
            else if (writer != null)
353
            {
354
                return new JStreamResult(writer);
355
            }
356
            else
357
            {
358
                return new JStreamResult(new DotNetWriter(Console.Out));
359
            }
360
        }
361

    
362
        /// <summary inherit="yes"/>
363

    
364
        public override JProperties GetOutputProperties()
365
        {
366
            return props;
367
        }
368

    
369
        /// <summary inherit="yes"/>
370

    
371
        public override void Close()
372
        {
373
            if (mustClose)
374
            {
375
                if (outputStream != null)
376
                {
377
                    outputStream.close();
378
                }
379
                if (writer != null)
380
                {
381
                    writer.close();
382
                }
383
            }
384
        }
385
    }
386

    
387
    /// <summary>
388
    /// A <c>DomDestination</c> represents an XmlDocument that is constructed to hold the
389
    /// output of a query or transformation.
390
    /// </summary>
391
    /// <remarks>
392
    /// No data needs to be supplied to the <c>DomDestination</c> object. The query or transformation
393
    /// populates an <c>XmlDocument</c>, which may then be retrieved as the value of the <c>XmlDocument</c>
394
    /// property
395
    /// </remarks>
396

    
397
    public class DomDestination : XmlDestination
398
    {
399

    
400
        internal DotNetDomBuilder builder;
401

    
402
        /// <summary>Construct a <c>DomDestination</c></summary>
403
        /// <remarks>With this constructor, the system will create a new DOM Document
404
        /// to act as the destination of the query or transformation results. The document
405
        /// node of the new document may be retrieved via the XmlDocument property.</remarks>
406

    
407
        public DomDestination()
408
        {
409
            builder = new DotNetDomBuilder();
410
        }
411

    
412
        /// <summary>Construct a <c>DomDestination</c> based on an existing Document node.</summary>
413
        /// <remarks>The new data will be added as a child of the supplied node.</remarks>
414
        /// <param name="attachmentPoint">The document node to which new contents will
415
        /// be attached. To ensure that the new document is well-formed, this document node
416
        /// should have no existing children.</param>
417

    
418
        public DomDestination(XmlDocument attachmentPoint)
419
        {
420
            builder = new DotNetDomBuilder();
421
            builder.setAttachmentPoint(attachmentPoint);
422
        }
423

    
424
        /// <summary>Construct a <c>DomDestination</c> based on an existing DocumentFragment node.</summary>
425
        /// <remarks>The new data will be added as a child of the supplied node.</remarks>
426
        /// <param name="attachmentPoint">The document fragment node to which new contents will
427
        /// be attached. The new contents will be added after any existing children.</param>
428

    
429
        public DomDestination(XmlDocumentFragment attachmentPoint)
430
        {
431
            builder = new DotNetDomBuilder();
432
            builder.setAttachmentPoint(attachmentPoint);
433
        }
434

    
435
        /// <summary>Construct a <c>DomDestination</c> based on an existing Element node.</summary>
436
        /// <remarks>The new data will be added as a child of the supplied element node.</remarks>
437
        /// <param name="attachmentPoint">The element node to which new contents will
438
        /// be attached. The new contents will be added after any existing children.</param>
439

    
440
        public DomDestination(XmlElement attachmentPoint)
441
        {
442
            builder = new DotNetDomBuilder();
443
            builder.setAttachmentPoint(attachmentPoint);
444
        }
445

    
446
        /// <summary>After construction, retrieve the constructed document node</summary>
447
        /// <remarks>If the zero-argument constructor was used, this will be a newly
448
        /// constructed document node. If the constructor supplied a document node, the
449
        /// same document node will be returned. If the constructor supplied a document fragment
450
        /// node or an element node, this method returns the <c>OwnerDocument</c> property of 
451
        /// that node.</remarks>
452

    
453
        public XmlDocument XmlDocument
454
        {
455
            get { return builder.getDocumentNode(); }
456
        }
457

    
458
        /// <summary inherit="yes"/>
459

    
460
        public override JResult GetResult(JPipelineConfiguration pipe)
461
        {
462
            return builder;
463
        }
464
    }
465

    
466
    /// <summary>
467
    /// A <c>NullDestination</c> is an XmlDestination that discards all its output.
468
    /// </summary>
469

    
470
    public class NullDestination : XmlDestination
471
    {
472
        /// <summary>Construct a <c>NullDestination</c></summary>
473

    
474
        public NullDestination()
475
        {}
476

    
477
        /// <summary inherit="yes"/>
478

    
479
        public override JResult GetResult(JPipelineConfiguration pipe)
480
        {
481
            return new JSink(pipe);
482
        }
483

    
484
    }
485

    
486
    /// <summary>
487
    /// A <c>TextWriterDestination</c> is an implementation of <c>XmlDestination</c> that wraps
488
    /// an instance of <c>XmlWriter</c>.
489
    /// </summary>
490
    /// <remarks>
491
    /// <para>The name <c>TextWriterDestination</c> is a misnomer; originally this class would
492
    /// only wrap an <c>XmlTextWriter</c>. It will now wrap any <c>XmlWriter</c>.</para>
493
    /// <para>Note that when a <c>TextWriterDestination</c> is used to process the output of a stylesheet
494
    /// or query, the output format depends only on the way the underlying <c>XmlWriter</c>
495
    /// is configured; serialization parameters present in the stylesheet or query are ignored.
496
    /// The XSLT <c>disable-output-escaping</c> option is also ignored. If serialization
497
    /// is to be controlled from the stylesheet or query, use a <c>Serializer</c> as the
498
    /// <c>Destination</c>.</para>
499
    /// </remarks>
500

    
501
    public class TextWriterDestination : XmlDestination
502
    {
503

    
504
        internal XmlWriter writer;
505
        internal bool closeAfterUse = true;
506

    
507
        /// <summary>Construct a TextWriterDestination</summary>
508
        /// <param name="writer">The <c>XmlWriter</c> that is to be notified of the events
509
        /// representing the XML document.</param>
510

    
511
        public TextWriterDestination(XmlWriter writer)
512
        {
513
            this.writer = writer;
514
        }
515

    
516
        /// <summary>
517
        /// The <c>CloseAfterUse</c> property indicates whether the underlying <c>XmlWriter</c> is closed
518
        /// (by calling its <c>Close()</c> method) when Saxon has finished writing to it. The default
519
        /// value is true, in which case <c>Close()</c> is called. If the property is set to <c>false</c>,
520
        /// Saxon will refrain from calling the <c>Close()</c> method, and merely call <c>Flush()</c>,
521
        /// which can be useful if further output is to be written to the <c>XmlWriter</c> by the application.
522
        /// </summary>
523

    
524
        public bool CloseAfterUse {
525
            get { return closeAfterUse; }
526
            set { closeAfterUse = value; }
527
        }
528

    
529
        /// <summary inherit="yes"/>
530

    
531
        public override JResult GetResult(JPipelineConfiguration pipe)
532
        {
533
            DotNetReceiver dnr = new DotNetReceiver(writer);
534
            dnr.setCloseAfterUse(closeAfterUse);
535
            return dnr;
536
            //net.sf.saxon.@event.TracingFilter filter = new net.sf.saxon.@event.TracingFilter();
537
            //filter.setUnderlyingReceiver(dnr);
538
            //return filter;
539
        }
540

    
541
    }
542

    
543

    
544
    /// <summary>
545
    /// An <c>XdmDestination</c> is an <c>XmlDestination</c> in which an <c>XdmNode</c> 
546
    /// is constructed to hold the output of a query or transformation: 
547
    /// that is, a tree using Saxon's implementation of the XDM data model
548
    /// </summary>
549
    /// <remarks>
550
    /// <para>No data needs to be supplied to the <c>XdmDestination</c> object. The query or transformation
551
    /// populates an <c>XmlNode</c>, which may then be retrieved as the value of the <c>XmlNode</c>
552
    /// property.</para>
553
    /// <para>An <c>XdmDestination</c> can be reused to hold the results of a second transformation only
554
    /// if the <c>reset</c> method is first called to reset its state.</para>
555
    /// </remarks>
556

    
557
    public class XdmDestination : XmlDestination
558
    {
559
        internal TreeModel treeModel;
560
        internal Uri baseUri;
561
        internal JBuilder builder;
562

    
563
        /// <summary>Construct an <c>XdmDestination</c></summary>
564

    
565
        public XdmDestination()
566
        {
567
            //builder = new JTinyBuilder();
568
        }
569

    
570
        ///<summary>
571
        /// The Tree Model implementation to be used for the constructed document. By default
572
        /// the TinyTree is used. The main reason for using the LinkedTree alternative is if
573
        /// updating is required (the TinyTree is not updateable)
574
        ///</summary>
575

    
576
        public TreeModel TreeModel
577
        {
578
            get
579
            {
580
                return treeModel;
581
            }
582
            set
583
            {
584
                treeModel = value;
585
            }
586
        }
587

    
588
        /// <summary>This property determines the base URI of the constructed XdmNode. 
589
        /// If the baseURI property of the XdmDestination is set before the destination is written to,
590
        /// then the constructed XdmNode will have this base URI. Setting this property after constructing the node
591
        /// has no effect.
592
        /// </summary>
593

    
594
        public Uri BaseUri
595
        {
596
            get { return baseUri; }
597
            set { baseUri = value; }
598
        }
599

    
600

    
601
        /// <summary>Reset the state of the <c>XdmDestination</c> so that it can be used to hold
602
        /// the result of another query or transformation.</summary>
603

    
604
        public void Reset()
605
        {
606
            builder = null;
607
        }
608

    
609
        /// <summary>After construction, retrieve the constructed document node</summary>
610
        /// <remarks>
611
        /// <para>The value of the property will be null if no data has been written to the
612
        /// XdmDestination, either because the process that writes to the destination has not
613
        /// yet been run, or because the process produced no output.</para>
614
        /// </remarks>
615

    
616
        public XdmNode XdmNode
617
        {
618
            get
619
            {
620
                NodeInfo node = builder.getCurrentRoot();
621
                return (node == null ? null : (XdmNode)XdmValue.Wrap(builder.getCurrentRoot()));
622
            }
623
        }
624

    
625
        /// <summary inherit="yes"/>
626

    
627
        public override JResult GetResult(JPipelineConfiguration pipe)
628
        {
629
            builder = (treeModel == TreeModel.TinyTree ? (JBuilder)new JTinyBuilder(pipe) : (JBuilder)new JLinkedTreeBuilder(pipe));
630
            if (baseUri != null)
631
            {
632
                builder.setBaseURI(baseUri.ToString());
633
            }
634
            return builder;
635
        }
636
    }
637

    
638

    
639
}
640

    
641
//
642
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
643
// you may not use this file except in compliance with the License. You may obtain a copy of the
644
// License at http://www.mozilla.org/MPL/
645
//
646
// Software distributed under the License is distributed on an "AS IS" basis,
647
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
648
// See the License for the specific language governing rights and limitations under the License.
649
//
650
// The Original Code is: all this file.
651
//
652
// The Initial Developer of the Original Code is Michael H. Kay.
653
//
654
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
655
//
656
// Contributor(s): none.
657
//
(2-2/12)