/// <summary> /// Return a <c>Receiver</c>. Saxon calls this method to obtain a Java <c>Receiver</c>, to which it then sends /// a sequence of events representing the content of an XML document. The method is intended /// primarily for internal use, and may give poor diagnostics if used incorrectly. /// </summary> /// <returns>The receiver</returns> /// <param name="pipe">The Saxon configuration as a <c>JPipelineConfiguration</c>. /// This is supplied so that the destination can /// use information from the configuration (for example, a reference to the name pool) /// to construct or configure the returned <c>Receiver</c>.</param> public JReceiver GetReceiver(JPipelineConfiguration pipe, JSerializationProperties params1) { JDotNetReceiver dnr = new JDotNetReceiver(writer); dnr.setPipelineConfiguration(pipe); dnr.setCloseAfterUse(closeAfterUse); return(params1.makeSequenceNormalizer(dnr)); }
/// <summary> /// Send the node (that is, the subtree rooted at this node) to an <c>XmlTextWriter</c> /// </summary> /// <remarks> /// Note that a <c>XmlTextWriter</c> can only handle a well-formed XML document. This method /// will therefore signal an exception if the node is a document node with no children, or with /// more than one element child. /// </remarks> public void WriteTo(XmlTextWriter writer) { NodeInfo node = ((NodeInfo)value); DotNetReceiver receiver = new DotNetReceiver(writer); receiver.setPipelineConfiguration(node.getConfiguration().makePipelineConfiguration()); receiver.open(); node.copy(receiver, 2, false, 0); receiver.close(); }
/// <summary> /// Return a Receiver. Saxon calls this method to obtain a Java Receiver, to which it then sends /// a sequence of events representing the content of an XML document. The method is intended /// primarily for internal use, and may give poor diagnostics if used incorrectly. /// </summary> /// <returns>The receiver.</returns> /// <param name="pipe">JPipelineConfiguration. The Saxon configuration. This is supplied so that the destination can /// use information from the configuration (for example, a reference to the name pool) /// to construct or configure the returned Receiver.</param> public override JReceiver GetReceiver(JPipelineConfiguration pipe) { JDotNetReceiver dnr = new JDotNetReceiver(writer); dnr.setPipelineConfiguration(pipe); dnr.setCloseAfterUse(closeAfterUse); return(dnr); //[email protected] filter = new [email protected](); //filter.setUnderlyingReceiver(dnr); //return filter; }
/// <summary> /// Send the node (that is, the subtree rooted at this node) to an <c>XmlWriter</c> /// </summary> /// <remarks> /// Note that a <c>XmlWriter</c> can only handle a well-formed XML document. This method /// will therefore signal an exception if the node is a document node with no children, or with /// more than one element child. /// </remarks> /// <param name="writer"> /// The <c>XmlWriter</c> to which the node is to be written /// </param> public void WriteTo(XmlWriter writer) { NodeInfo node = ((NodeInfo)value); DotNetReceiver receiver = new DotNetReceiver(writer); receiver.setPipelineConfiguration(node.getConfiguration().makePipelineConfiguration()); receiver.open(); node.copy(receiver, net.sf.saxon.om.CopyOptions.ALL_NAMESPACES, 0); receiver.close(); }