Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #11458 > unrolled thread

Line wrapping

Started byMark <i@dontgetlotsofspamanymore.invalid>
First post2012-01-18 13:20 +0000
Last post2012-01-18 15:47 +0000
Articles 20 on this page of 21 — 3 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Line wrapping Mark <i@dontgetlotsofspamanymore.invalid> - 2012-01-18 13:20 +0000
    Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-18 09:51 -0500
      Re: Line wrapping Mark <i@dontgetlotsofspamanymore.invalid> - 2012-01-18 16:04 +0000
        Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-18 13:38 -0500
          Re: Line wrapping Mark <i@dontgetlotsofspamanymore.invalid> - 2012-01-19 09:00 +0000
            Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-19 06:26 -0500
              Re: Line wrapping Mark <i@dontgetlotsofspamanymore.invalid> - 2012-01-19 14:52 +0000
                Re: Line wrapping Mark <i@dontgetlotsofspamanymore.invalid> - 2012-01-20 10:47 +0000
                  Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-20 11:28 -0500
                    Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-20 13:33 -0500
                    Re: Line wrapping Lew <noone@lewscanon.com> - 2012-01-20 11:18 -0800
                      Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-20 15:45 -0500
                      Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-20 15:59 -0500
                    Re: Line wrapping Mark <i@dontgetlotsofspamanymore.invalid> - 2012-01-23 09:03 +0000
                      Re: Line wrapping Lew <noone@lewscanon.com> - 2012-01-23 10:15 -0800
                  Re: Line wrapping Lew <noone@lewscanon.com> - 2012-01-20 11:18 -0800
                    Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-21 02:10 -0500
                      Re: Line wrapping Lew <noone@lewscanon.com> - 2012-01-21 12:28 -0800
                  Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-20 17:17 -0500
                    Re: Line wrapping Jeff Higgins <jeff@invalid.invalid> - 2012-01-20 17:19 -0500
    Re: Line wrapping Mark <i@dontgetlotsofspamanymore.invalid> - 2012-01-18 15:47 +0000

Page 1 of 2  [1] 2  Next page →


#11458 — Line wrapping

FromMark <i@dontgetlotsofspamanymore.invalid>
Date2012-01-18 13:20 +0000
SubjectLine wrapping
Message-ID<kjhdh7lginolc5q0huf9oi9ippqost583f@4ax.com>
I need to write some code to wrap lines for printing.  The data to
print is XML.  I have not found that the classes that I have found
allow you to choose which characters are used as line breaks.
For example org.apache.xml.serialize.OutputFormat does not do this.

What class is good for this?

Right now I use the following code:

        OutputFormat format = new OutputFormat(input);
        format.setIndenting(true);
        format.setIndent(2);
        format.setLineWidth(lineLen);
        format.setLineSeparator(lineSep);
        Writer out = new StringWriter();
        XMLSerializer serializer = new XMLSerializer(out, format);
        serializer.serialize(input);
-- 
(\__/)  M.
(='.'=) Due to the amount of spam posted via googlegroups and
(")_(") their inaction to the problem. I am blocking some articles
posted from there.  If you wish your postings to be seen by
everyone you will need use a different method of posting.

[toc] | [next] | [standalone]


#11462

FromJeff Higgins <jeff@invalid.invalid>
Date2012-01-18 09:51 -0500
Message-ID<jf6lq0$9hg$1@dont-email.me>
In reply to#11458
On 01/18/2012 08:20 AM, Mark wrote:
> I need to write some code to wrap lines for printing.  The data to
> print is XML.  I have not found that the classes that I have found
> allow you to choose which characters are used as line breaks.
> For example org.apache.xml.serialize.OutputFormat does not do this.

This may be of interest.
<http://xerces.apache.org/xerces2-j/faq-general.html#faq-6>

>
> What class is good for this?
>
> Right now I use the following code:
>
>          OutputFormat format = new OutputFormat(input);
>          format.setIndenting(true);
>          format.setIndent(2);
>          format.setLineWidth(lineLen);
>          format.setLineSeparator(lineSep);
>          Writer out = new StringWriter();
>          XMLSerializer serializer = new XMLSerializer(out, format);
>          serializer.serialize(input);

