| Home » Archived » XML Schema Definition (XSD) » org.apache.xml.serialize.OutputFormat
 Goto Forum:| 
| org.apache.xml.serialize.OutputFormat [message #21132] | Sun, 04 May 2003 18:44  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: paechoi.earthlink.net 
 In the org.eclipse.xsd.util.XSDResourceImpl class, I see the
 doSerialize() method that handles the output format for the
 serializer.
 
 Is there a way we can create the instance of
 org.apache.xml.serialize.OutputFormat and pass it into the
 serializer? If not, can we add a method that does for this
 need? Something like:
 
 public static void doSerialize(OutputStream outputStream, OutputFormat
 outputFormat, Element element) throws IOException
 
 In this way the user can have more flexibility as well as provide
 an alternative way to access the xml declaration, <?xml ... ?>.
 
 Thank you.
 
 Regards,
 
 
 Pae
 |  |  |  |  | 
| Re: org.apache.xml.serialize.OutputFormat [message #21230 is a reply to message #21132] | Mon, 05 May 2003 06:58   |  | 
| Eclipse User  |  |  |  |  | Originally posted by: merks.ca.ibm.com 
 --------------21B9A48EFD42661211AB8FDB
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Pae,
 
 The latest driver has this overloaded version to make the encoding easy to
 specify:
 
 public static void doSerialize(OutputStream outputStream,
 Element element, String encoding) throws IOException
 {
 OutputFormat outputFormat = new
 OutputFormat(element.getOwnerDocument());
 outputFormat.setLineWidth(80);
 outputFormat.setIndenting(true);
 outputFormat.setIndent(4);
 outputFormat.setPreserveSpace(false);
 outputFormat.setEncoding(encoding);
 XMLSerializer serializer = new XMLSerializer(outputStream,
 outputFormat);
 serializer.serialize(element);
 }
 
 It seems to me that if you already have an output format, you may as well
 use an XMLSerializer directly...
 
 
 Pae Choi wrote:
 
 > In the org.eclipse.xsd.util.XSDResourceImpl class, I see the
 > doSerialize() method that handles the output format for the
 > serializer.
 >
 > Is there a way we can create the instance of
 > org.apache.xml.serialize.OutputFormat and pass it into the
 > serializer? If not, can we add a method that does for this
 > need? Something like:
 >
 > public static void doSerialize(OutputStream outputStream, OutputFormat
 > outputFormat, Element element) throws IOException
 >
 > In this way the user can have more flexibility as well as provide
 > an alternative way to access the xml declaration, <?xml ... ?>.
 >
 > Thank you.
 >
 > Regards,
 >
 > Pae
 
 --------------21B9A48EFD42661211AB8FDB
 Content-Type: text/html; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
 <html>
 Pae,
 <p>The latest driver has this overloaded version to make the encoding easy
 to specify:
 <blockquote>  public static void doSerialize(OutputStream outputStream,
 Element element, String encoding) throws IOException
 <br>  {
 <br>    OutputFormat outputFormat = new OutputFormat(element.getOwnerDocument());
 <br>    outputFormat.setLineWidth(80);
 <br>    outputFormat.setIndenting(true);
 <br>    outputFormat.setIndent(4);
 <br>    outputFormat.setPreserveSpace(false);
 <br>    outputFormat.setEncoding(encoding);
 <br>    XMLSerializer serializer = new XMLSerializer(outputStream,
 outputFormat);
 <br>    serializer.serialize(element);
 <br>  }</blockquote>
 It seems to me that if you already have an output format, you may as well
 use an XMLSerializer directly...
 <br> 
 <p>Pae Choi wrote:
 <blockquote TYPE=CITE>In the org.eclipse.xsd.util.XSDResourceImpl class,
 I see the
 <br>doSerialize() method that handles the output format for the
 <br>serializer.
 <p>Is there a way we can create the instance of
 <br>org.apache.xml.serialize.OutputFormat and pass it into the
 <br>serializer? If not, can we add a method that does for this
 <br>need? Something like:
 <p>public static void doSerialize(OutputStream outputStream, OutputFormat
 <br>outputFormat, Element element) throws IOException
 <p>In this way the user can have more flexibility as well as provide
 <br>an alternative way to access the xml declaration, <?xml ... ?>.
 <p>Thank you.
 <p>Regards,
 <p>Pae</blockquote>
 </html>
 
 --------------21B9A48EFD42661211AB8FDB--
 |  |  |  |  | 
| Re: org.apache.xml.serialize.OutputFormat [message #21268 is a reply to message #21230] | Mon, 05 May 2003 07:49  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: paechoi.earthlink.net 
 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_005F_01C312DA.E0030290
 Content-Type: text/plain;
 charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable
 
 Ed,
 
 I know I am not going and am not expecting to get everything I ask. :-)
 
 Regards,
 
 
 Pae
 
 "Ed Merks" <merks@ca.ibm.com> wrote in message =
 news:3EB643DD.C173543A@ca.ibm.com...
 Pae,=20
 The latest driver has this overloaded version to make the encoding =
 easy to specify:=20
 
 public static void doSerialize(OutputStream outputStream, Element =
 element, String encoding) throws IOException=20
 {=20
 OutputFormat outputFormat =3D new =
 OutputFormat(element.getOwnerDocument());=20
 outputFormat.setLineWidth(80);=20
 outputFormat.setIndenting(true);=20
 outputFormat.setIndent(4);=20
 outputFormat.setPreserveSpace(false);=20
 outputFormat.setEncoding(encoding);=20
 XMLSerializer serializer =3D new XMLSerializer(outputStream, =
 outputFormat);=20
 serializer.serialize(element);=20
 }
 It seems to me that if you already have an output format, you may as =
 well use an XMLSerializer directly...=20
 =20
 Pae Choi wrote:=20
 
 In the org.eclipse.xsd.util.XSDResourceImpl class, I see the=20
 doSerialize() method that handles the output format for the=20
 serializer.=20
 Is there a way we can create the instance of=20
 org.apache.xml.serialize.OutputFormat and pass it into the=20
 serializer? If not, can we add a method that does for this=20
 need? Something like:=20
 
 public static void doSerialize(OutputStream outputStream, =
 OutputFormat=20
 outputFormat, Element element) throws IOException=20
 
 In this way the user can have more flexibility as well as provide=20
 an alternative way to access the xml declaration, <?xml ... ?>.=20
 
 Thank you.=20
 
 Regards,=20
 
 Pae
 
 
 ------=_NextPart_000_005F_01C312DA.E0030290
 Content-Type: text/html;
 charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <HTML><HEAD>
 <META http-equiv=3DContent-Type content=3D"text/html; =
 charset=3Diso-8859-1">
 <META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
 <STYLE></STYLE>
 </HEAD>
 <BODY bgColor=3D#ffffff>
 <DIV><FONT size=3D2>Ed,</FONT></DIV>
 <DIV><FONT size=3D2></FONT> </DIV>
 <DIV><FONT size=3D2>I know I am not going and am not expecting to get =
 everything I=20
 ask. :-)</FONT></DIV>
 <DIV><FONT size=3D2></FONT> </DIV>
 <DIV><FONT size=3D2>Regards,</FONT></DIV>
 <DIV><FONT size=3D2></FONT> </DIV>
 <DIV><FONT size=3D2></FONT> </DIV>
 <DIV><FONT size=3D2>Pae</FONT></DIV>
 <DIV><FONT size=3D2></FONT> </DIV>
 <BLOCKQUOTE dir=3Dltr=20
 style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
 BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
 <DIV>"Ed Merks" <<A =
 href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>>=20
 wrote in message <A=20
 =
 href=3D"news:3EB643DD.C173543A@ca.ibm.com">news:3EB643DD.C173543A@ca.ibm.=
 com</A>...</DIV>Pae,=20
 
 <P>The latest driver has this overloaded version to make the encoding =
 easy to=20
 specify:=20
 <BLOCKQUOTE>  public static void doSerialize(OutputStream =
 outputStream,=20
 Element element, String encoding) throws IOException <BR>  {=20
 <BR>    OutputFormat outputFormat =3D new=20
 OutputFormat(element.getOwnerDocument()); <BR>   =20
 outputFormat.setLineWidth(80); <BR>   =20
 outputFormat.setIndenting(true); <BR>   =20
 outputFormat.setIndent(4); <BR>   =20
 outputFormat.setPreserveSpace(false); <BR>   =20
 outputFormat.setEncoding(encoding); <BR>    =
 XMLSerializer=20
 serializer =3D new XMLSerializer(outputStream, outputFormat);=20
 <BR>    serializer.serialize(element); <BR> =20
 }</BLOCKQUOTE>It seems to me that if you already have an output =
 format, you=20
 may as well use an XMLSerializer directly... <BR> =20
 <P>Pae Choi wrote:=20
 <BLOCKQUOTE TYPE=3D"CITE">In the org.eclipse.xsd.util.XSDResourceImpl =
 class, I=20
 see the <BR>doSerialize() method that handles the output format for =
 the=20
 <BR>serializer.=20
 <P>Is there a way we can create the instance of=20
 <BR>org.apache.xml.serialize.OutputFormat and pass it into the=20
 <BR>serializer? If not, can we add a method that does for this =
 <BR>need?=20
 Something like:=20
 <P>public static void doSerialize(OutputStream outputStream, =
 OutputFormat=20
 <BR>outputFormat, Element element) throws IOException=20
 <P>In this way the user can have more flexibility as well as provide =
 <BR>an=20
 alternative way to access the xml declaration, <?xml ... ?>.=20
 <P>Thank you.=20
 <P>Regards,=20
 <P>Pae</P></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
 
 ------=_NextPart_000_005F_01C312DA.E0030290--
 |  |  |  |  | 
| Re: org.apache.xml.serialize.OutputFormat [message #570154 is a reply to message #21132] | Mon, 05 May 2003 06:58  |  | 
| Eclipse User  |  |  |  |  | --------------21B9A48EFD42661211AB8FDB Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Pae,
 
 The latest driver has this overloaded version to make the encoding easy to
 specify:
 
 public static void doSerialize(OutputStream outputStream,
 Element element, String encoding) throws IOException
 {
 OutputFormat outputFormat = new
 OutputFormat(element.getOwnerDocument());
 outputFormat.setLineWidth(80);
 outputFormat.setIndenting(true);
 outputFormat.setIndent(4);
 outputFormat.setPreserveSpace(false);
 outputFormat.setEncoding(encoding);
 XMLSerializer serializer = new XMLSerializer(outputStream,
 outputFormat);
 serializer.serialize(element);
 }
 
 It seems to me that if you already have an output format, you may as well
 use an XMLSerializer directly...
 
 
 Pae Choi wrote:
 
 > In the org.eclipse.xsd.util.XSDResourceImpl class, I see the
 > doSerialize() method that handles the output format for the
 > serializer.
 >
 > Is there a way we can create the instance of
 > org.apache.xml.serialize.OutputFormat and pass it into the
 > serializer? If not, can we add a method that does for this
 > need? Something like:
 >
 > public static void doSerialize(OutputStream outputStream, OutputFormat
 > outputFormat, Element element) throws IOException
 >
 > In this way the user can have more flexibility as well as provide
 > an alternative way to access the xml declaration, <?xml ... ?>.
 >
 > Thank you.
 >
 > Regards,
 >
 > Pae
 
 --------------21B9A48EFD42661211AB8FDB
 Content-Type: text/html; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
 <html>
 Pae,
 <p>The latest driver has this overloaded version to make the encoding easy
 to specify:
 <blockquote>  public static void doSerialize(OutputStream outputStream,
 Element element, String encoding) throws IOException
 <br>  {
 <br>    OutputFormat outputFormat = new OutputFormat(element.getOwnerDocument());
 <br>    outputFormat.setLineWidth(80);
 <br>    outputFormat.setIndenting(true);
 <br>    outputFormat.setIndent(4);
 <br>    outputFormat.setPreserveSpace(false);
 <br>    outputFormat.setEncoding(encoding);
 <br>    XMLSerializer serializer = new XMLSerializer(outputStream,
 outputFormat);
 <br>    serializer.serialize(element);
 <br>  }</blockquote>
 It seems to me that if you already have an output format, you may as well
 use an XMLSerializer directly...
 <br> 
 <p>Pae Choi wrote:
 <blockquote TYPE=CITE>In the org.eclipse.xsd.util.XSDResourceImpl class,
 I see the
 <br>doSerialize() method that handles the output format for the
 <br>serializer.
 <p>Is there a way we can create the instance of
 <br>org.apache.xml.serialize.OutputFormat and pass it into the
 <br>serializer? If not, can we add a method that does for this
 <br>need? Something like:
 <p>public static void doSerialize(OutputStream outputStream, OutputFormat
 <br>outputFormat, Element element) throws IOException
 <p>In this way the user can have more flexibility as well as provide
 <br>an alternative way to access the xml declaration, <?xml ... ?>.
 <p>Thank you.
 <p>Regards,
 <p>Pae</blockquote>
 </html>
 
 --------------21B9A48EFD42661211AB8FDB--
 |  |  |  |  | 
| Re: org.apache.xml.serialize.OutputFormat [message #570351 is a reply to message #21230] | Mon, 05 May 2003 07:49  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: paechoi.earthlink.net 
 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_005F_01C312DA.E0030290
 Content-Type: text/plain;
 charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable
 
 Ed,
 
 I know I am not going and am not expecting to get everything I ask. :-)
 
 Regards,
 
 
 Pae
 
 "Ed Merks" <merks@ca.ibm.com> wrote in message =
 news:3EB643DD.C173543A@ca.ibm.com...
 Pae,=20
 The latest driver has this overloaded version to make the encoding =
 easy to specify:=20
 
 public static void doSerialize(OutputStream outputStream, Element =
 element, String encoding) throws IOException=20
 {=20
 OutputFormat outputFormat =3D new =
 OutputFormat(element.getOwnerDocument());=20
 outputFormat.setLineWidth(80);=20
 outputFormat.setIndenting(true);=20
 outputFormat.setIndent(4);=20
 outputFormat.setPreserveSpace(false);=20
 outputFormat.setEncoding(encoding);=20
 XMLSerializer serializer =3D new XMLSerializer(outputStream, =
 outputFormat);=20
 serializer.serialize(element);=20
 }
 It seems to me that if you already have an output format, you may as =
 well use an XMLSerializer directly...=20
 =20
 Pae Choi wrote:=20
 
 In the org.eclipse.xsd.util.XSDResourceImpl class, I see the=20
 doSerialize() method that handles the output format for the=20
 serializer.=20
 Is there a way we can create the instance of=20
 org.apache.xml.serialize.OutputFormat and pass it into the=20
 serializer? If not, can we add a method that does for this=20
 need? Something like:=20
 
 public static void doSerialize(OutputStream outputStream, =
 OutputFormat=20
 outputFormat, Element element) throws IOException=20
 
 In this way the user can have more flexibility as well as provide=20
 an alternative way to access the xml declaration, <?xml ... ?>.=20
 
 Thank you.=20
 
 Regards,=20
 
 Pae
 
 
 ------=_NextPart_000_005F_01C312DA.E0030290
 Content-Type: text/html;
 charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <HTML><HEAD>
 <META http-equiv=3DContent-Type content=3D"text/html; =
 charset=3Diso-8859-1">
 <META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
 <STYLE></STYLE>
 </HEAD>
 <BODY bgColor=3D#ffffff>
 <DIV><FONT size=3D2>Ed,</FONT></DIV>
 <DIV><FONT size=3D2></FONT> </DIV>
 <DIV><FONT size=3D2>I know I am not going and am not expecting to get =
 everything I=20
 ask. :-)</FONT></DIV>
 <DIV><FONT size=3D2></FONT> </DIV>
 <DIV><FONT size=3D2>Regards,</FONT></DIV>
 <DIV><FONT size=3D2></FONT> </DIV>
 <DIV><FONT size=3D2></FONT> </DIV>
 <DIV><FONT size=3D2>Pae</FONT></DIV>
 <DIV><FONT size=3D2></FONT> </DIV>
 <BLOCKQUOTE dir=3Dltr=20
 style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
 BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
 <DIV>"Ed Merks" <<A =
 href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>>=20
 wrote in message <A=20
 =
 href=3D"news:3EB643DD.C173543A@ca.ibm.com">news:3EB643DD.C173543A@ca.ibm.=
 com</A>...</DIV>Pae,=20
 
 <P>The latest driver has this overloaded version to make the encoding =
 easy to=20
 specify:=20
 <BLOCKQUOTE>  public static void doSerialize(OutputStream =
 outputStream,=20
 Element element, String encoding) throws IOException <BR>  {=20
 <BR>    OutputFormat outputFormat =3D new=20
 OutputFormat(element.getOwnerDocument()); <BR>   =20
 outputFormat.setLineWidth(80); <BR>   =20
 outputFormat.setIndenting(true); <BR>   =20
 outputFormat.setIndent(4); <BR>   =20
 outputFormat.setPreserveSpace(false); <BR>   =20
 outputFormat.setEncoding(encoding); <BR>    =
 XMLSerializer=20
 serializer =3D new XMLSerializer(outputStream, outputFormat);=20
 <BR>    serializer.serialize(element); <BR> =20
 }</BLOCKQUOTE>It seems to me that if you already have an output =
 format, you=20
 may as well use an XMLSerializer directly... <BR> =20
 <P>Pae Choi wrote:=20
 <BLOCKQUOTE TYPE=3D"CITE">In the org.eclipse.xsd.util.XSDResourceImpl =
 class, I=20
 see the <BR>doSerialize() method that handles the output format for =
 the=20
 <BR>serializer.=20
 <P>Is there a way we can create the instance of=20
 <BR>org.apache.xml.serialize.OutputFormat and pass it into the=20
 <BR>serializer? If not, can we add a method that does for this =
 <BR>need?=20
 Something like:=20
 <P>public static void doSerialize(OutputStream outputStream, =
 OutputFormat=20
 <BR>outputFormat, Element element) throws IOException=20
 <P>In this way the user can have more flexibility as well as provide =
 <BR>an=20
 alternative way to access the xml declaration, <?xml ... ?>.=20
 <P>Thank you.=20
 <P>Regards,=20
 <P>Pae</P></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
 
 ------=_NextPart_000_005F_01C312DA.E0030290--
 |  |  |  | 
 
 
 Current Time: Thu Oct 30 22:52:43 EDT 2025 
 Powered by FUDForum . Page generated in 0.38830 seconds |