[jdom-interest] IDREFs

Christophe D. Laprun chris.laprun at nist.gov
Wed Aug 9 16:14:10 PDT 2000


Hi all,

Forgive me if this is a little off-topic but I was wondering how IDREF
attributes are supposed to be handled by parsers. Is it possible to have
a parser that returns the referenced XML element (modulo a call to the
appropriate method) when it encounters an IDREF attribute ? Or is it
left to higher-level applications ? Does JDOM offer such a possibility
and if no, would it make sense to add such a capability ?

Regards,

Chris

-- 
Christophe Laprun    [Ingenieur ISIMA, France / Guest researcher @NIST]
web: http://www.nist.gov/speech/staff/laprunch.htm
email: chris.laprun at nist.gov
phone: (301) 975 3191             fax: (301) 670 0939
--
The universe seems neither benign nor hostile, merely indifferent -
Sagan

Received: from slim.silverstream.com ([216.142.115.7])
	by dorothy.denveronline.net (8.9.3/8.9.3) with ESMTP id PAA26413
	for <jdom-interest at jdom.org>; Tue, 8 Aug 2000 15:45:54 -0600 (MDT)
Received: by slim.silverstream.com with Internet Mail Service (5.5.2650.21)
	id <3PRYFW16>; Tue, 8 Aug 2000 17:45:41 -0400
Received: from arosen (r93aag001868.sbo-smr.ma.cable.rcn.com [209.6.192.38]) by slim.silverstream.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21)
	id 3PRYFW1X; Tue, 8 Aug 2000 17:45:27 -0400
From: "Rosen, Alex" <arosen at silverstream.com>
To: jdom-interest at jdom.org
Subject: Re: [jdom-interest] licensing
Date: Tue, 8 Aug 2000 17:47:24 -0400
Message-ID: <000a01c00182$3da23230$6501a8c0 at arosen>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
Importance: Normal
In-Reply-To: <200008082124.PAA24785 at dorothy.denveronline.net>
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
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>

I would simply request, but not require, the acknowledgement. The advantages
are:

(1) Provides a loophole for when an acknowledgement isn't possible or
appropriate;
(2) No problems with it invalidating the rest of the license, since you're
following the license whether you comply or not;
(3) You catch more flies with honey than vinegar, or whatever; and
(4) It makes you look more selfless, since you're only requesting credit, not
demanding it.

I think that most developers will be grateful for getting this code for free,
under a license that lets them use it, and will be happy to comply.

Alex

Received: from amsmta05-svc.chello.nl ([213.46.240.8])
	by dorothy.denveronline.net (8.9.3/8.9.3) with ESMTP id IAA24011
	for <jdom-interest at jdom.org>; Wed, 9 Aug 2000 08:23:02 -0600 (MDT)
Received: from quito ([24.132.111.182]) by amsmta05-svc.chello.nl
          (InterMail vK.4.02.00.10 201-232-116-110 license 85c33b9378a1845aa5f2088df8e3706e)
          with SMTP id <20000809142344.DVLN15112.amsmta05-svc at quito>;
          Wed, 9 Aug 2000 16:23:44 +0200
Message-ID: <000d01c0020d$7cc2de70$8200000a at intra.backstream.com>
From: "Frank van Puffelen" <puf at backstream.com>
To: <jdom-interest at jdom.org>
Cc: "Tako" <tako at backstream.com>, "puf" <puf at backstream.com>
Date: Wed, 9 Aug 2000 16:24:11 +0200
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_000A_01C0021E.401F4740"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
Subject: [jdom-interest] root node appearing multiple times when changing the root node
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_000A_01C0021E.401F4740
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

I've seen several people complaining about the fact that the same root =
node sometimes appears twice in their output. I'm not sure if you need a =
specific configuration for the bug to appear, but I get it when building =
a Document in code (no inputter class) and writing the XML using an =
XMLOutputter. I'm using beta 4 of JDOM.

The problem seems to be in Document.setRootNode. Although the new root =
node is added to the contents as a side effect of settings it as the =
root node, it is never removed from the contents when a new root node is =
specified. In my opinion: since adding the root node is implicit, =
removing it should also be implicit. This would be accomplished by =
changing:=20

        // If existing root element, tell it that it's no longer root
        if (this.rootElement !=3D null) {
            this.rootElement.setIsRootElement(false);
        }

to

        // If existing root element, tell it that it's no longer root =
and remove it from the node list
        if (this.rootElement !=3D null) {
            this.rootElement.setIsRootElement(false);
            content.remove(this.rootElement);
        }

I made this change on my system and it seems to solve the problem in all =
cases I tested.

Would someone with contributing rights please be so kind to consider =
this modification and -if my change is correct- commit it to the CVS =
tree?

Thanks in advance,
                            puf





------=_NextPart_000_000A_01C0021E.401F4740
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 content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I've seen several people complaining =
about the fact=20
that the same root node sometimes appears twice in their output. I'm not =
sure if=20
you need a specific configuration for the bug to appear, but I get it =
when=20
building a Document in code (no inputter class) and writing the XML =
using an=20
XMLOutputter. I'm using beta 4 of JDOM.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The&nbsp;problem seems to be in=20
Document.setRootNode. Although the new root node is added to the =
contents as a=20
side effect of settings it as the root node, it is never removed from =
the=20
contents when a new root node is specified. In my opinion: =
since&nbsp;adding the=20
root node is implicit, removing it should also be implicit. This would =
be=20
accomplished by changing: </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // If=20
existing root element, tell it that it's no longer=20
root<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (this.rootElement =
!=3D null)=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
this.rootElement.setIsRootElement(false);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;=20
}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>to</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3DArial =
size=3D2></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // If existing root =
element,=20
tell it that it's no longer root and remove it from the node=20
list<BR></FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if =
(this.rootElement=20
!=3D null) =
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
this.rootElement.setIsRootElement(false);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
content.remove(this.rootElement);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;=20
}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I made this change on my system and it =
seems=20
to&nbsp;solve the problem in all cases I tested.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Would someone with contributing rights =
please be so=20
kind to consider this modification and -if my change is correct- commit =
it to=20
the CVS tree?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks in advance,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; puf</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><BR>&nbsp;</DIV></FONT>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_000A_01C0021E.401F4740--




More information about the jdom-interest mailing list