[toc] | [prev] | [next] | [standalone]


#11466

FromMark <i@dontgetlotsofspamanymore.invalid>
Date2012-01-18 16:04 +0000
Message-ID<p9rdh75evr17ooiundo5k0kigdv83fuaup@4ax.com>
In reply to#11462
On Wed, 18 Jan 2012 09:51:12 -0500, Jeff Higgins
<jeff@invalid.invalid> wrote:

>On 01/18/2012 08:20 AM, Mark wrote:
>> I need to write some code to wrap lines for printing.  The data to
>> print is XML.  I have not found that the classes that I have found
>> allow you to choose which characters are used as line breaks.
>> For example org.apache.xml.serialize.OutputFormat does not do this.
>
>This may be of interest.
><http://xerces.apache.org/xerces2-j/faq-general.html#faq-6>

I've tried this code but it presents the whole XML document all in one
line.  I am trying to get some nicely formatted output for sending to
a printer.  The code snippet I posted nearly does this, except for the
line wrapping.
-- 
(\__/)  M.
(='.'=) Due to the amount of spam posted via googlegroups and
(")_(") their inaction to the problem. I am blocking some articles
posted from there.  If you wish your postings to be seen by
everyone you will need use a different method of posting.

[toc] | [prev] | [next] | [standalone]


#11471

FromJeff Higgins <jeff@invalid.invalid>
Date2012-01-18 13:38 -0500
Message-ID<jf734u$qfi$1@dont-email.me>
In reply to#11466
On 01/18/2012 11:04 AM, Mark wrote:
> On Wed, 18 Jan 2012 09:51:12 -0500, Jeff Higgins
> <jeff@invalid.invalid>  wrote:
>
>> On 01/18/2012 08:20 AM, Mark wrote:
>>> I need to write some code to wrap lines for printing.  The data to
>>> print is XML.  I have not found that the classes that I have found
>>> allow you to choose which characters are used as line breaks.
>>> For example org.apache.xml.serialize.OutputFormat does not do this.
>>
>> This may be of interest.
>> <http://xerces.apache.org/xerces2-j/faq-general.html#faq-6>
>
> I've tried this code but it presents the whole XML document all in one
> line.  I am trying to get some nicely formatted output for sending to
> a printer.  The code snippet I posted nearly does this, except for the
> line wrapping.
George Hawkins in a comment on the second answer in this question 
provided the link above. He also suggests:
writer.getDomConfig().setParameter("format-pretty-print", Boolean.TRUE);
<http://stackoverflow.com/questions/139076/how-to-pretty-print-xml-from-java>
I guess I should have pointed to this article to start but I don't know 
how to point to individual posts or comments.

[toc] | [prev] | [next] | [standalone]


#11488

FromMark <i@dontgetlotsofspamanymore.invalid>
Date2012-01-19 09:00 +0000
Message-ID<dsmfh7hdos2ojjmd47ub2bksfdv4im8ksr@4ax.com>
In reply to#11471
On Wed, 18 Jan 2012 13:38:54 -0500, Jeff Higgins
<jeff@invalid.invalid> wrote:

>On 01/18/2012 11:04 AM, Mark wrote:
>> On Wed, 18 Jan 2012 09:51:12 -0500, Jeff Higgins
>> <jeff@invalid.invalid>  wrote:
>>
>>> On 01/18/2012 08:20 AM, Mark wrote:
>>>> I need to write some code to wrap lines for printing.  The data to
>>>> print is XML.  I have not found that the classes that I have found
>>>> allow you to choose which characters are used as line breaks.
>>>> For example org.apache.xml.serialize.OutputFormat does not do this.
>>>
>>> This may be of interest.
>>> <http://xerces.apache.org/xerces2-j/faq-general.html#faq-6>
>>
>> I've tried this code but it presents the whole XML document all in one
>> line.  I am trying to get some nicely formatted output for sending to
>> a printer.  The code snippet I posted nearly does this, except for the
>> line wrapping.
>George Hawkins in a comment on the second answer in this question 
>provided the link above. He also suggests:
>writer.getDomConfig().setParameter("format-pretty-print", Boolean.TRUE);
><http://stackoverflow.com/questions/139076/how-to-pretty-print-xml-from-java>
>I guess I should have pointed to this article to start but I don't know 
>how to point to individual posts or comments.

