[jdom-interest] Getting String from a Document

Thomas M. Sasala tsasala at hifusion.com
Thu Jun 15 14:00:57 PDT 2000


	StringBufferInputStream is deprecated.  I should of
mentioned that.  Why is it deprecated?

	-T

Jason Hunter wrote:
> 
> >         On the flip side, is there an easy way
> > to turn a string into a document?  We're using a
> > ByteArrayInputStream now, but that seems a bit
> > klunky and kludgy to me.
> 
> Use a StringBufferInputStream.  That's not too klunky.  Right now
> SAXBuilder.build(String) assumes the string is a systemID so it wouldn't
> be very easy to have a build that took a string representing a
> document.  I think using SBIS is fine.
> 
> > Also, why assume that
> > all input sources of XML data are going to be
> > 8-bit input streams?  What if the input source
> > is a serialized string?  That's 16-bit unicode.
> 
> I doubt Java serializes strings using UCS-2.  I suspect it's more likely
> UTF-8.  But regardless, you wouldn't want a build() that takes as input
> a reference to a serialized string (which would of course be an
> InputStream).
> 
> > The Stream verses Reader goes all the way
> > back to the Xerces and DOM tho....
> 
> Well, we have a SAXBuilder.build(Reader) method.
> 
> -jh-
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

Received: from Vega.FMF.Uni-Lj.Si (SYSTEM at vega.fmf.uni-lj.si [193.2.67.45])
	by dorothy.denveronline.net (8.9.3/8.9.3) with ESMTP id DAA21054
	for <jdom-interest at jdom.org>; Thu, 15 Jun 2000 03:10:54 -0600 (MDT)
Received: from student.fmf.uni-lj.si (194.152.5.41) by Vega.FMF.Uni-Lj.Si (MX
          V5.1-3 AnDt) with ESMTP for <jdom-interest at jdom.org>;
          Thu, 15 Jun 2000 11:10:24 +0100
Message-ID: <39489DAB.8C3332FC at student.fmf.uni-lj.si>
Date: Thu, 15 Jun 2000 11:11:07 +0200
From: Simon Rade <Simon.Rade at student.fmf.uni-lj.si>
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: en,sl
MIME-Version: 1.0
To: jdom-interest at jdom.org
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: [jdom-interest] NoSuch*Exceptions in JDOM
Sender: jdom-interest-admin at jdom.org
Errors-To: jdom-interest-admin at jdom.org
X-BeenThere: jdom-interest at jdom.org
X-Mailman-Version: 2.0beta2
Precedence: bulk
List-Id: JDOM Mailing List for General Issues and Updates <jdom-interest.jdom.org>

Hi!

Element's methods getAttribute() and getChild() now throws 
NoSuchElementException and NoSuchAttributeException.
Do you think this is better than returning null in such cases?
Since it often happens that you don't know whether child or attribute 
exists and it is very awkward to handle those Exceptions.


Bye,
Simon

Received: from smtp2.nikoma.de (smtp2.nikoma.de [212.122.128.25])
	by dorothy.denveronline.net (8.9.3/8.9.3) with ESMTP id GAA24643
	for <jdom-interest at jdom.org>; Thu, 15 Jun 2000 06:37:41 -0600 (MDT)
Received: from erde (dialin236-nt.pg10.frankfurt.nikoma.de [213.54.41.236])
	by smtp2.nikoma.de (8.9.3/8.9.3) with SMTP id OAA16660
	for <jdom-interest at jdom.org>; Thu, 15 Jun 2000 14:37:38 +0200 (CEST)
	(envelope-from bcevc at gmx.net)
From: "Baltasar Cevc" <bcevc at gmx.net>
To: <jdom-interest at jdom.org>
Date: Thu, 15 Jun 2000 14:37:59 +0200
Message-ID: <000001bfd6c6$89fa1580$0101a8c0 at erde>
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0001_01BFD6D7.4D82E580"
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700
Subject: [jdom-interest] PrettyPrinter compile error in JBuilder 3.5 professional
Sender: jdom-interest-admin at jdom.org
Errors-To: jdom-interest-admin at jdom.org
X-BeenThere: jdom-interest at jdom.org
X-Mailman-Version: 2.0beta2
Precedence: bulk
List-Id: JDOM Mailing List for General Issues and Updates <jdom-interest.jdom.org>

This is a multi-part message in MIME format.

------=_NextPart_000_0001_01BFD6D7.4D82E580
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: base64

SGVsbG8sIEZvbGtzIQ0KDQpXaGVuIEkgdHJ5IHRvIGNvbXBpbGUgUHJldHR5UHJpbnRlciBpbiB0
aGUgSkJ1aWxkZXIgRW52aXJvbm1lbnQgZnJvbSBCb3JsYW5kL0lucHJpc2UsIEkgZ2V0IHRoZSBm
b2xsb3dpbmcgZXJyb3IgbWVzc2FnZS4gSSB1c2VkIEpET00gc291cmNlIGRpc3RyaWJ1dGlvbiBi
ZXRhIDQsIHNvIHRoZSBuZXdlc3Qgb25lLCBhcyBmYXIgYXMgSSBrbm93Lg0KQXMgSSBhbSBjb21w
bGV0ZWx5IG5ldyB0byBKYXZhLCBJIGRvbid0IGtub3cgd2hhdCBkbyBkbzsgSSB0cmllZCB0byBp
bmNsdWRlIFNheCAxIG9yIDIsIGJ1dCBpdCBkaWRuJ3QgY2hhbmdlIGFueXRoaW5nLiANCg0KIlNh
eEJ1aWxkZXIuamF2YSI6IEVycm9yICMzMDI6IE5vIGFjY2VzcyB0byBjbGFzcyBvcmcueG1sLnNh
eC5leHQuTGV4aWNhbEhhbmRsZXI7IEZvciBvcmcueG1sLnNheC5leHQuTGV4aWNhbEhhbmRsZXIg
bm8gY2xhc3Mgb3Igc291cmNlIHdlcmUgZm91bmQgaW4gbGluZSAxNDcsIGNvbHVtbiAyNA0KIlNh
eEJ1aWxkZXIuamF2YSI6IEVycm9yICMzMDA6IENsYXNzIExleGljYWxIYW5kbGVyIHdhcyBub3Qg
Zm91bmQgaW4gY2xhc3Mgb3JnLmpkb20uaW5wdXQuU0FYSGFuZGxlciBpbiBsaW5lIDcyNSwgY29s
dW1uIDUyDQoNClRoYW54IGZvciBoZWxwIC4uLg0KDQpCYWx0YXNhcg0KDQo=

------=_NextPart_000_0001_01BFD6D7.4D82E580
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: base64

PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBXMyB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