[jdom-interest] Any method to clear contents of a JDOM tree from a particular no de down ?

Byrne, Padraig (Padraig) pbyrne1 at lucent.com
Thu May 16 06:43:21 PDT 2002


I use JDOM to store status information in the background in my application 
& I need to reset particular parts of JDOM tree to empty at certain times.

I am writing something to iterate through children & clear contents 
but it would have been nice if JDOM had a standard method available to perform this task.

Padraig.


-----Original Message-----
From: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org]
Sent: 16 May 2002 07:20
To: jdom-interest at jdom.org
Subject: jdom-interest digest, Vol 1 #931 - 20 msgs


Send jdom-interest mailing list submissions to
	jdom-interest at jdom.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.denveronline.net/mailman/listinfo/jdom-interest
or, via email, send a message with subject or body 'help' to
	jdom-interest-request at jdom.org

You can reach the person managing the list at
	jdom-interest-admin at jdom.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of jdom-interest digest..."


Today's Topics:

   1. Using variables in XML files (Isaac Sparrow)
   2. Re: Using variables in XML files (Ian Lea)
   3. Re: Using variables in XML files (Laurent Bihanic)
   4. passing string from jdom tree to if statement (Trond Fuglestad)
   5. RE: passing string from jdom tree to if statement (O'neil, Jerome)
   6. Re: passing string from jdom tree to if statement (root)
   7. RE: passing string from jdom tree to if statement (vonderLuft, Andrew)
   8. Re: passing string from jdom tree to if statement (Trond Fuglestad)
   9. Re: Using variables in XML files (Isaac Sparrow)
  10. DOMOutputter output-methods question! (Ralf Lorenz)
  11. JDOM Quick Reference, Appendix B of Processing XMl with Java, has
       been posted (Elliotte Rusty Harold)
  12. Order of removing old content in setChildren (Andres March)
  13. Re: DOMOutputter output-methods question! (Elliotte Rusty Harold)
  14. RE: JDOM and WSAD (vonderLuft, Andrew)
  15. Attribute constructor JavaDoc path (Elliotte Rusty Harold)
  16. Re: JDOM and WSAD (please clarify) (Andrew Forward)
  17. Re: Attribute constructor JavaDoc path (Jason Hunter)
  18. CDATA patch (Elliotte Rusty Harold)
  19. Document exception patch (Elliotte Rusty Harold)

--__--__--

Message: 1
From: Isaac Sparrow <isaac.sparrow at visicomp.com>
Organization: VisiComp, Inc.
To: jdom-interest at jdom.org
Date: Wed, 15 May 2002 00:52:58 -0700
Subject: [jdom-interest] Using variables in XML files

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I would like to use variables in my XML files. For instance take the "value" 
attribute in the following element:

<foo name="projDir" value="${user.home}" />

My question is what is the best way to replace these "variables" and when? 

One solution would be to find and replace these variables while the XML file 
is being parsed (although I don't know how). 

Does anyone have any ideas on how to use variables in an XML file while 
keeping their use hidden from other code in a application?

Thanks,
- -- 

- -------------------------------------------------------------------
Isaac Sparrow
Staff Engineer
VisiComp, Inc.
http://www.visicomp.com

GnuPG Key Fingerprint:
1060 5A07 F6EC B2B3 9AAA 3EA5 7B79 EFE1 6397 4F47
Get my public key at:
http://www.concentric.net/~issparow

I'm N-ary the tree, I am,
N-ary the tree, I am, I am.
I'm getting traversed by the parser next door,
She's traversed me seven times before.
And ev'ry time it was an N-ary (N-ary!)
Never wouldn't ever do a binary. (No sir!)
I'm 'er eighth tree that was N-ary.
N-ary the tree I am, I am,
N-ary the tree I am.
		-- Stolen from Paul Revere and the Raiders

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: NSA bad. Encryption good.

iD8DBQE84hPne3nv4WOXT0cRAuvnAKCo9r9eGs4+WOw2KoUn30dCIXAz9ACdGvuL
POru9KDYn81y1AtstCA9QGM=
=2Dv9
-----END PGP SIGNATURE-----


--__--__--

Message: 2
Date: Wed, 15 May 2002 10:54:01 +0100 (BST)
From: Ian Lea <ian at digimem.net>
To: Isaac Sparrow <isaac.sparrow at visicomp.com>
Subject: Re: [jdom-interest] Using variables in XML files
Cc: jdom-interest at jdom.org

------=_Part_4_4788315.1021456441237
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

I do this by custom code that examines, and replaces
where necessary, values for known elements after the
XML has been loaded into a JDOM document. Only works
if you know the structure of the document in advance
although I guess could work with a TreeWalker method.

An alternative might be to filter the XML input stream
through some regexp search/replace code before passing
it to the parser.



--
Ian.
ian at digimem.net

> isaac.sparrow at visicomp.com (Isaac Sparrow) wrote 
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> I would like to use variables in my XML files. For instance take the "value" 
> attribute in the following element:
> 
> <foo name="projDir" value="${user.home}" />
> 
> My question is what is the best way to replace these "variables" and when? 
> 
> One solution would be to find and replace these variables while the XML file 
> is being parsed (although I don't know how). 
> 
> Does anyone have any ideas on how to use variables in an XML file while 
> keeping their use hidden from other code in a application?

----------------------------------------------------------------------
Searchable personal storage and archiving from http://www.digimem.net/

------=_Part_4_4788315.1021456441237--


--__--__--

Message: 3
Date: Wed, 15 May 2002 15:20:41 +0200
From: Laurent Bihanic <laurent.bihanic at atosorigin.com>
To: Isaac Sparrow <isaac.sparrow at visicomp.com>
CC: jdom-interest at jdom.org
Subject: Re: [jdom-interest] Using variables in XML files


Isaac Sparrow wrote:
> One solution would be to find and replace these variables while the XML file 
> is being parsed (although I don't know how). 
> 
You could use a SAX filter (see org.xml.sax.XMLFilter interface) to scan 
attribute values in startElement(), recognize the "${...}" pattern (maybe 
using regexp), evaluate the expression and replace it by the variable value.
Of course this assumes you are using SAXBuilder to create the JDOM documents.

The samples/sax directory of the JDOM distribution contains examples of SAX 
filter.

Laurent


--__--__--

Message: 4
From: "Trond Fuglestad" <tfuglest at c2i.net>
To: <jdom-interest at jdom.org>
Date: Wed, 15 May 2002 17:53:31 +0200
Subject: [jdom-interest] passing string from jdom tree to if statement

I am trying to get the contents of a an element in a jdom tree, and then use
this value (a String) in an if-statement.
My problem is, that when i try to use this String in the if-statement, it
does not match, and the else-statement is printed.
What I find strange is that when I use System.out.println it prints the
right value.
Very grateful if anyone can help me with this!

Here is the code:

private void docType (Document doc)
  { Element chk = doc.getRootElement();
    String type =
chk.getChild("header").getChild("command").getTextNormalize(); //Or
getText() or getTextTrim()

    System.out.println(type);  //Used for testing purposes, prints Send
    System.out.println(type.length()); //Used for testing purposes, prints 4
    if (ok == "Send")
    {
      System.out.println("Send loop");
    }
    else
    {System.out.println("feil");}


Trond Fuglestad


--__--__--

Message: 5
From: "O'neil, Jerome" <joneil at cobaltgroup.com>
To: "'Trond Fuglestad'" <tfuglest at c2i.net>, jdom-interest at jdom.org
Subject: RE: [jdom-interest] passing string from jdom tree to if statement
Date: Wed, 15 May 2002 09:01:18 -0700

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1FC29.BFDD3AD0
Content-Type: text/plain;
	charset="iso-8859-1"

Your problem isn't with JDOM, it's how you are evaluating equality of your
string.

Try

if(ok.equals("Send")){
	...
}


-----Original Message-----
From: Trond Fuglestad [mailto:tfuglest at c2i.net]
Sent: Wednesday, May 15, 2002 8:54 AM
To: jdom-interest at jdom.org
Subject: [jdom-interest] passing string from jdom tree to if statement


I am trying to get the contents of a an element in a jdom tree, and then use
this value (a String) in an if-statement.
My problem is, that when i try to use this String in the if-statement, it
does not match, and the else-statement is printed.
What I find strange is that when I use System.out.println it prints the
right value.
Very grateful if anyone can help me with this!

Here is the code:

private void docType (Document doc)
  { Element chk = doc.getRootElement();
    String type =
chk.getChild("header").getChild("command").getTextNormalize(); //Or
getText() or getTextTrim()

    System.out.println(type);  //Used for testing purposes, prints Send
    System.out.println(type.length()); //Used for testing purposes, prints 4
    if (ok == "Send")
    {
      System.out.println("Send loop");
    }
    else
    {System.out.println("feil");}


Trond Fuglestad

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com

------_=_NextPart_001_01C1FC29.BFDD3AD0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: [jdom-interest] passing string from jdom tree to if =
statement</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Your problem isn't with JDOM, it's how you are =
evaluating equality of your string.</FONT>
</P>

<P><FONT SIZE=3D2>Try</FONT>
</P>

<P><FONT SIZE=3D2>if(ok.equals(&quot;Send&quot;)){</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT =
SIZE=3D2>...</FONT>
<BR><FONT SIZE=3D2>}</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Trond Fuglestad [<A =
HREF=3D"mailto:tfuglest at c2i.net">mailto:tfuglest at c2i.net</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Wednesday, May 15, 2002 8:54 AM</FONT>
<BR><FONT SIZE=3D2>To: jdom-interest at jdom.org</FONT>
<BR><FONT SIZE=3D2>Subject: [jdom-interest] passing string from jdom =
tree to if statement</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>I am trying to get the contents of a an element in a =
jdom tree, and then use</FONT>
<BR><FONT SIZE=3D2>this value (a String) in an if-statement.</FONT>
<BR><FONT SIZE=3D2>My problem is, that when i try to use this String in =
the if-statement, it</FONT>
<BR><FONT SIZE=3D2>does not match, and the else-statement is =
printed.</FONT>
<BR><FONT SIZE=3D2>What I find strange is that when I use =
System.out.println it prints the</FONT>
<BR><FONT SIZE=3D2>right value.</FONT>
<BR><FONT SIZE=3D2>Very grateful if anyone can help me with =
this!</FONT>
</P>

<P><FONT SIZE=3D2>Here is the code:</FONT>
</P>

<P><FONT SIZE=3D2>private void docType (Document doc)</FONT>
<BR><FONT SIZE=3D2>&nbsp; { Element chk =3D =
doc.getRootElement();</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; String type =3D</FONT>
<BR><FONT =
SIZE=3D2>chk.getChild(&quot;header&quot;).getChild(&quot;command&quot;).=
getTextNormalize(); //Or</FONT>
<BR><FONT SIZE=3D2>getText() or getTextTrim()</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; System.out.println(type);&nbsp; =
//Used for testing purposes, prints Send</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; =
System.out.println(type.length()); //Used for testing purposes, prints =
4</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; if (ok =3D=3D =
&quot;Send&quot;)</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; {</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
System.out.println(&quot;Send loop&quot;);</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; }</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; else</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; =
{System.out.println(&quot;feil&quot;);}</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Trond Fuglestad</FONT>
</P>

<P><FONT =
SIZE=3D2>_______________________________________________</FONT>
<BR><FONT SIZE=3D2>To control your jdom-interest membership:</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://lists.denveronline.net/mailman/options/jdom-interest/your=
addr at yourhost.com" =
TARGET=3D"_blank">http://lists.denveronline.net/mailman/options/jdom-int=
erest/youraddr at yourhost.com</A></FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C1FC29.BFDD3AD0--

--__--__--

Message: 6
Date: Wed, 15 May 2002 11:56:30 -0400
From: root <daly at idsi.net>
To: tfuglest at c2i.net
CC: jdom-interest at jdom.org
Subject: Re: [jdom-interest] passing string from jdom tree to if statement
Reply-to: daly at idsi.net

"ok" appears exactly once and has no value.
This test can never succeed.

--__--__--

Message: 7
From: "vonderLuft, Andrew" <vonderluft.andrew at con-way.com>
To: "'jdom-interest at jdom.org'" <jdom-interest at jdom.org>
Subject: RE: [jdom-interest] passing string from jdom tree to if statement
Date: Wed, 15 May 2002 09:08:10 -0700

Try using java method .equals

/**
 * <mailto:vonderluft.andrew at con-way.com>
 * Desk: 503.450.6055   Fax: 503.450.5790           
 * CON-WAY I.T. <www.con-way.com>
 * @author: Andrew vonderLuft 
 */



-----Original Message-----
From: Trond Fuglestad [mailto:tfuglest at c2i.net]
Sent: Wednesday, May 15, 2002 8:54 AM
To: jdom-interest at jdom.org
Subject: [jdom-interest] passing string from jdom tree to if statement


I am trying to get the contents of a an element in a jdom tree, and then use
this value (a String) in an if-statement.
My problem is, that when i try to use this String in the if-statement, it
does not match, and the else-statement is printed.
What I find strange is that when I use System.out.println it prints the
right value.
Very grateful if anyone can help me with this!

Here is the code:

private void docType (Document doc)
  { Element chk = doc.getRootElement();
    String type =
chk.getChild("header").getChild("command").getTextNormalize(); //Or
getText() or getTextTrim()

    System.out.println(type);  //Used for testing purposes, prints Send
    System.out.println(type.length()); //Used for testing purposes, prints 4
    if (ok == "Send")
    {
      System.out.println("Send loop");
    }
    else
    {System.out.println("feil");}


Trond Fuglestad

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com

--__--__--

Message: 8
From: "Trond Fuglestad" <tfuglest at c2i.net>
To: <jdom-interest at jdom.org>
Subject: Re: [jdom-interest] passing string from jdom tree to if statement
Date: Wed, 15 May 2002 18:22:11 +0200

ok is supposed to be the String type. Anyway, the problem was solved using
the type.equals method.
Thanks a lot for your help guys!

Trond Fuglestad



--__--__--

Message: 9
From: Isaac Sparrow <isaac.sparrow at visicomp.com>
Organization: VisiComp, Inc.
To: jdom-interest at jdom.org
Subject: Re: [jdom-interest] Using variables in XML files
Date: Wed, 15 May 2002 10:28:30 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 15 May 2002 06:20 am, Laurent Bihanic wrote:
> Isaac Sparrow wrote:
> > One solution would be to find and replace these variables while the XML
> > file is being parsed (although I don't know how).
>
> You could use a SAX filter (see org.xml.sax.XMLFilter interface) to scan
> attribute values in startElement(), recognize the "${...}" pattern (maybe
> using regexp), evaluate the expression and replace it by the variable
> value. Of course this assumes you are using SAXBuilder to create the JDOM
> documents.
>
> The samples/sax directory of the JDOM distribution contains examples of SAX
> filter.
>
> Laurent
>
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourho
>st.com

Perfect. This is exactly what I was hoping for. 

Thanks again,
- -- 

- -------------------------------------------------------------------
Isaac Sparrow
Staff Engineer
VisiComp, Inc.
http://www.visicomp.com

GnuPG Key Fingerprint:
1060 5A07 F6EC B2B3 9AAA 3EA5 7B79 EFE1 6397 4F47
Get my public key at:
http://www.concentric.net/~issparow

I think your opinions are reasonable, except for the one about my mental
instability.
		-- Psychology Professor, Farifield University

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: NSA bad. Encryption good.

iD8DBQE84prBe3nv4WOXT0cRAgo2AJ9C2ROT1kfC7UsxiwN/HSpGh6tSSwCeLVcC
eRSLaiWHaFlogw+ZJROQMEA=
=HLZB
-----END PGP SIGNATURE-----


--__--__--

Message: 10
From: "Ralf Lorenz" <ralf.lorenz at subsist.de>
To: <jdom-interest at jdom.org>
Date: Wed, 15 May 2002 16:00:32 +0200
Subject: [jdom-interest] DOMOutputter output-methods question!

This is a multi-part message in MIME format.

------=_NextPart_000_0025_01C1FC29.A45B7380
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,
I'm new to XML and JDOM but trying to get involved.
I'm using JDOM to read in configuration files and then initialize =
log4j(1.1.3) with the root element of one of these files.
When I use=20

DOMOutputter domOutputter =3D new DOMOutputter
                                         =
(Constants.DEFAULT_DOM_ADAPTER_CLASS);
org.w3c.dom.Element element =3D =
domOutputter.output(document.getRootElement());
DOMConfigurator.configure(element);

I'll get a configuration-error from log4j but when I instead use=20

org.w3c.dom.Document doc =3D domOutputter.output(document);
DOMConfigurator.configure(doc.getDocumentElement());

then everything works fine.
I even tried to print me out the JDOM-generated org.w3c.dom.Element but =
that didn't work out because I couldn't append this to
an org.w3c.dom.Document with the error: (using Xerces that means =
DocumentImpl)

org.w3c.dom.DOMException: DOM005 Wrong document
        at =
org.apache.xerces.dom.ParentNode.internalInsertBefore(ParentNode.java:390=
)
        at =
org.apache.xerces.dom.ParentNode.insertBefore(ParentNode.java:322)
        at =
org.apache.xerces.dom.CoreDocumentImpl.insertBefore(CoreDocumentImpl.java=
:387)
        at org.apache.xerces.dom.NodeImpl.appendChild(NodeImpl.java:228)
        at =
de.subsist.zeiterfassung.configuration.XMLLogConfiguration.outputElement(=
XMLLogConfiguration.java:78)
        at =
de.subsist.zeiterfassung.configuration.XMLLogConfiguration.initializeLogg=
ing(XMLLogConfiguration.java:65)
        at =
de.subsist.zeiterfassung.configuration.XMLConfiguration.initLogging(XMLCo=
nfiguration.java:65)
        at de.subsist.zeiterfassung.InitMain.main(InitMain.java:59)
Exception in thread "main"=20

As I said I'm new to that but I've seen a little discussion about the =
method :=20
    org.w3c.dom.Element DOMOutputter.output(org.jdom.Element element)=20
and so I just want to know what I've done wrong and what about this =
methods!
cheers

Ralf Lorenz
____________________________

subsist GmbH
Gautschweg 2
01309 Dresden
Tel.  +49 351 315 65 55
Fax. +49 351 315 65 50
http://www.subsist.de
http://palm.subsist.de


------=_NextPart_000_0025_01C1FC29.A45B7380
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 face=3DTahoma size=3D2>
<DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I'm new to XML and JDOM but trying to =
get=20
involved.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I'm using JDOM to read =
in&nbsp;configuration files=20
and then initialize log4j(1.1.3) with the root element of one of these=20
files.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>When I use </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>DOMOutputter domOutputter =3D new=20
DOMOutputter<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
(Constants.DEFAULT_DOM_ADAPTER_CLASS);<BR></FONT><FONT face=3DArial=20
size=3D2>org.w3c.dom.Element element =3D=20
domOutputter.output(document.getRootElement());<BR>DOMConfigurator.config=
ure(element);<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I'll get a configuration-error from =
log4j but when=20
I instead use</FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><FONT =
face=3DTahoma></FONT>&nbsp;</DIV></FONT>
<DIV><FONT face=3DArial size=3D2>org.w3c.dom.Document doc =3D=20
domOutputter.output(document);<BR>DOMConfigurator.configure(doc.getDocume=
ntElement());</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>then everything works =
fine.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I even tried to print me out the =
JDOM-generated=20
org.w3c.dom.Element but that didn't work out because I couldn't append =
this=20
to</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>an org.w3c.dom.Document with the error: =
(using=20
Xerces that means DocumentImpl)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>org.w3c.dom.DOMException: DOM005 Wrong=20
document<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
org.apache.xerces.dom.ParentNode.internalInsertBefore(ParentNode.java:390=
)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
at=20
org.apache.xerces.dom.ParentNode.insertBefore(ParentNode.java:322)<BR>&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
at=20
org.apache.xerces.dom.CoreDocumentImpl.insertBefore(CoreDocumentImpl.java=
:387)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
at=20
org.apache.xerces.dom.NodeImpl.appendChild(NodeImpl.java:228)<BR>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
at=20
de.subsist.zeiterfassung.configuration.XMLLogConfiguration.outputElement(=
XMLLogConfiguration.java:78)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
at=20
de.subsist.zeiterfassung.configuration.XMLLogConfiguration.initializeLogg=
ing(XMLLogConfiguration.java:65)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
at=20
de.subsist.zeiterfassung.configuration.XMLConfiguration.initLogging(XMLCo=
nfiguration.java:65)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
at de.subsist.zeiterfassung.InitMain.main(InitMain.java:59)<BR>Exception =
in=20
thread "main" <BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>As I said I'm new to that but =
</FONT><FONT=20
face=3DArial size=3D2>I've seen a little discussion about the =
method&nbsp;:=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; org.w3c.dom.Element=20
DOMOutputter.output(org.jdom.Element element)&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>and so I just want to know what I've =
done wrong and=20
what about this methods!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>cheers</FONT></DIV></FONT></DIV>
<DIV><FONT face=3DTahoma size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DTahoma size=3D2>Ralf=20
Lorenz<BR>____________________________</FONT></DIV>
<DIV><FONT face=3DTahoma size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DTahoma size=3D2>subsist GmbH<BR>Gautschweg 2<BR>01309=20
Dresden<BR>Tel.&nbsp; +49 351 315 65 55<BR>Fax. +49 351 315 65 50<BR><A=20
href=3D"http://www.subsist.de">http://www.subsist.de</A><BR><A=20
href=3D"http://palm.subsist.de">http://palm.subsist.de</A><BR></FONT></DI=
V></BODY></HTML>

------=_NextPart_000_0025_01C1FC29.A45B7380--


--__--__--

Message: 11
Date: Wed, 15 May 2002 09:55:32 -0400
To: elharo at macfaq.com
From: Elliotte Rusty Harold <elharo at metalab.unc.edu>
Subject: [jdom-interest] JDOM Quick Reference, Appendix B of Processing XMl with Java, has
 been posted

Hello once again. I'm pleased to announce that I've posted the last 
appendix of Processing XML with Java, JDOM Quick Reference, in the 
usual location on Cafe con Leche:

http://www.cafeconleche.org/books/xmljava/chapters/apb.html

As usual, I'd much appreciate hearing any comments, criticisms, or 
corrections you have for this chapter. I'm particularly interested in 
three issues:

1. Have I accidentally included any deprecated methods? I tried to 
get them all out, but I may have missed one or two.

2. Have I forgotten any important exceptions any of the methods might 
throw? The checked exceptions should all be there, but a lot of them 
are runtime exceptions and I could have missed these. In a few cases, 
it's a judgement call. For instance, should the JDOMFactory interface 
methods declare the same exceptions as the  DefaultJDOMFactory class 
does. (In this case, I deliberately decided not to include them 
because that's an implementation detail.) This one's particularly 
important because I plan to go through the Javadoc for the JDOM 
classes and patch up the @throws clause based on what I discovered 
here, so this can have an impact beyond just this book.

3. Should this appendix be combined with Apeendix A, JAXP Quick 
Reference? My original plan separated SAX, DOM, JDOM, TrAX, and JAXP 
factories into separate appendixes which I suppose is also still an 
option) but I eventually decided to pull the JAXP APIs into one 
chapter. That leaves JDOM hanging a bit since it's not a component of 
JAXP. I could just make one bigger appendix that covered them all, 
which would have the benefit of more parallel structure in the 
heading levels, and putting the JDOM QuickRef onto a single page for 
the online version.

Please take a look and let me know what you think. I'm almost done 
and time is getting short, so if they're any other thoughts on any 
parts of the book you've been procrastinating about, now is the time 
to send them.  Your comments have been extremely helpful up till now, 
and are always much appreciated. Thanks!

-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|             http://www.cafeconleche.org/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+

--__--__--

Message: 12
Date: Wed, 15 May 2002 14:08:22 -0400
From: "Andres March" <Andres at ehealthcontracts.com>
To: <jdom-interest at jdom.org>
Subject: [jdom-interest] Order of removing old content in setChildren

This is a multi-part message in MIME format.

------_=_NextPart_001_01C1FC3B.80308CE0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Does anybody know the reason the removal of old content in setChildren =
was moved to the end of the method?  Before this happened first.  Now =
that it happens at the end, if I am readding the same children, I have =
the obvious problem that the elements already have a parent.  If this =
was done for error handling purposes, there are ways to handle errors =
and still have the removal at the beginning.  Just wondering.  Oh, =
anybody know the best way to add an element as the first child of =
another element without encountering this problem?
=20
=20
ANDRES MARCH
LEAD APPLICATION DEVELOPER
eHEALTHCONTRACTS, INC.
WWW.eHEALTHCONTRACTS.COM <http://www.ehealthcontracts.com/>=20
OFFICE: 510.581.5646 x205
MOBILE: 415.999.6735
FAX: 510.582.8013

Note:

The information contained in this message may be privileged and =
confidential and protected from disclosure. If the reader of this =
message is not the intended recipient, or an employee or agent =
responsible for delivering this message to the intended recipient, you =
are hereby notified that any dissemination, distribution or copying of =
this communication is strictly prohibited. If you have received this =
communication in error, please notify us immediately by replying to the =
message and deleting it from your computer.

Thank you. eHealthContracts, Inc.

=20

------_=_NextPart_001_01C1FC3B.80308CE0
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=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">


<META content=3D"MSHTML 6.00.2715.400" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D074555217-15052002>Does =
anybody know=20
the reason the removal of old content in setChildren was moved to the =
end of the=20
method?&nbsp; Before this happened first.&nbsp; Now that it happens at =
the end,=20
if I am readding the same children, I have the obvious problem that the =
elements=20
already have a parent.&nbsp; If this was done for error handling =
purposes, there=20
are ways to handle errors and still have the removal at the =
beginning.&nbsp;=20
Just wondering.&nbsp; Oh, anybody know the best way to add an element as =
the=20
first child of another element without encountering this=20
problem?</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Arial Narrow" size=3D2><STRONG>ANDRES =
MARCH</STRONG></FONT></DIV>
<DIV><FONT face=3D"Arial Narrow" size=3D1>LEAD APPLICATION =
DEVELOPER</FONT></DIV>
<DIV><FONT face=3D"Arial Narrow" color=3D#000080 =
size=3D2>eHEALTHCONTRACTS,=20
INC.</FONT></DIV>
<DIV><FONT face=3D"Arial Narrow" size=3D1><A=20
href=3D"http://www.ehealthcontracts.com/">WWW.eHEALTHCONTRACTS.COM</A></F=
ONT></DIV>
<DIV><FONT face=3D"Arial Narrow" size=3D1>OFFICE: 510.581.5646 =
x205</FONT></DIV>
<DIV><FONT face=3D"Arial Narrow" size=3D1>MOBILE: =
415.999.6735</FONT></DIV>
<DIV><FONT face=3D"Arial Narrow" size=3D1>FAX: 510.582.8013</FONT></DIV>
<DIV>
<P style=3D"MARGIN-BOTTOM: 3px"><FONT face=3D"Arial Narrow"=20
size=3D2><EM>Note:</EM></FONT></P>
<P style=3D"MARGIN-TOP: 0px; MARGIN-BOTTOM: 3px"><FONT face=3D"Arial =
Narrow"=20
size=3D2><EM>The information contained in this message may be privileged =
and=20
confidential and protected from disclosure. If the reader of this =
message is not=20
the intended recipient, or an employee or agent responsible for =
delivering this=20
message to the intended recipient, you are hereby notified that any=20
dissemination, distribution or copying of this communication is strictly =

prohibited. If you have received this communication in error, please =
notify us=20
immediately by replying to the message and deleting it from your=20
computer.</EM></FONT></P>
<P style=3D"MARGIN-TOP: 0px"><FONT face=3D"Arial Narrow" =
size=3D2><EM>Thank you.=20
eHealthContracts, Inc.</EM></FONT></P></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C1FC3B.80308CE0--

--__--__--

Message: 13
Date: Wed, 15 May 2002 15:28:55 -0400
To: "Ralf Lorenz" <ralf.lorenz at subsist.de>, <jdom-interest at jdom.org>
From: Elliotte Rusty Harold <elharo at metalab.unc.edu>
Subject: Re: [jdom-interest] DOMOutputter output-methods question!


As I said I'm new to that but I've seen a little discussion about the method :
     org.w3c.dom.Element DOMOutputter.output(org.jdom.Element element)


That method's fundamentally flawed at the signature level. Don't use 
it. I think it's deprecated. If it isn't it should be.

The basic problem is that DOM cannot create an Element that is not 
part of a Document. All Element objects have exactly one Document 
object that both creates and holds them. They cannot be separated 
from the Document that initially creates them.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|             http://www.cafeconleche.org/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+

--__--__--

Message: 14
From: "vonderLuft, Andrew" <vonderluft.andrew at con-way.com>
To: Jdom-Interest <jdom-interest at jdom.org>
Subject: RE: [jdom-interest] JDOM and WSAD
Date: Wed, 15 May 2002 15:40:20 -0700

Has anyone had any success using JDOM with WSAD ????

-----Original Message-----
From: Kent Roylance [mailto:roylance3 at attbi.com]
Sent: Tuesday, April 09, 2002 5:27 PM
To: Jdom-Interest
Subject: [jdom-interest] JDOM and WSAD


Is there anyone using JDOM with WSAD (Websphere Studio Application
Developer)?  I can't get JDOM to work with WSAD.  Does anyone know if JDOM
will work with Eclipse?

Thanks,

Kent
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.323 / Virus Database: 180 - Release Date: 2/8/2002

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com

--__--__--

Message: 15
Date: Wed, 15 May 2002 18:57:20 -0400
From: Elliotte Rusty Harold <elharo at metalab.unc.edu>
To: jdom-interest <jdom-interest at jdom.org>
Subject: [jdom-interest] Attribute constructor JavaDoc path

This is a multi-part message in MIME format.
--------------050906070200050904030909
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

The attached patch adds better JavaDoc @throws comments for the 
constructors in the Attribute class that throw runtime exceptions. It 
syncs them up with the setter methods they call. I did not add throws 
clauses for these exceptions since consensus seemed to be against using 
throws from runtime exceptions as per Bloch, Effective Java.  This patch 
should only change the comments. It should have no effect on the actual 
code.

If this works and you like it, I can send similar patches for the other 
org.jdom classes.

-- 
+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+ 
|           The XML Bible, 2nd Edition (IDG Books, 2001)             |
|             http://www.cafeconleche.org/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:   http://www.cafeaulait.org/     | 
|  Read Cafe con Leche for XML News:  http://www.cafeconleche.org/   |
+----------------------------------+---------------------------------+


--------------050906070200050904030909
Content-Type: text/plain;
 name="AttributePatch.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="AttributePatch.txt"

Index: src/java/org/jdom/Attribute.java
===================================================================
RCS file: /home/cvspublic/jdom/src/java/org/jdom/Attribute.java,v
retrieving revision 1.43
diff -d -u -r1.43 Attribute.java
--- src/java/org/jdom/Attribute.java	2002/04/29 13:38:15	1.43
+++ src/java/org/jdom/Attribute.java	2002/05/16 07:00:32
@@ -196,6 +196,12 @@
      * @param name <code>String</code> name of <code>Attribute</code>.
      * @param value <code>String</code> value for new attribute.
      * @param namespace <code>Namespace</code> namespace for new attribute.
+     * @throws IllegalNameException if the given name is illegal as an
+     *         attribute name or if if the new namespace is the default
+     *         namespace. Attributes cannot be in a default namespace.
+     * @throws IllegalDataException if the given attribute value is
+     *         illegal character data (as determined by
+     *         {@link org.jdom.Verifier#checkCharacterData}).
      */
     public Attribute(String name, String value, Namespace namespace) {
         setName(name);
@@ -212,6 +218,14 @@
      * @param value <code>String</code> value for new attribute.
      * @param type <code>int</code> type for new attribute.
      * @param namespace <code>Namespace</code> namespace for new attribute.
+     * @throws IllegalNameException if the given name is illegal as an
+     *         attribute name or if if the new namespace is the default
+     *         namespace. Attributes cannot be in a default namespace.
+     * @throws IllegalDataException if the given attribute value is
+     *         illegal character data (as determined by
+     *         {@link org.jdom.Verifier#checkCharacterData}) or
+     *         if the given attribute type is not one of the 
+     *         supported types.
      */
     public Attribute(String name, String value, int type, Namespace namespace) {
         setName(name);
@@ -231,6 +245,11 @@
      *
      * @param name <code>String</code> name of <code>Attribute</code>.
      * @param value <code>String</code> value for new attribute.
+     * @throws IllegalNameException if the given name is illegal as an
+     *         attribute name.
+     * @throws IllegalDataException if the given attribute value is
+     *         illegal character data (as determined by
+     *         {@link org.jdom.Verifier#checkCharacterData}).
      */
     public Attribute(String name, String value) {
         this(name, value, UNDECLARED_ATTRIBUTE, Namespace.NO_NAMESPACE);
@@ -248,6 +267,13 @@
      * @param name <code>String</code> name of <code>Attribute</code>.
      * @param value <code>String</code> value for new attribute.
      * @param type <code>int</code> type for new attribute.
+     * @throws IllegalNameException if the given name is illegal as an
+     *         attribute name.
+     * @throws IllegalDataException if the given attribute value is
+     *         illegal character data (as determined by
+     *         {@link org.jdom.Verifier#checkCharacterData}) or
+     *         if the given attribute type is not one of the 
+     *         supported types.
      */
     public Attribute(String name, String value, int type) {
         this(name, value, type, Namespace.NO_NAMESPACE);

--------------050906070200050904030909--


--__--__--

Message: 16
From: "Andrew Forward" <milkforlife at hotmail.com>
To: "Jdom-Interest" <jdom-interest at jdom.org>
Subject: Re: [jdom-interest] JDOM and WSAD (please clarify)
Date: Wed, 15 May 2002 19:04:02 -0400


I have just recently joined this list, so I might not fully understand the
context of your question, but what exactly do you mean by

  "Does anyone know if JDOM will work with Eclipse?"

If you are referring to just using jdom.jar with the Eclipse IDE, then sure,
everything works fine.

andrew f


----- Original Message -----
From: "vonderLuft, Andrew" <vonderluft.andrew at con-way.com>
To: "Jdom-Interest" <jdom-interest at jdom.org>
Sent: Wednesday, May 15, 2002 6:40 PM
Subject: RE: [jdom-interest] JDOM and WSAD


> Has anyone had any success using JDOM with WSAD ????
>
> -----Original Message-----
> From: Kent Roylance [mailto:roylance3 at attbi.com]
> Sent: Tuesday, April 09, 2002 5:27 PM
> To: Jdom-Interest
> Subject: [jdom-interest] JDOM and WSAD
>
>
> Is there anyone using JDOM with WSAD (Websphere Studio Application
> Developer)?  I can't get JDOM to work with WSAD.  Does anyone know if JDOM
> will work with Eclipse?
>
> Thanks,
>
> Kent
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.323 / Virus Database: 180 - Release Date: 2/8/2002
>
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
> t.com
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
>

--__--__--

Message: 17
Date: Wed, 15 May 2002 17:00:56 -0700
From: Jason Hunter <jhunter at servlets.com>
To: Elliotte Rusty Harold <elharo at metalab.unc.edu>
CC: jdom-interest <jdom-interest at jdom.org>
Subject: Re: [jdom-interest] Attribute constructor JavaDoc path

I like it, and I've committed it.  Please do continue!

-jh-

Elliotte Rusty Harold wrote:
> 
> The attached patch adds better JavaDoc @throws comments for the
> constructors in the Attribute class that throw runtime exceptions. It
> syncs them up with the setter methods they call. I did not add throws
> clauses for these exceptions since consensus seemed to be against using
> throws from runtime exceptions as per Bloch, Effective Java.  This patch
> should only change the comments. It should have no effect on the actual
> code.
> 
> If this works and you like it, I can send similar patches for the other
> org.jdom classes.
> 
> --
> +-----------------------+------------------------+-------------------+
> | Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
> +-----------------------+------------------------+-------------------+
> |           The XML Bible, 2nd Edition (IDG Books, 2001)             |
> |             http://www.cafeconleche.org/books/bible2/              |
> |   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
> +----------------------------------+---------------------------------+
> |  Read Cafe au Lait for Java News:   http://www.cafeaulait.org/     |
> |  Read Cafe con Leche for XML News:  http://www.cafeconleche.org/   |
> +----------------------------------+---------------------------------+
> 
>   ------------------------------------------------------------------------
>                          Name: AttributePatch.txt
>    AttributePatch.txt    Type: Plain Text (text/plain)
>                      Encoding: 7bit

--__--__--

Message: 18
Date: Wed, 15 May 2002 22:45:11 -0400
From: Elliotte Rusty Harold <elharo at metalab.unc.edu>
To: jdom-interest <jdom-interest at jdom.org>
Subject: [jdom-interest] CDATA patch

This is a multi-part message in MIME format.
--------------090207000900040504090609
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I've attached a patch for the CDATA class that accomplishes two things:

1. It adds @throws JavaDoc comments for the IllegalDataException 
setText() and append() already throw.

2. It modifies the constructor so it calls setText() rather than setting 
the value field directly. This means the constructor verifies its 
arguments where it did not previously do so.

I've tested that the code builds and the tests run and the JavaDoc looks 
OK.

This doesn't change any method signatures, and shouldn't cause problems 
for anyone unless they're doing something really weird with CDATA 
sections that they really shouldn't be doing in the first place. This 
does close off a loophole that allowed CDATA sections to be malformed 
(though only if the text was provided via the constructor rather than 
setText() and append()) All I've done is make sure the constructor does 
the same check as setText().

Side note: is there any standard three-letter extension for patch files? 
I've just been using .txt.

-- 
+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+ 
|           The XML Bible, 2nd Edition (IDG Books, 2001)             |
|             http://www.cafeconleche.org/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:   http://www.cafeaulait.org/     | 
|  Read Cafe con Leche for XML News:  http://www.cafeconleche.org/   |
+----------------------------------+---------------------------------+


--------------090207000900040504090609
Content-Type: text/plain;
 name="CDATA_patch.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="CDATA_patch.txt"

Index: src/java/org/jdom/CDATA.java
===================================================================
RCS file: /home/cvspublic/jdom/src/java/org/jdom/CDATA.java,v
retrieving revision 1.24
diff -d -u -r1.24 CDATA.java
--- src/java/org/jdom/CDATA.java	2002/04/29 13:38:15	1.24
+++ src/java/org/jdom/CDATA.java	2002/05/16 10:50:57
@@ -89,15 +89,23 @@
      * supplied string value as it's character content.
      *
      * @param str the node's character content.
+     * @throws IllegalDataException if <code>str</code> contains an 
+     *         illegal character such as a vertical tab (as determined
+     *          by {@link org.jdom.Verifier#checkCharacterData})
+     *         or the CDATA end delimiter <code>]]&gt;</code>.
      */
     public CDATA(String str) {
-        super(str);
+        setText(str);
     }
 
     /**
      * This will set the value of this <code>CDATA</code> node.
      *
      * @param str value for node's content.
+     * @throws IllegalDataException if <code>str</code> contains an 
+     *         illegal character such as a vertical tab (as determined
+     *          by {@link org.jdom.Verifier#checkCharacterData})
+     *         or the CDATA end delimiter <code>]]&gt;</code>.
      */
     public Text setText(String str) {
         // Overrides Text.setText() because this needs to check CDATA
@@ -123,6 +131,10 @@
      * exists within this <code>CDATA</code> node.
      *
      * @param str character content to append.
+     * @throws IllegalDataException if <code>str</code> contains an 
+     *         illegal character such as a vertical tab (as determined
+     *          by {@link org.jdom.Verifier#checkCharacterData})
+     *         or the CDATA end delimiter <code>]]&gt;</code>.
      */
     public void append(String str) {
         // Overrides Text.setText() because this needs to check CDATA

--------------090207000900040504090609--


--__--__--

Message: 19
Date: Wed, 15 May 2002 22:53:18 -0400
From: Elliotte Rusty Harold <elharo at metalab.unc.edu>
To: jdom-interest <jdom-interest at jdom.org>
Subject: [jdom-interest] Document exception patch

This is a multi-part message in MIME format.
--------------030404040704090303050201
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

The attached patch adds @throws IllegalDataException doc comments to 
several constructors in Document. The exceptions actually thrown haven't 
changed. I'm just documenting them better.

-- 
+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+ 
|           The XML Bible, 2nd Edition (IDG Books, 2001)             |
|             http://www.cafeconleche.org/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:   http://www.cafeaulait.org/     | 
|  Read Cafe con Leche for XML News:  http://www.cafeconleche.org/   |
+----------------------------------+---------------------------------+



--------------030404040704090303050201
Content-Type: text/plain;
 name="Document_patch.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="Document_patch.txt"

Index: src/java/org/jdom/Document.java
===================================================================
RCS file: /home/cvspublic/jdom/src/java/org/jdom/Document.java,v
retrieving revision 1.60
diff -d -u -r1.60 Document.java
--- src/java/org/jdom/Document.java	2002/04/29 13:38:15	1.60
+++ src/java/org/jdom/Document.java	2002/05/16 10:59:03
@@ -104,6 +104,9 @@
      *
      * @param rootElement <code>Element</code> for document root.
      * @param docType <code>DocType</code> declaration.
+     * @throws IllegalAddException if the given docType object 
+     *         is already attached to a document or the given 
+     *         rootElement already has a parent
      */
     public Document(Element rootElement, DocType docType) {
         if (rootElement != null)
@@ -118,6 +121,8 @@
      * declaration.
      *
      * @param rootElement <code>Element</code> for document root
+     * @throws IllegalAddException if the given rootElement already has
+     *         a parent.
      */
     public Document(Element rootElement) {
         this(rootElement, null);

--------------030404040704090303050201--



--__--__--

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

End of jdom-interest Digest



More information about the jdom-interest mailing list