I saw that comment but, as I could not find documentation for that
parameter, I assumed that the poster was wrong.  I will try it out but
prefer to rely on documented behaviour ;-)
-- 
(\__/)  M.
(='.'=) Due to the amount of spam posted via googlegroups and
(")_(") their inaction to the problem. I am blocking some articles
posted from there.  If you wish your postings to be seen by
everyone you will need use a different method of posting.

[toc] | [prev] | [next] | [standalone]


#11489

FromJeff Higgins <jeff@invalid.invalid>
Date2012-01-19 06:26 -0500
Message-ID<jf8u65$ukk$1@dont-email.me>
In reply to#11488
On 01/19/2012 04:00 AM, Mark wrote:
> I saw that comment but, as I could not find documentation for that
> parameter, I assumed that the poster was wrong.  I will try it out but
> prefer to rely on documented behaviour ;-)
<http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/DOMConfiguration.html>
<http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer-config>

Here's a working example. However this does not address your request for 
a configurable pretty printer.
<http://www.chipkillmar.net/2009/03/25/pretty-print-xml-from-a-dom/>

[toc] | [prev] | [next] | [standalone]


#11492

FromMark <i@dontgetlotsofspamanymore.invalid>
Date2012-01-19 14:52 +0000
Message-ID<pebgh7tjstcvntnt1u5r7ol9ui3ocadql8@4ax.com>
In reply to#11489
On Thu, 19 Jan 2012 06:26:37 -0500, Jeff Higgins
<jeff@invalid.invalid> wrote:

>On 01/19/2012 04:00 AM, Mark wrote:
>> I saw that comment but, as I could not find documentation for that
>> parameter, I assumed that the poster was wrong.  I will try it out but
>> prefer to rely on documented behaviour ;-)
><http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/DOMConfiguration.html>
><http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer-config>
>
>Here's a working example. However this does not address your request for 
>a configurable pretty printer.
><http://www.chipkillmar.net/2009/03/25/pretty-print-xml-from-a-dom/>

Thanks for this.  I had already implemented something similar to that
and I'll need to write my own line-wrapping code.


-- 
(\__/)  M.
(='.'=) Due to the amount of spam posted via googlegroups and
(")_(") their inaction to the problem. I am blocking some articles
posted from there.  If you wish your postings to be seen by
everyone you will need use a different method of posting.

[toc] | [prev] | [next] | [standalone]


#11517

FromMark <i@dontgetlotsofspamanymore.invalid>
Date2012-01-20 10:47 +0000
Message-ID<b2hih75g29o5eisec7kmqsc90e9ejb6o60@4ax.com>
In reply to#11492
On Thu, 19 Jan 2012 14:52:58 +0000, Mark
<i@dontgetlotsofspamanymore.invalid> wrote:

>On Thu, 19 Jan 2012 06:26:37 -0500, Jeff Higgins
><jeff@invalid.invalid> wrote:
>
>>On 01/19/2012 04:00 AM, Mark wrote:
>>> I saw that comment but, as I could not find documentation for that
>>> parameter, I assumed that the poster was wrong.  I will try it out but
>>> prefer to rely on documented behaviour ;-)
>><http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/DOMConfiguration.html>
>><http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer-config>
>>
>>Here's a working example. However this does not address your request for 
>>a configurable pretty printer.
>><http://www.chipkillmar.net/2009/03/25/pretty-print-xml-from-a-dom/>

Is there any known bugs that might affect this (Method 2)?  It is
throwing an Exception/Error that the documentation does not mention.
[java.lang.AbstractMethodError]
-- 
(\__/)  M.
(='.'=) Due to the amount of spam posted via googlegroups and
(")_(") their inaction to the problem. I am blocking some articles
posted from there.  If you wish your postings to be seen by
everyone you will need use a different method of posting.

[toc] | [prev] | [next] | [standalone]


#11522

FromJeff Higgins <jeff@invalid.invalid>
Date2012-01-20 11:28 -0500
Message-ID<jfc470$o9e$1@dont-email.me>
In reply to#11517
On 01/20/2012 05:47 AM, Mark wrote:
> On Thu, 19 Jan 2012 14:52:58 +0000, Mark
> <i@dontgetlotsofspamanymore.invalid>  wrote:
>
>> On Thu, 19 Jan 2012 06:26:37 -0500, Jeff Higgins
>> <jeff@invalid.invalid>  wrote:
>>
>>> On 01/19/2012 04:00 AM, Mark wrote:
>>>> I saw that comment but, as I could not find documentation for that
>>>> parameter, I assumed that the poster was wrong.  I will try it out but
>>>> prefer to rely on documented behaviour ;-)
>>> <http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/DOMConfiguration.html>
>>> <http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer-config>
>>>
>>> Here's a working example. However this does not address your request for
>>> a configurable pretty printer.
>>> <http://www.chipkillmar.net/2009/03/25/pretty-print-xml-from-a-dom/>
>
> Is there any known bugs that might affect this (Method 2)?  It is
> throwing an Exception/Error that the documentation does not mention.
> [java.lang.AbstractMethodError]

Runs as expected for me using the authors source and example xml, 
located here:

<http://www.chipkillmar.net/wp-content/uploads/2009/03/pretty-print-xml-src.jar>

and using this Java:
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8.10) (6b18-1.8.10-0+squeeze2)
OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)

the docs say "shouldn't happen at runtime, except ..."
<http://docs.oracle.com/javase/6/docs/api/java/lang/AbstractMethodError.html>

there are no Uses listed here:
<http://docs.oracle.com/javase/6/docs/api/java/lang/class-use/AbstractMethodError.html>

stacktrace?

[toc] | [prev] | [next] | [standalone]


#11525

FromJeff Higgins <jeff@invalid.invalid>
Date2012-01-20 13:33 -0500
Message-ID<jfcbi0$9h8$1@dont-email.me>
In reply to#11522
On 01/20/2012 11:28 AM, Jeff Higgins wrote:
> stacktrace?
conflicting implementation on your classpath?
See:
Java Endorsed Standards Override Mechanism
and JAXP FAQ


[toc] | [prev] | [next] | [standalone]


#11529

FromLew <noone@lewscanon.com>
Date2012-01-20 11:18 -0800
Message-ID<jfcem4$vk9$2@news.albasani.net>
In reply to#11522
Jeff Higgins wrote:
> and using this Java:
> java version "1.6.0_18"
> OpenJDK Runtime Environment (IcedTea6 1.8.10) (6b18-1.8.10-0+squeeze2)
> OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)

You're pretty far behind on security patches, aren't you?

> the docs say "shouldn't happen at runtime, except ..."
> <http://docs.oracle.com/javase/6/docs/api/java/lang/AbstractMethodError.html>
>
> there are no Uses listed here:
> <http://docs.oracle.com/javase/6/docs/api/java/lang/class-use/AbstractMethodError.html>
>
>
> stacktrace?

SSCCE?
http://sscce.org/

Come on, Mark.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

[toc] | [prev] | [next] | [standalone]


#11533

FromJeff Higgins <jeff@invalid.invalid>
Date2012-01-20 15:45 -0500
Message-ID<jfcj9u$a38$1@dont-email.me>
In reply to#11529
On 01/20/2012 02:18 PM, Lew wrote:
> Jeff Higgins wrote:
>> and using this Java:
>> java version "1.6.0_18"
>> OpenJDK Runtime Environment (IcedTea6 1.8.10) (6b18-1.8.10-0+squeeze2)
>> OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)
>
> You're pretty far behind on security patches, aren't you?
>
>> the docs say "shouldn't happen at runtime, except ..."
>> <http://docs.oracle.com/javase/6/docs/api/java/lang/AbstractMethodError.html>
>>
>>
>> there are no Uses listed here:
>> <http://docs.oracle.com/javase/6/docs/api/java/lang/class-use/AbstractMethodError.html>
>>
>>
>>
>> stacktrace?
>
> SSCCE?
> http://sscce.org/
I took the SSCCE as implied.
"...that might affect this (Method 2)?"
>
> Come on, Mark.
>

[toc] | [prev] | [next] | [standalone]


#11534

FromJeff Higgins <jeff@invalid.invalid>
Date2012-01-20 15:59 -0500
Message-ID<jfck3e$g6b$1@dont-email.me>
In reply to#11529
On 01/20/2012 02:18 PM, Lew wrote:
> Jeff Higgins wrote:
>> and using this Java:
>> java version "1.6.0_18"
>> OpenJDK Runtime Environment (IcedTea6 1.8.10) (6b18-1.8.10-0+squeeze2)
>> OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)
>
> You're pretty far behind on security patches, aren't you?
Maybe that's why it works for me and not him? Shrug. :)
Wouldn't have been the first time functionality has been broken in updates.
>
>> the docs say "shouldn't happen at runtime, except ..."
>> <http://docs.oracle.com/javase/6/docs/api/java/lang/AbstractMethodError.html>
>>
>>
>> there are no Uses listed here:
>> <http://docs.oracle.com/javase/6/docs/api/java/lang/class-use/AbstractMethodError.html>
>>
>>
>>
>> stacktrace?
>
> SSCCE?
> http://sscce.org/
>
> Come on, Mark.
>

[toc] | [prev] | [next] | [standalone]


#11582

FromMark <i@dontgetlotsofspamanymore.invalid>
Date2012-01-23 09:03 +0000
Message-ID<of8qh7lpl36iilskvvnch3qogi0lk8dsal@4ax.com>
In reply to#11522
On Fri, 20 Jan 2012 11:28:05 -0500, Jeff Higgins
<jeff@invalid.invalid> wrote:

>On 01/20/2012 05:47 AM, Mark wrote:
>> On Thu, 19 Jan 2012 14:52:58 +0000, Mark
>> <i@dontgetlotsofspamanymore.invalid>  wrote:
>>
>>> On Thu, 19 Jan 2012 06:26:37 -0500, Jeff Higgins
>>> <jeff@invalid.invalid>  wrote:
>>>
>>>> On 01/19/2012 04:00 AM, Mark wrote:
>>>>> I saw that comment but, as I could not find documentation for that
>>>>> parameter, I assumed that the poster was wrong.  I will try it out but
>>>>> prefer to rely on documented behaviour ;-)
>>>> <http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/DOMConfiguration.html>
>>>> <http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer-config>
>>>>
>>>> Here's a working example. However this does not address your request for
>>>> a configurable pretty printer.
>>>> <http://www.chipkillmar.net/2009/03/25/pretty-print-xml-from-a-dom/>
>>
>> Is there any known bugs that might affect this (Method 2)?  It is
>> throwing an Exception/Error that the documentation does not mention.
>> [java.lang.AbstractMethodError]
>
>Runs as expected for me using the authors source and example xml, 
>located here:
>
><http://www.chipkillmar.net/wp-content/uploads/2009/03/pretty-print-xml-src.jar>
>
>and using this Java:
>java version "1.6.0_18"
>OpenJDK Runtime Environment (IcedTea6 1.8.10) (6b18-1.8.10-0+squeeze2)
>OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)
>
>the docs say "shouldn't happen at runtime, except ..."
><http://docs.oracle.com/javase/6/docs/api/java/lang/AbstractMethodError.html>
>
>there are no Uses listed here:
><http://docs.oracle.com/javase/6/docs/api/java/lang/class-use/AbstractMethodError.html>
>
>stacktrace?

Thanks for the input.  The bug only manifested itself on one platform
(AIX) and I have gone back to using Xerces which works for me.  I
can't post the full test for confidentiality reasons, I'm afraid.
-- 
(\__/)  M.
(='.'=) Due to the amount of spam posted via googlegroups and
(")_(") their inaction to the problem. I am blocking some articles
posted from there.  If you wish your postings to be seen by
everyone you will need use a different method of posting.

[toc] | [prev] | [next] | [standalone]


#11583

FromLew <noone@lewscanon.com>
Date2012-01-23 10:15 -0800
Message-ID<jfk838$u3l$1@news.albasani.net>
In reply to#11582
Mark wrote:
> Thanks for the input.  The bug only manifested itself on one platform
> (AIX) and I have gone back to using Xerces which works for me.  I
> can't post the full test for confidentiality reasons, I'm afraid.

No, but then no one is asking you to.  What we *are* asking for is an SSCCE. 
Surely you can put one together without violating confidentiality. In fact, 
you need to do that for yourself just to understand what went wrong.

It makes me hot under the collar when people pull the pathetic 
"confidentiality" excuse not to go through the effort of diagnosing their 
issue. As if we needed anything confidential. Just put together a minimum case 
that demonstrates your problem.

If your situation is so very frakkin' confidential that you really cannot 
share any relevant details to your issue, don't bloody waste our time and even 
yours posting requests for help in a public, non-confidential forum. We won't 
psychically divine your answers when you won't share enough details to ask a 
meaningful or useful question.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

[toc] | [prev] | [next] | [standalone]


#11528

FromLew <noone@lewscanon.com>
Date2012-01-20 11:18 -0800
Message-ID<jfcels$vk9$1@news.albasani.net>
In reply to#11517
Mark wrote:
> Mark wrote:
>> Jeff Higgins wrote:
>>> Mark wrote:
>>>> I saw that comment but, as I could not find documentation for that
>>>> parameter, I assumed that the poster was wrong.  I will try it out but
>>>> prefer to rely on documented behaviour ;-)
>>> <http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/DOMConfiguration.html>
>>> <http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer-config>
>>>
>>> Here's a working example. However this does not address your request for
>>> a configurable pretty printer.
>>> <http://www.chipkillmar.net/2009/03/25/pretty-print-xml-from-a-dom/>
>
> Is there any known bugs that might affect this (Method 2)?  It is
> throwing an Exception/Error that the documentation does not mention.
> [java.lang.AbstractMethodError]

Now there's a load of detail, not!

'Exception's and 'Error's are different beasts. It's very sloppy to call them 
"Exception/Error".  Which?

What is the error message? What is the code? What is the stacktrace? Where's 
your simple, self-contained compilable example (SSCCE http://sscce.org/)? 
Where is *any* information about your situation that merits anyone giving any 
response?  "My arm hurts, doctor, what's wrong with me?"

Give data.  Otherwise you might as well not bother posting.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

[toc] | [prev] | [next] | [standalone]


#11557

FromJeff Higgins <jeff@invalid.invalid>
Date2012-01-21 02:10 -0500
Message-ID<jfdnu4$db8$1@dont-email.me>
In reply to#11528
On 01/20/2012 02:18 PM, Lew wrote:
> Mark wrote:
>> Mark wrote:
>>> Jeff Higgins wrote:
>>>> Mark wrote:
>>>>> I saw that comment but, as I could not find documentation for that
>>>>> parameter, I assumed that the poster was wrong. I will try it out but
>>>>> prefer to rely on documented behaviour ;-)
>>>> <http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/DOMConfiguration.html>
>>>>
>>>> <http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer-config>
>>>>
>>>>
>>>> Here's a working example. However this does not address your request
>>>> for
>>>> a configurable pretty printer.
>>>> <http://www.chipkillmar.net/2009/03/25/pretty-print-xml-from-a-dom/>
>>
>> Is there any known bugs that might affect this (Method 2)? It is
>> throwing an Exception/Error that the documentation does not mention.
>> [java.lang.AbstractMethodError]
>
> Now there's a load of detail, not!
>
> 'Exception's and 'Error's are different beasts. It's very sloppy to call
> them "Exception/Error". Which?
<http://jtf.acm.org/javadoc/student/acm/util/ErrorException.html>
>
> What is the error message? What is the code? What is the stacktrace?
> Where's your simple, self-contained compilable example (SSCCE
> http://sscce.org/)? Where is *any* information about your situation that
> merits anyone giving any response? "My arm hurts, doctor, what's wrong
> with me?"
>
> Give data. Otherwise you might as well not bother posting.
>

[toc] | [prev] | [next] | [standalone]


#11569

FromLew <noone@lewscanon.com>
Date2012-01-21 12:28 -0800
Message-ID<jff758$dh1$1@news.albasani.net>
In reply to#11557
Jeff Higgins wrote:
> Lew wrote:
>> 'Exception's and 'Error's are different beasts. It's very sloppy to call
>> them "Exception/Error". Which?
> <http://jtf.acm.org/javadoc/student/acm/util/ErrorException.html>

Cute, but a red herring. This is not an 'Error', nor claimed to be in the 
Javadocs. I concur that the name could have been better chosen.

So could its constructors. Notice that they don't even allow an 'Error' as a 
constructor argument. This must have been a deliberate choice, given that they 
could have easily carried forward the policy of the supertype constructor:
<http://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html#Exception(java.lang.String, 
java.lang.Throwable)>

So it's crystal clear that the compound name part "Error" and the document 
comments about "error" refer to the word in the natural language sense only, 
and no confusion between 'java.lang.Error' and 'java.lang.Exception' should be 
inferred.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

[toc] | [prev] | [next] | [standalone]


#11536

FromJeff Higgins <jeff@invalid.invalid>
Date2012-01-20 17:17 -0500
Message-ID<jfcolb$ird$1@dont-email.me>
In reply to#11517
On 01/20/2012 05:47 AM, Mark wrote:
> On Thu, 19 Jan 2012 14:52:58 +0000, Mark
> <i@dontgetlotsofspamanymore.invalid>  wrote:
>
>> On Thu, 19 Jan 2012 06:26:37 -0500, Jeff Higgins
>> <jeff@invalid.invalid>  wrote:
>>
>>> On 01/19/2012 04:00 AM, Mark wrote:
>>>> I saw that comment but, as I could not find documentation for that
>>>> parameter, I assumed that the poster was wrong.  I will try it out but
>>>> prefer to rely on documented behaviour ;-)
>>> <http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/DOMConfiguration.html>
>>> <http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer-config>
>>>
>>> Here's a working example. However this does not address your request for
>>> a configurable pretty printer.
>>> <http://www.chipkillmar.net/2009/03/25/pretty-print-xml-from-a-dom/>
>
> Is there any known bugs that might affect this (Method 2)?  It is
> throwing an Exception/Error that the documentation does not mention.
> [java.lang.AbstractMethodError]
Just out of curiosity, does the author's Method#3 work for you?
Upthread you say:

 >  So, what effect does »format.setLineSeparator(lineSep)« have,
 > >  then?
On the test data, none that I can see.  i.e. it produces lines longer
than that specified in setLineWidth()

It starts to sound as if you have an incompatible implementation on your 
classpath.


[toc] | [prev] | [next] | [standalone]


#11537

FromJeff Higgins <jeff@invalid.invalid>
Date2012-01-20 17:19 -0500
Message-ID<jfcopi$ird$2@dont-email.me>
In reply to#11536
On 01/20/2012 05:17 PM, Jeff Higgins wrote:
> On 01/20/2012 05:47 AM, Mark wrote:
>> On Thu, 19 Jan 2012 14:52:58 +0000, Mark
>> <i@dontgetlotsofspamanymore.invalid> wrote:
>>
>>> On Thu, 19 Jan 2012 06:26:37 -0500, Jeff Higgins
>>> <jeff@invalid.invalid> wrote:
>>>
>>>> On 01/19/2012 04:00 AM, Mark wrote:
>>>>> I saw that comment but, as I could not find documentation for that
>>>>> parameter, I assumed that the poster was wrong. I will try it out but
>>>>> prefer to rely on documented behaviour ;-)
>>>> <http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/DOMConfiguration.html>
>>>>
>>>> <http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSSerializer-config>
>>>>
>>>>
>>>> Here's a working example. However this does not address your request
>>>> for
>>>> a configurable pretty printer.
>>>> <http://www.chipkillmar.net/2009/03/25/pretty-print-xml-from-a-dom/>
>>
>> Is there any known bugs that might affect this (Method 2)? It is
>> throwing an Exception/Error that the documentation does not mention.
>> [java.lang.AbstractMethodError]
> Just out of curiosity, does the author's Method#3 work for you?
> Upthread you say:
>
>  > So, what effect does »format.setLineSeparator(lineSep)« have,
>  > > then?
> On the test data, none that I can see. i.e. it produces lines longer
> than that specified in setLineWidth()
>
> It starts to sound as if you have an incompatible implementation on your
> classpath.
                                        ^ non-default

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.java.programmer


csiph-web