From ramo at skuff-band.de Sat Nov 3 03:26:22 2007
From: ramo at skuff-band.de (Ramo At Skuff)
Date: Sat Nov 3 03:25:56 2007
Subject: [jdom-interest] Question about getting the Content
Message-ID: <002901c81e03$fb684930$f238db90$@de>
Hi,
may be it's a simple question, but i don't know how to solve it.
If i want to get the Element from: Marketing
How could i do this? I have no idea...
Any tips for me?
Greetings
Ramo
From cowtowncoder at yahoo.com Sat Nov 3 20:56:54 2007
From: cowtowncoder at yahoo.com (Tatu Saloranta)
Date: Sat Nov 3 20:57:04 2007
Subject: [jdom-interest] Question about getting the Content
In-Reply-To: <002901c81e03$fb684930$f238db90$@de>
Message-ID: <146750.61524.qm@web32811.mail.mud.yahoo.com>
--- Ramo At Skuff wrote:
> Hi,
>
> may be it's a simple question, but i don't know how
> to solve it.
>
> If i want to get the Element from: id="rd_01" name="rd_01"
> mandat="y" value="Marketing"/> Marketing
>
> How could i do this? I have no idea...
>
> Any tips for me?
You could start by reading a JDOM tutorial.
Generally you do something like this by parsing the
document into a JDOM tree, and then accessing that
element either by calls via document element, or using
xpath expression to find it.
-+ Tatu +-
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
From hintsn at idmt.fraunhofer.de Mon Nov 5 08:41:45 2007
From: hintsn at idmt.fraunhofer.de (=?ISO-8859-1?Q?Sebastian_Hinterw=E4lder?=)
Date: Mon Nov 5 08:42:02 2007
Subject: [jdom-interest] Resetting the Root Element
Message-ID: <472F47C9.2050707@idmt.fraunhofer.de>
Hello,
I have a question concerning the root element of a normal XML document.
Probably something like this already appeared in this list some time
ago, but I don't get my problem solved so far.
I have a normal "ATOM feed" which looks something like this:
Golem.de
IT-News fuer Profis
....
Now I want to set a different root element using JDOM. I already tried
it by cloning the whole document but this doesn't work. A different
solution for me would also be removing the namespaces from the root. I
am quite new to JDOM - so I hope someone knows a solution!
Thanks in advance
Sebastian
From laurent.bihanic at atosorigin.com Tue Nov 6 00:57:42 2007
From: laurent.bihanic at atosorigin.com (Laurent Bihanic)
Date: Tue Nov 6 00:57:57 2007
Subject: [jdom-interest] Resetting the Root Element
In-Reply-To: <472F47C9.2050707@idmt.fraunhofer.de>
References: <472F47C9.2050707@idmt.fraunhofer.de>
Message-ID: <47302C86.50100@atosorigin.com>
Hi,
Sebastian Hinterw?lder wrote:
> Now I want to set a different root element using JDOM. I already tried
> it by cloning the whole document but this doesn't work. A different
> solution for me would also be removing the namespaces from the root. I
> am quite new to JDOM - so I hope someone knows a solution!
You have to create a new root element and detach content from the old root to
add it to the new root :
Element newRoot = new Element(...);
newRoot.setContent(oldRoot.removeContent());
Unfortunately, there is no Element.removeAttributes() method. So you'll
probably have to iterate on the old root's attribute list to detach each
attribute (using Iterator.remove()) and add it to the new root.
Any better way, someone ?
Laurent
From pabhishek at novell.com Tue Nov 6 01:06:25 2007
From: pabhishek at novell.com (Abhishek Parwal)
Date: Tue Nov 6 01:02:18 2007
Subject: [jdom-interest] Issue with Jdom parsing control character
Message-ID: <47307A2D.9B34.007E.0@novell.com>
Hi,
When i try to parse the control chars the following exception occurs:
org.jdom.input.JDOMParseException: Error on line 1: Character reference
"" is an invalid XML character. at
org.jdom.input.SAXBuilder.build(SAXBuilder.java:381) at
org.jdom.input.SAXBuilder.build(SAXBuilder.java:764) at
com.novell.emframe.dev.DataHandlerHelper.setString(DataHandlerHelper.java:233) at com.novell.emframe.dev.DirUtils.writeAttributeXML(DirUtils.java:648) at com.novell.emframe.fw.Target.write(Target.java:715) at com.novell.emframe.fw.TargetCollection.write(TargetCollection.java:434) at com.novell.emframe.dev.DirPropertyBookPage.save(DirPropertyBookPage.java:111) at com.novell.emframe.dev.PropertyBookPage.cache(PropertyBookPage.java:324) at com.novell.emframe.dev.PropertyBook.doApply(PropertyBook.java:920) at com.novell.emframe.dev.PropertyBook.execute(PropertyBook.java:155) at com.novell.emframe.dev.Task.execute(Task.java:505) at com.novell.nps.gadgetManager.BaseGadgetInstance.processRequest(BaseGadgetInstance.java:849) at com.novell.nps.gadgetManager.BaseGadgetInstance.handleAction(BaseGadgetInstance.java:2375) at com.novell.nps.gadgetManager.GadgetManager.processInstanceRequest(GadgetManager.java:1606) at com.novell.nps.gadgetManager.GadgetManager.processServiceRequest(Gadget!
Manager.java:1062) at com.novell.nps.PortalServlet.handleFrameService(PortalServlet.java:496) at com.novell.nps.PortalServlet.processRequest(PortalServlet.java:369) at com.novell.nps.PortalServlet.doPost(PortalServlet.java:275) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at com.novell.emframe.fw.servlet.AuthenticatorServlet.service(AuthenticatorServlet.java:291) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.jav!
a:198) at org.apache.catalina.core.StandardContextValve.invoke(Standar
dContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.c!
atalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:534) Caused by: org.xml.sax.SAXParseException: Character reference "" is an invalid XML character. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) at org.apache.xerces.impl.XMLErr!
orReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLEr
rorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) at org.apache.xerces.impl.XMLScanner.scanCharReferenceValue(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanCharReference(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.jdom.input.SAXBuilder.build(SAXBuilder.java:370) ... 48 more Caused by: org.xml.sax.SAXParseException: Character reference "" is an invalid XML character. at org.apache.xerces.util.ErrorHandlerWrapper.createSA
Please guide how to reasolve this problem.
Thanks and Regards,
Abhishek Parwal
From grzegorz.kaczor at gmail.com Tue Nov 6 01:13:02 2007
From: grzegorz.kaczor at gmail.com (Grzegorz Kaczor)
Date: Tue Nov 6 01:13:12 2007
Subject: [jdom-interest] Resetting the Root Element
In-Reply-To: <472F47C9.2050707@idmt.fraunhofer.de>
References: <472F47C9.2050707@idmt.fraunhofer.de>
Message-ID:
Hi,
you can create a new document and add to it contents of the root element.
Element root = new Element("new_root");
root.addContent(oldRoot.removeContent());
or something similar (I am writing from memory).
Regards,
Grzegorz
2007/11/5, Sebastian Hinterw?lder :
>
> Hello,
>
> I have a question concerning the root element of a normal XML document.
> Probably something like this already appeared in this list some time
> ago, but I don't get my problem solved so far.
>
> I have a normal "ATOM feed" which looks something like this:
>
>
>
> xmlns:dc="http://purl.org/dc/elements/1.1/"
> xml:lang="de">
> Golem.de
> IT-News fuer Profis
> ....
>
> Now I want to set a different root element using JDOM. I already tried
> it by cloning the whole document but this doesn't work. A different
> solution for me would also be removing the namespaces from the root. I
> am quite new to JDOM - so I hope someone knows a solution!
>
> Thanks in advance
>
> Sebastian
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>
--
"Cho? tyle wiemy w?asnym do?wiadczeniem:
W nas jest Raj, Piek?o - i do obu - szlaki."
J.K.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20071106/ff530b46/attachment.htm
From hintsn at idmt.fraunhofer.de Tue Nov 6 01:35:20 2007
From: hintsn at idmt.fraunhofer.de (=?ISO-8859-1?Q?Sebastian_Hinterw=E4lder?=)
Date: Tue Nov 6 01:35:26 2007
Subject: [jdom-interest] Resetting the Root Element
In-Reply-To: <47302C86.50100@atosorigin.com>
References: <472F47C9.2050707@idmt.fraunhofer.de>
<47302C86.50100@atosorigin.com>
Message-ID: <47303558.9000206@idmt.fraunhofer.de>
Hello
>
> You have to create a new root element and detach content from the old
> root to add it to the new root :
> Element newRoot = new Element(...);
> newRoot.setContent(oldRoot.removeContent());
>
>
Thanks a lot to you guys. That was exactly the solution I was searching
for. Great support.
Greets Sebastian
From laurent.bihanic at atosorigin.com Tue Nov 6 02:31:28 2007
From: laurent.bihanic at atosorigin.com (Laurent Bihanic)
Date: Tue Nov 6 02:31:44 2007
Subject: [jdom-interest] Issue with Jdom parsing control character
In-Reply-To: <47307A2D.9B34.007E.0@novell.com>
References: <47307A2D.9B34.007E.0@novell.com>
Message-ID: <47304280.7050706@atosorigin.com>
Hi,
Abhishek Parwal wrote:
> When i try to parse the control chars the following exception occurs:
>
> org.jdom.input.JDOMParseException: Error on line 1: Character reference
> "" is an invalid XML character. at
...
> Caused by: org.xml.sax.SAXParseException: Character reference "" is an invalid
XML character.
>
> Please guide how to reasolve this problem.
The error is reported by the underlying XML parser (Xerces). There is an
invalid character (NUL?) in the received XML document.
The list of allowed characters in XML is defined here :
http://www.w3.org/TR/REC-xml/#charsets
Laurent
From jhunter at servlets.com Tue Nov 6 09:43:42 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Tue Nov 6 09:43:50 2007
Subject: [jdom-interest] Resetting the Root Element
In-Reply-To: <47302C86.50100@atosorigin.com>
References: <472F47C9.2050707@idmt.fraunhofer.de>
<47302C86.50100@atosorigin.com>
Message-ID: <4730A7CE.9050405@servlets.com>
Laurent Bihanic wrote:
> Hi,
>
> Sebastian Hinterw?lder wrote:
>> Now I want to set a different root element using JDOM. I already tried
>> it by cloning the whole document but this doesn't work. A different
>> solution for me would also be removing the namespaces from the root. I
>> am quite new to JDOM - so I hope someone knows a solution!
>
> You have to create a new root element and detach content from the old
> root to add it to the new root :
> Element newRoot = new Element(...);
> newRoot.setContent(oldRoot.removeContent());
>
> Unfortunately, there is no Element.removeAttributes() method. So you'll
> probably have to iterate on the old root's attribute list to detach each
> attribute (using Iterator.remove()) and add it to the new root.
> Any better way, someone ?
You can do elt.setAttributes(null).
(Or pass an empty list.)
-jh-
From laurent.bihanic at atosorigin.com Wed Nov 7 01:28:29 2007
From: laurent.bihanic at atosorigin.com (Laurent Bihanic)
Date: Wed Nov 7 01:28:49 2007
Subject: [jdom-interest] Resetting the Root Element
In-Reply-To: <4730A7CE.9050405@servlets.com>
References: <472F47C9.2050707@idmt.fraunhofer.de> <47302C86.50100@atosorigin.com>
<4730A7CE.9050405@servlets.com>
Message-ID: <4731853D.101@atosorigin.com>
Jason Hunter wrote:
>> You have to create a new root element and detach content from the old
>> root to add it to the new root :
>> Element newRoot = new Element(...);
>> newRoot.setContent(oldRoot.removeContent());
>>
>> Unfortunately, there is no Element.removeAttributes() method. So
>> you'll probably have to iterate on the old root's attribute list to
>> detach each attribute (using Iterator.remove()) and add it to the new
>> root.
>> Any better way, someone ?
>
> You can do elt.setAttributes(null).
> (Or pass an empty list.)
Yes but the interest of removeContent() in the present case is that it returns
the list of the detached nodes. This is not the case for setAttributes() which
returns the current element; the detached attributes are then lost.
I was looking for a single-line-of-code attribute transfer, just as I can do
with content.
Laurent
From pabhishek at novell.com Wed Nov 7 09:53:56 2007
From: pabhishek at novell.com (Abhishek Parwal)
Date: Wed Nov 7 09:50:00 2007
Subject: [jdom-interest] Re: jdom-interest Digest, Vol 40, Issue 4
Message-ID: <4732490C0200007E0000AEC5@lucius.provo.novell.com>
thanks for the reply. The character coudnot be pasted in my editor. It
is a EOT(control code c0 ) chracter whose decimal value is 4. I have
read this is not allowed to be parsed by xml parser. but is there any
way it can be parsed.
Thanks and Regards,
Abhishek
On Tue, 2007-11-06 at 12:00 -0800, jdom-interest-request@jdom.org wrote:
> Send jdom-interest mailing list submissions to
> jdom-interest@jdom.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://www.jdom.org/mailman/listinfo/jdom-interest
> or, via email, send a message with subject or body 'help' to
> jdom-interest-request@jdom.org
>
> You can reach the person managing the list at
> jdom-interest-owner@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. Re: Resetting the Root Element (Laurent Bihanic)
> 2. Issue with Jdom parsing control character (Abhishek Parwal)
> 3. Re: Resetting the Root Element (Grzegorz Kaczor)
> 4. Re: Resetting the Root Element (Sebastian Hinterw?lder)
> 5. Re: Issue with Jdom parsing control character (Laurent Bihanic)
> 6. Re: Resetting the Root Element (Jason Hunter)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 06 Nov 2007 09:57:42 +0100
> From: Laurent Bihanic
> Subject: Re: [jdom-interest] Resetting the Root Element
> To: Sebastian Hinterw?lder
> Cc: jdom-interest@jdom.org
> Message-ID: <47302C86.50100@atosorigin.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi,
>
> Sebastian Hinterwlder wrote:
> > Now I want to set a different root element using JDOM. I already tried
> > it by cloning the whole document but this doesn't work. A different
> > solution for me would also be removing the namespaces from the root. I
> > am quite new to JDOM - so I hope someone knows a solution!
>
> You have to create a new root element and detach content from the old root to
> add it to the new root :
> Element newRoot = new Element(...);
> newRoot.setContent(oldRoot.removeContent());
>
> Unfortunately, there is no Element.removeAttributes() method. So you'll
> probably have to iterate on the old root's attribute list to detach each
> attribute (using Iterator.remove()) and add it to the new root.
> Any better way, someone ?
>
> Laurent
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 06 Nov 2007 02:06:25 -0700
> From: "Abhishek Parwal"
> Subject: [jdom-interest] Issue with Jdom parsing control character
> To:
> Message-ID: <47307A2D.9B34.007E.0@novell.com>
> Content-Type: text/plain; charset=US-ASCII
>
>
>
> Hi,
>
> When i try to parse the control chars the following exception occurs:
>
> org.jdom.input.JDOMParseException: Error on line 1: Character reference
> "" is an invalid XML character. at
> org.jdom.input.SAXBuilder.build(SAXBuilder.java:381) at
> org.jdom.input.SAXBuilder.build(SAXBuilder.java:764) at
> com.novell.emframe.dev.DataHandlerHelper.setString(DataHandlerHelper.java:233) at com.novell.emframe.dev.DirUtils.writeAttributeXML(DirUtils.java:648) at com.novell.emframe.fw.Target.write(Target.java:715) at com.novell.emframe.fw.TargetCollection.write(TargetCollection.java:434) at com.novell.emframe.dev.DirPropertyBookPage.save(DirPropertyBookPage.java:111) at com.novell.emframe.dev.PropertyBookPage.cache(PropertyBookPage.java:324) at com.novell.emframe.dev.PropertyBook.doApply(PropertyBook.java:920) at com.novell.emframe.dev.PropertyBook.execute(PropertyBook.java:155) at com.novell.emframe.dev.Task.execute(Task.java:505) at com.novell.nps.gadgetManager.BaseGadgetInstance.processRequest(BaseGadgetInstance.java:849) at com.novell.nps.gadgetManager.BaseGadgetInstance.handleAction(BaseGadgetInstance.java:2375) at com.novell.nps.gadgetManager.GadgetManager.processInstanceRequest(GadgetManager.java:1606) at com.novell.nps.gadgetManager.GadgetManager.processServiceRequest(Gadget!
> Manager.java:1062) at com.novell.nps.PortalServlet.handleFrameService(PortalServlet.java:496) at com.novell.nps.PortalServlet.processRequest(PortalServlet.java:369) at com.novell.nps.PortalServlet.doPost(PortalServlet.java:275) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at com.novell.emframe.fw.servlet.AuthenticatorServlet.service(AuthenticatorServlet.java:291) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.jav!
> a:198) at org.apache.catalina.core.StandardContextValve.invoke(Standar
> dContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.c!
> atalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:534) Caused by: org.xml.sax.SAXParseException: Character reference "" is an invalid XML character. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) at org.apache.xerces.impl.XMLErr!
> orReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLEr
> rorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) at org.apache.xerces.impl.XMLScanner.scanCharReferenceValue(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanCharReference(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.jdom.input.SAXBuilder.build(SAXBuilder.java:370) ... 48 more Caused by: org.xml.sax.SAXParseException: Character reference "" is an invalid XML character. at org.apache.xerces.util.ErrorHandlerWrapper.createSA
>
> Please guide how to reasolve this problem.
>
> Thanks and Regards,
> Abhishek Parwal
>
>
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 6 Nov 2007 10:13:02 +0100
> From: "Grzegorz Kaczor"
> Subject: Re: [jdom-interest] Resetting the Root Element
> To: " Sebastian Hinterw?lder "
> Cc: jdom-interest@jdom.org
> Message-ID:
>
> Content-Type: text/plain; charset="iso-8859-2"
>
> Hi,
>
> you can create a new document and add to it contents of the root element.
>
> Element root = new Element("new_root");
> root.addContent(oldRoot.removeContent());
>
> or something similar (I am writing from memory).
>
> Regards,
> Grzegorz
>
> 2007/11/5, Sebastian Hinterwlder :
> >
> > Hello,
> >
> > I have a question concerning the root element of a normal XML document.
> > Probably something like this already appeared in this list some time
> > ago, but I don't get my problem solved so far.
> >
> > I have a normal "ATOM feed" which looks something like this:
> >
> >
> >
> > > xmlns:dc="http://purl.org/dc/elements/1.1/"
> > xml:lang="de">
> > Golem.de
> > IT-News fuer Profis
> > ....
> >
> > Now I want to set a different root element using JDOM. I already tried
> > it by cloning the whole document but this doesn't work. A different
> > solution for me would also be removing the namespaces from the root. I
> > am quite new to JDOM - so I hope someone knows a solution!
> >
> > Thanks in advance
> >
> > Sebastian
> > _______________________________________________
> > To control your jdom-interest membership:
> > http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
> >
>
>
>
> --
> "Cho tyle wiemy wasnym dowiadczeniem:
> W nas jest Raj, Pieko - i do obu - szlaki."
> J.K.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20071106/ff530b46/attachment-0001.htm
>
> ------------------------------
>
> Message: 4
> Date: Tue, 06 Nov 2007 10:35:20 +0100
> From: Sebastian Hinterw?lder
> Subject: Re: [jdom-interest] Resetting the Root Element
> To: jdom-interest@jdom.org
> Message-ID: <47303558.9000206@idmt.fraunhofer.de>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hello
> >
> > You have to create a new root element and detach content from the old
> > root to add it to the new root :
> > Element newRoot = new Element(...);
> > newRoot.setContent(oldRoot.removeContent());
> >
> >
> Thanks a lot to you guys. That was exactly the solution I was searching
> for. Great support.
>
> Greets Sebastian
>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 06 Nov 2007 11:31:28 +0100
> From: Laurent Bihanic
> Subject: Re: [jdom-interest] Issue with Jdom parsing control character
> To: Abhishek Parwal
> Cc: jdom-interest@jdom.org
> Message-ID: <47304280.7050706@atosorigin.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi,
>
> Abhishek Parwal wrote:
> > When i try to parse the control chars the following exception occurs:
> >
> > org.jdom.input.JDOMParseException: Error on line 1: Character reference
> > "" is an invalid XML character. at
> ...
> > Caused by: org.xml.sax.SAXParseException: Character reference "" is an invalid
> XML character.
> >
> > Please guide how to reasolve this problem.
>
> The error is reported by the underlying XML parser (Xerces). There is an
> invalid character (NUL?) in the received XML document.
> The list of allowed characters in XML is defined here :
> http://www.w3.org/TR/REC-xml/#charsets
>
> Laurent
>
>
> ------------------------------
>
> Message: 6
> Date: Tue, 06 Nov 2007 09:43:42 -0800
> From: Jason Hunter
> Subject: Re: [jdom-interest] Resetting the Root Element
> To: Laurent Bihanic
> Cc: Sebastian Hinterw?lder ,
> jdom-interest@jdom.org
> Message-ID: <4730A7CE.9050405@servlets.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Laurent Bihanic wrote:
> > Hi,
> >
> > Sebastian Hinterwlder wrote:
> >> Now I want to set a different root element using JDOM. I already tried
> >> it by cloning the whole document but this doesn't work. A different
> >> solution for me would also be removing the namespaces from the root. I
> >> am quite new to JDOM - so I hope someone knows a solution!
> >
> > You have to create a new root element and detach content from the old
> > root to add it to the new root :
> > Element newRoot = new Element(...);
> > newRoot.setContent(oldRoot.removeContent());
> >
> > Unfortunately, there is no Element.removeAttributes() method. So you'll
> > probably have to iterate on the old root's attribute list to detach each
> > attribute (using Iterator.remove()) and add it to the new root.
> > Any better way, someone ?
>
> You can do elt.setAttributes(null).
>
> (Or pass an empty list.)
>
> -jh-
>
>
> ------------------------------
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>
> End of jdom-interest Digest, Vol 40, Issue 4
> ********************************************
From mike at saxonica.com Wed Nov 7 12:01:22 2007
From: mike at saxonica.com (Michael Kay)
Date: Wed Nov 7 12:01:47 2007
Subject: [jdom-interest] Re: jdom-interest Digest, Vol 40, Issue 4
In-Reply-To: <4732490C0200007E0000AEC5@lucius.provo.novell.com>
References: <4732490C0200007E0000AEC5@lucius.provo.novell.com>
Message-ID: <021601c82178$f86ca140$6501a8c0@turtle>
> thanks for the reply. The character coudnot be pasted in my
> editor. It is a EOT(control code c0 ) chracter whose decimal
> value is 4. I have read this is not allowed to be parsed by
> xml parser. but is there any way it can be parsed.
If your XML parser supports it, write the XML declaration as and write the EOT character as
Michael Kay
http://www.saxonica.com/
From jhunter at servlets.com Fri Nov 9 00:55:08 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Fri Nov 9 00:55:26 2007
Subject: [jdom-interest] Bug in ListIterator.add() method
In-Reply-To: <0FCC438D62A5E643AA3F57D3417B220D049C125D@TORMAIL.algorithmics.com>
References: <0F735D940624324485FD878EC1CA2CEF0681F8@TORMAIL.algorithmics.com> <0FCC438D62A5E643AA3F57D3417B220D280B12@TORMAIL.algorithmics.com>
<0FCC438D62A5E643AA3F57D3417B220D049C125D@TORMAIL.algorithmics.com>
Message-ID: <4734206C.7020800@servlets.com>
rolf.lear@algorithmics.com wrote:
> Hi Jason.
>
> Is there any feedback on this? I don't like pestering you but it would
> be very useful to have some idea of whether JDom is going to be patched
> in some way to fix the bug (it is at least 2 years old now).
>
> Thanks
>
> Rolf
Hi Rolf,
I just checked it in. Thanks for the great patch. Sorry it took so long.
One thing though. Can you confirm by posting to the list here that you
intended for this code to be included in JDOM. Your standard
company-added footer says the opposite:
> --------------------------------------------------------
> This email and any files transmitted with it are confidential and proprietary to Algorithmics Incorporated and its affiliates ("Algorithmics"). If received in error, use is prohibited. Please destroy, and notify sender. Sender does not waive confidentiality or privilege. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. Algorithmics does not accept liability for any errors or omissions. Any commitment intended to bind Algorithmics must be reduced to writing and signed by an authorized signatory.
> --------------------------------------------------------
-jh-
From jhunter at servlets.com Fri Nov 9 01:32:37 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Fri Nov 9 01:32:48 2007
Subject: [jdom-interest] NPE on Serialization
In-Reply-To: <200707100927.l6A9RNUJ028341@servlets.kattare.com>
References: <200707100927.l6A9RNUJ028341@servlets.kattare.com>
Message-ID: <47342935.9020807@servlets.com>
Thanks for the report. I fixed the bug. The fix is a little more
complicated than the patch you proposed since you need to indicate to
the receiver in readObject() the lack of a namespace and have it handle
that situation.
-jh-
Jan Kriesten wrote:
> Hi,
>
> I get the following NPE on serializing JDOM 1.0:
>
> ---8<---
> 11:17:15.220 ERROR [org.apache.wicket.util.lang.Objects ] - Error
> serializing object class de.silberlicht.wsl.test.HelloWor
> ld [object=[Page class = de.silberlicht.wsl.test.HelloWorld, id = 3, version = 0]]
> java.lang.NullPointerException
> at org.jdom.filter.ElementFilter.writeObject(ElementFilter.java:167)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ---8<---
>
> In ElementFilter.java:167 there's no check whether or not 'namespace' is
> actually set.
>
> Changing writeObject() to
>
> ---8<---
> private void writeObject(ObjectOutputStream out) throws IOException {
>
> out.defaultWriteObject();
>
> // We use writeObject() and not writeUTF() to minimize space
> // This allows for writing pointers to already written strings
> if( namespace!=null )
> {
> out.writeObject(namespace.getPrefix());
> out.writeObject(namespace.getURI());
> }
> }
> ---8<---
>
> solves the problem. Does this have any side-effects?
>
> Best regards, --- Jan.
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>
From jhunter at servlets.com Fri Nov 9 02:57:19 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Fri Nov 9 02:57:31 2007
Subject: [jdom-interest] Bug in ListIterator.add() method
In-Reply-To: <20CEA27AF49D7F4691F02E7ADC5D4ECD0513343D@tormail2.algorithmics.com>
References: <20CEA27AF49D7F4691F02E7ADC5D4ECD0513343D@tormail2.algorithmics.com>
Message-ID: <47343D0F.6090000@servlets.com>
Ah, here's Rolf's original post. The intent for inclusion is clear.
-jh-
Rolf Lear wrote:
> Since I dug up some of my JDOM stuff from years ago, here is my patch.
>
> I have run this through the JDom test harness (JDom-test), and all tests
> pass. (The harness did point out a couple of bugs .... which are now
> corrected.)
>
> Feel free to apply as you wish, I pass any ownership/copyright to Jason,
> etc.
>
> In essense, the patch completely re-writes the ListIterator in ContentList.
>
> Rolf
>
> Index: ContentList.java
> ===================================================================
> RCS file: /home/cvspublic/jdom/src/java/org/jdom/ContentList.java,v
> retrieving revision 1.39
> diff -u -r1.39 ContentList.java
> --- ContentList.java 28 Feb 2004 03:30:27 -0000 1.39
> +++ ContentList.java 22 Apr 2005 17:56:44 -0000
> @@ -84,19 +84,6 @@
>
> private static final int INITIAL_ARRAY_SIZE = 5;
>
> - /**
> - * Used inner class FilterListIterator to help hasNext and
> - * hasPrevious the next index of our cursor (must be here
> - * for JDK1.1).
> - */
> - private static final int CREATE = 0;
> - private static final int HASPREV = 1;
> - private static final int HASNEXT = 2;
> - private static final int PREV = 3;
> - private static final int NEXT = 4;
> - private static final int ADD = 5;
> - private static final int REMOVE = 6;
> -
> /** Our backing list */
> // protected ArrayList list;
> private Content elementData[];
> @@ -719,77 +706,91 @@
> /** The Filter that applies */
> Filter filter;
>
> - /** The last operation performed */
> - int lastOperation;
> -
> - /** Initial start index in backing list */
> - int initialCursor;
> -
> + /** Whether this iterator is in forward or reverse. */
> + private boolean forward = false;
> + /** Whether a call to remove() is valid */
> + private boolean canremove = false;
> + /** Whether a call to set() is valid */
> + private boolean canset = false;
> +
> /** Index in backing list of next object */
> - int cursor;
> -
> - /** Index in backing list of last object returned */
> - int last;
> + private int cursor = -1;
> + /** the backing index to use if we actually DO move */
> + private int tmpcursor = -1;
> + /** Index in ListIterator */
> + private int index = -1;
>
> /** Expected modCount in our backing list */
> - int expected;
> + private int expected = -1;
> +
> + /** Number of elements matching the filter. */
> + private int fsize = 0;
>
> /**
> * Default constructor
> */
> FilterListIterator(Filter filter, int start) {
> this.filter = filter;
> - initialCursor = initializeCursor(start);
> - last = -1;
> expected = ContentList.this.getModCount();
> - lastOperation = CREATE;
> + // always start list iterators in backward mode ....
> + // it makes sense... really.
> + forward = false;
> +
> + if (start < 0) {
> + throw new IndexOutOfBoundsException("Index: " + start);
> + }
> +
> + // the number of matching elements....
> + fsize = 0;
> +
> + // go through the list, count the matching elements...
> + for (int i = 0; i < ContentList.this.size(); i++) {
> + if (filter.matches(ContentList.this.get(i))) {
> + if (start == fsize) {
> + // set the back-end cursor to the matching
> element....
> + cursor = i;
> + // set the front-end cursor too.
> + index = fsize;
> + }
> + fsize++;
> + }
> + }
> +
> + if (start > fsize) {
> + throw new IndexOutOfBoundsException("Index: " + start +
> + " Size: " + fsize);
> + }
> +
> + if (cursor == -1) {
> + // implies that start == fsize (i.e. after the last element
> - valid for a ListIterator cursor.
> + // put the insertion point at the end of the Underlying
> content list ....
> + // i.e. an add() at this point may potentially end up with
> filtered content between previous() and next()
> + // the alternative is to put the cursor on the Content
> after the last Content that the filter passed
> + // The implications are ambiguous.
> + cursor = ContentList.this.size();
> + index = fsize;
> + }
> +
> }
>
> /**
> * Returns true
if this list iterator has a next
> element.
> */
> public boolean hasNext() {
> - checkConcurrentModification();
> -
> - switch(lastOperation) {
> - case CREATE: cursor = initialCursor;
> - break;
> - case PREV: cursor = last;
> - break;
> - case ADD:
> - case NEXT: cursor = moveForward(last + 1);
> - break;
> - case REMOVE: cursor = moveForward(last);
> - break;
> - case HASPREV: cursor = moveForward(cursor + 1);
> - break;
> - case HASNEXT: break;
> - default: throw new IllegalStateException("Unknown
> operation");
> - }
> -
> - if (lastOperation != CREATE) {
> - lastOperation = HASNEXT;
> - }
> -
> - return (cursor < ContentList.this.size()) ? true : false;
> + return nextIndex() < fsize;
> }
>
> /**
> * Returns the next element in the list.
> */
> public Object next() {
> - checkConcurrentModification();
> -
> - if (hasNext()) {
> - last = cursor;
> - }
> - else {
> - last = ContentList.this.size();
> - throw new NoSuchElementException();
> - }
> -
> - lastOperation = NEXT;
> - return ContentList.this.get(last);
> + if (! hasNext()) throw new NoSuchElementException("next() is
> beyond the end of the Iterator.");
> + index = nextIndex();
> + cursor = tmpcursor;
> + forward = true;
> + canremove = true;
> + canset = true;
> + return ContentList.this.get(cursor);
> }
>
> /**
> @@ -797,50 +798,20 @@
> * elements when traversing the list in the reverse direction.
> */
> public boolean hasPrevious() {
> - checkConcurrentModification();
> -
> - switch(lastOperation) {
> - case CREATE: cursor = initialCursor;
> - int size = ContentList.this.size();
> - if (cursor >= size) {
> - cursor = moveBackward(size - 1);
> - }
> - break;
> - case PREV:
> - case REMOVE: cursor = moveBackward(last - 1);
> - break;
> - case HASNEXT: cursor = moveBackward(cursor - 1);
> - break;
> - case ADD:
> - case NEXT: cursor = last;
> - break;
> - case HASPREV: break;
> - default: throw new IllegalStateException("Unknown
> operation");
> - }
> -
> - if (lastOperation != CREATE) {
> - lastOperation = HASPREV;
> - }
> -
> - return (cursor < 0) ? false : true;
> + return previousIndex() >= 0;
> }
>
> /**
> * Returns the previous element in the list.
> */
> public Object previous() {
> - checkConcurrentModification();
> -
> - if (hasPrevious()) {
> - last = cursor;
> - }
> - else {
> - last = -1;
> - throw new NoSuchElementException();
> - }
> -
> - lastOperation = PREV;
> - return ContentList.this.get(last);
> + if (! hasPrevious()) throw new
> NoSuchElementException("previous() is before the start of the Iterator.");
> + index = previousIndex();
> + cursor = tmpcursor;
> + forward = false;
> + canremove = true;
> + canset = true;
> + return ContentList.this.get(cursor);
> }
>
> /**
> @@ -849,19 +820,23 @@
> */
> public int nextIndex() {
> checkConcurrentModification();
> - hasNext();
> -
> - int count = 0;
> - for (int i = 0; i < ContentList.this.size(); i++) {
> - if (filter.matches(ContentList.this.get(i))) {
> - if (i == cursor) {
> - return count;
> +
> + if (forward) {
> + // starting with next possibility ....
> + for (int i = cursor + 1; i < ContentList.this.size(); i++)
> {
> + if (filter.matches(ContentList.this.get(i))) {
> + tmpcursor = i;
> + return index + 1;
> }
> - count++;
> }
> - }
> - expected = ContentList.this.getModCount();
> - return count;
> + // never found another match.... put the insertion point at
> the end of the list....
> + tmpcursor = ContentList.this.size();
> + return index + 1;
> + }
> +
> + // we've been going backwards ... so nextIndex() returns the
> same element.
> + tmpcursor = cursor;
> + return index;
> }
>
> /**
> @@ -871,37 +846,40 @@
> */
> public int previousIndex() {
> checkConcurrentModification();
> -
> - if (hasPrevious()) {
> - int count = 0;
> - for (int i = 0; i < ContentList.this.size(); i++) {
> + if (!forward) {
> + // starting with next possibility ....
> + for (int i = cursor - 1; i >= 0; i--) {
> if (filter.matches(ContentList.this.get(i))) {
> - if (i == cursor) {
> - return count;
> - }
> - count++;
> + tmpcursor = i;
> + return index - 1;
> }
> }
> - }
> - return -1;
> + // never found another match.... put the insertion point at
> the start of the list....
> + tmpcursor = -1;
> + return index -1;
> + }
> +
> + // we've been going forwards ... so previousIndex() returns the
> same element.
> + tmpcursor = cursor;
> + return index;
> +
> }
>
> /**
> * Inserts the specified element into the list.
> */
> public void add(Object obj) {
> - checkConcurrentModification();
> -
> - if (filter.matches(obj)) {
> - last = cursor + 1;
> - ContentList.this.add(last, obj);
> - }
> - else {
> - throw new IllegalAddException("Filter won't allow add of "
> +
> - (obj.getClass()).getName());
> - }
> - expected = ContentList.this.getModCount();
> - lastOperation = ADD;
> + // call to nextIndex() will check concurrent.
> + nextIndex();
> + // tmpcursor is the backing cursor of the next element
> + // remember that List.add(index,obj) is really an insert....
> + ContentList.this.add(tmpcursor, obj);
> + forward = true;
> + expected = getModCount();
> + canremove = canset = false;
> + index = nextIndex();
> + cursor = tmpcursor;
> + fsize++;
> }
>
> /**
> @@ -910,28 +888,15 @@
> * the last call to next
or previous
.
> */
> public void remove() {
> - checkConcurrentModification();
> -
> - if ((last < 0) || (lastOperation == REMOVE)) {
> - throw new IllegalStateException("no preceeding call to " +
> - "prev() or next()");
> - }
> -
> - if (lastOperation == ADD) {
> - throw new IllegalStateException("cannot call remove() " +
> - "after add()");
> - }
> -
> - Object old = ContentList.this.get(last);
> - if (filter.matches(old)) {
> - ContentList.this.remove(last);
> - }
> - else throw new IllegalAddException("Filter won't allow " +
> - (old.getClass()).getName()
> +
> - " (index " + last +
> - ") to be removed");
> - expected = ContentList.this.getModCount();
> - lastOperation = REMOVE;
> + if (!canremove) throw new IllegalStateException("Can not remove
> an element unless either next() or previous() has been called since the last
> remove()");
> + nextIndex(); // to get out cursor ...
> + ContentList.this.remove(cursor);
> + cursor = tmpcursor - 1;
> + expected = getModCount();
> + forward = false;
> + canremove = false;
> + canset = false;
> + fsize--;
> }
>
> /**
> @@ -939,98 +904,17 @@
> * previous
with the specified element.
> */
> public void set(Object obj) {
> + if (!canset) throw new IllegalStateException("Can not set an
> element unless either next() or previous() has been called since the last
> remove() or set()");
> checkConcurrentModification();
> -
> - if ((lastOperation == ADD) || (lastOperation == REMOVE)) {
> - throw new IllegalStateException("cannot call set() after "
> +
> - "add() or remove()");
> - }
> -
> - if (last < 0) {
> - throw new IllegalStateException("no preceeding call to " +
> - "prev() or next()");
> - }
> -
> - if (filter.matches(obj)) {
> - Object old = ContentList.this.get(last);
> - if (!filter.matches(old)) {
> - throw new IllegalAddException("Filter won't allow " +
> - (old.getClass()).getName() + " (index " +
> - last + ") to be removed");
> - }
> - ContentList.this.set(last, obj);
> - }
> - else {
> +
> + if (!filter.matches(obj)) {
> throw new IllegalAddException("Filter won't allow index " +
> - last + " to be set to " +
> + index + " to be set to " +
> (obj.getClass()).getName());
> }
>
> + ContentList.this.set(cursor, obj);
> expected = ContentList.this.getModCount();
> - // Don't set lastOperation
> - }
> -
> - /**
> - * Returns index in the backing list by moving forward start
> - * objects that match our filter.
> - */
> - private int initializeCursor(int start) {
> - if (start < 0) {
> - throw new IndexOutOfBoundsException("Index: " + start);
> - }
> -
> - int count = 0;
> - for (int i = 0; i < ContentList.this.size(); i++) {
> - Object obj = ContentList.this.get(i);
> - if (filter.matches(obj)) {
> - if (start == count) {
> - return i;
> - }
> - count++;
> - }
> - }
> -
> - if (start > count) {
> - throw new IndexOutOfBoundsException("Index: " + start +
> - " Size: " + count);
> - }
> -
> - return ContentList.this.size();
> - }
> -
> - /**
> - * Returns index in the backing list of the next object matching
> - * our filter, starting at the given index and moving forwards.
> - */
> - private int moveForward(int start) {
> - if (start < 0) {
> - start = 0;
> - }
> - for (int i = start; i < ContentList.this.size(); i++) {
> - Object obj = ContentList.this.get(i);
> - if (filter.matches(obj)) {
> - return i;
> - }
> - }
> - return ContentList.this.size();
> - }
> -
> - /**
> - * Returns index in the backing list of the next object matching
> - * our filter, starting at the given index and moving backwards.
> - */
> - private int moveBackward(int start) {
> - if (start >= ContentList.this.size()) {
> - start = ContentList.this.size() - 1;
> - }
> -
> - for (int i = start; i >= 0; --i) {
> - Object obj = ContentList.this.get(i);
> - if (filter.matches(obj)) {
> - return i;
> - }
> - }
> - return -1;
> }
>
> /**
>
>
>
> -----Original Message-----
> From: jdom-interest-bounces@jdom.org
> [mailto:jdom-interest-bounces@jdom.org]On Behalf Of Rolf Lear
> Sent: Friday, April 22, 2005 11:34 AM
> To: 'Bradley S. Huffman'; Christian Gruber
> Cc: jdom-interest@jdom.org
> Subject: RE: [jdom-interest] Bug in ListIterator.add() method
>
>
> The complete iterator stuff in JDom is based on pre-collections stuff. There
> is a lot of scope to re-hash the iterator problem.
>
> I'll volunteer a patch in the next couple of days if people want to see the
> iterator stuff re-written. When I was looking at the Parent/Child stuff a
> year or so ago I odentified the iterator processes as being a weak point in
> JDom in the sense that it was just plain complex. The wayu I though I would
> re-do it implied Java1.2 logic IIRC.
>
> Anyways, I'll use the weekend to produce a patch if people want.
>
> Rolf
>
>
>
> -----Original Message-----
> From: jdom-interest-bounces@jdom.org
> [mailto:jdom-interest-bounces@jdom.org]On Behalf Of Bradley S. Huffman
> Sent: Friday, April 22, 2005 10:57 AM
> To: Christian Gruber
> Cc: jdom-interest@jdom.org
> Subject: Re: [jdom-interest] Bug in ListIterator.add() method
>
>
> Christian Gruber writes:
>
>> As I suppose, Jdoms ListIterator.add() implementation has a problem
>> when it is called more than once and when it is called at the end of
>> the list.
>
> Looking at the code it looks like the sequence
>
> listIterator.add(new Element("a"));
> listIterator.add(new Element("b"));
> listIterator.add(new Element("c"));
>
> will produce instead of and continue iterating on
> element 2 () instead of after the last new element. That is a bug.
>
> Brad
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>
> This email and any files transmitted with it are confidential and
> proprietary to Algorithmics Incorporated and its affiliates
> ("Algorithmics"). If received in error, use is prohibited. Please destroy,
> and notify sender. Sender does not waive confidentiality or privilege.
> Internet communications cannot be guaranteed to be timely, secure, error or
> virus-free. Algorithmics does not accept liability for any errors or
> omissions. Any commitment intended to bind Algorithmics must be reduced to
> writing and signed by an authorized signatory.
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>
> This email and any files transmitted with it are confidential and
> proprietary to Algorithmics Incorporated and its affiliates
> ("Algorithmics"). If received in error, use is prohibited. Please destroy,
> and notify sender. Sender does not waive confidentiality or privilege.
> Internet communications cannot be guaranteed to be timely, secure, error or
> virus-free. Algorithmics does not accept liability for any errors or
> omissions. Any commitment intended to bind Algorithmics must be reduced to
> writing and signed by an authorized signatory.
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>
From Jasmin_Mehta at nexweb.org Fri Nov 9 05:15:29 2007
From: Jasmin_Mehta at nexweb.org (Jasmin_Mehta@nexweb.org)
Date: Fri Nov 9 05:15:58 2007
Subject: [jdom-interest] XMLTYPE using ResultSetBuilder
Message-ID:
Hi,
I want to make JDOM object from XML clob located in Oracle database column
that has datatype of 'XMLTYPE'. What changes I need to make in
ResultSetBuilder to get the value from that column and build Document
object out of it.
Thanks
Jasmin
******************************************************************************
ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION
Our domain name is changing. Please take note of the sender's
e-Mail address and make changes to your personal address list,
if needed. Both domains will continue to work, only for a limited
time.
******************************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or agency to whom they are addressed.
If you have received this email in error please notify the Navy
Exchange Service Command e-mail administrator. This footnote
also confirms that this email message has been scanned for the
presence of computer viruses.
Thank You!
******************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20071109/4bb743a5/attachment.htm
From rolf.lear at algorithmics.com Fri Nov 9 08:13:43 2007
From: rolf.lear at algorithmics.com (rolf.lear@algorithmics.com)
Date: Fri Nov 9 08:13:49 2007
Subject: [jdom-interest] Bug in ListIterator.add() method
In-Reply-To: <4734206C.7020800@servlets.com>
References: <0F735D940624324485FD878EC1CA2CEF0681F8@TORMAIL.algorithmics.com> <0FCC438D62A5E643AA3F57D3417B220D280B12@TORMAIL.algorithmics.com>
<0FCC438D62A5E643AA3F57D3417B220D049C125D@TORMAIL.algorithmics.com>
<4734206C.7020800@servlets.com>
Message-ID: <0FCC438D62A5E643AA3F57D3417B220D04C373FE@TORMAIL.algorithmics.com>
You're very welcome.
Rolf
-----Original Message-----
From: Jason Hunter [mailto:jhunter@servlets.com]
Sent: Friday, November 09, 2007 3:55 AM
To: Rolf Lear
Cc: jdom-interest@jdom.org
Subject: Re: [jdom-interest] Bug in ListIterator.add() method
rolf.lear@algorithmics.com wrote:
> Hi Jason.
>
> Is there any feedback on this? I don't like pestering you but it would
> be very useful to have some idea of whether JDom is going to be
patched
> in some way to fix the bug (it is at least 2 years old now).
>
> Thanks
>
> Rolf
Hi Rolf,
I just checked it in. Thanks for the great patch. Sorry it took so
long.
One thing though. Can you confirm by posting to the list here that you
intended for this code to be included in JDOM.
--------------------------------------------------------
This email and any files transmitted with it are confidential and proprietary to Algorithmics Incorporated and its affiliates ("Algorithmics"). If received in error, use is prohibited. Please destroy, and notify sender. Sender does not waive confidentiality or privilege. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. Algorithmics does not accept liability for any errors or omissions. Any commitment intended to bind Algorithmics must be reduced to writing and signed by an authorized signatory.
--------------------------------------------------------
From jhunter at servlets.com Sat Nov 10 00:11:22 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Sat Nov 10 00:11:39 2007
Subject: [jdom-interest] JDOM 1.1 Release Candidate
Message-ID: <473567AA.6080102@servlets.com>
I just posted a JDOM 1.1 release candidate for download!
This download is ready to go as far as I'm concerned, but I'm offering
it up as a release candidate preview because I want your help to make sure.
Please download the 1.1 candidate here:
http://www.jdom.org/dist/binary/jdom-1.1-RC.tar.gz // Unix
http://www.jdom.org/dist/binary/jdom-1.1-RC.zip // Windows
(The only difference is the line endings.)
Try the new build against your existing program(s). Let me know (you
can send private mail) if it works or if it doesn't. Either way I'd
like to know. I won't call this build final until I get a few OK's for
each build.
Two main things I want to verify:
* I built this with Java 5 using a Java 1.2 target. Will this still
work on older JVMs?
* Did I miss anything in packaging up the build? It's been a while. :)
I'm calling it 1.1 instead of 1.0.1 because there are some new public
properties, methods, and constructors.
Here's the list of additions and changes, from the CHANGES.txt file:
Added an additional constructor to JDOMSource with an EntityResolver
which is passed to the internal DocumentReader allowing the SAXOutputter
to properly resolve DTDs.
Added a forceNamespaceAware property to DOMOutputter which specifies you
want a DOM constructed with namespaces even if the source JDOM document
has no namespaces.
Added support for attribute "INF" and "-INF" values, to indicate
positive and negative infinity, as XML Schema allows.
Moved isXMLWhitespace() method from private in XMLOutputter to public in
Verifier.
Clarified XMLOutputter behavior with newlines and indents:
setIndent(" ") means newlines and " " indents
setIndent("") means newlines and "" indents
setIndent(null) means no newlines and no indents
Added set/getIgnoringBoundaryWhitespace() methods and features to
SAXBuilder and SAXHandler.
Added a string constant for the JDOM_OBJECT_MODEL_URI used by JAXP 1.3.
It deserves being part of the public API.
Fixed bug in SAXOutputter where default namespaces would be declared as
xmlns:="" with a spurious colon.
Fixed bug when using attributes without a namespace and outputting to a
JDOMResult.
Removing check that a comment not start with a hyphen. A careful reading
of production 15 in the XML 1.0 spec indicates leading hyphens are in
fact allowed.
Fixed bug where outputFragment() on SAXOutputter could cause a
NullPointerException because the locator would be null during the call.
Fixed bug where serializing ElementFilter causes a NullPointerException
if the filter has no assigned namespace
Fixed some subtle bad behaviors in listIterator.add() logic, using brand
new iterator logic.
Allowed a String to be passed to ContentList.add(int, Object).
Simplified JDOMAbout and renamed info.xml to jdom-info.xml, so
getResourceAsStream() won't suffer any name collision.
Fixed tiny issue where CDATA could be set with illegal character content.
Added logic to escape some special characters in namespace URIs.
Fixed bug where the attribute type would change on a setAttribute() call.
Improved performance on Namespace handling.
Improved and clarified Javadocs.
-jh-
From paul at activemath.org Mon Nov 12 01:39:51 2007
From: paul at activemath.org (Paul Libbrecht)
Date: Mon Nov 12 01:40:24 2007
Subject: [jdom-interest] JDOM 1.1 Release Candidate
In-Reply-To: <473567AA.6080102@servlets.com>
References: <473567AA.6080102@servlets.com>
Message-ID: <5FE0A6EC-AFD0-4821-9C31-2551457211E4@activemath.org>
Hello,
I wanted to know if a possibility of bringing to protected the
following methods of XMLOutputter.
void printNamespace(Writer,Namespace,NamespaceStack)
void printElementNamespace(Writer, Element,NamespaceStack)
This way, it owuld be possible to make "DTDAwareXMLOutputter", using
Mark Wutka's DTD-parser, which is an essential ingredient of any
refactoring method for XML-editors that edit languages with many
namespaces.
(I sent a version with no subclass, I am happy to provide in contribs
one as a subclass).
Currently, I had to patch directly the XMLOutputter which is no good
style and the relaxation of making protected these two methods could
lead me to a separate subclass.
With jdom-1.1 and this change ported up... everything runs fine in
ActiveMath after recompilation (running jdk1.5 on Linux).
Before, however, I had the following:
java.lang.NoSuchMethodError: org.jdom.Element.setAttributes(Ljava/
util/List;)Lorg/jdom/Element;
at
org.activemath.exercises.InteractionManager.decorateElement
(InteractionManager.java:1303)
at
org.activemath.exercises.InteractionManager.decorateElement
(InteractionManager.java:1264)
... and indeed setAttributes was for List in JDOM 1.0...
I would suggest you keep both methods.
thanks in advance
paul
Le 10 nov. 07 ? 09:11, Jason Hunter a ?crit :
> I just posted a JDOM 1.1 release candidate for download!
>
> This download is ready to go as far as I'm concerned, but I'm
> offering it up as a release candidate preview because I want your
> help to make sure.
>
> Please download the 1.1 candidate here:
>
> http://www.jdom.org/dist/binary/jdom-1.1-RC.tar.gz // Unix
> http://www.jdom.org/dist/binary/jdom-1.1-RC.zip // Windows
>
> (The only difference is the line endings.)
>
> Try the new build against your existing program(s). Let me know
> (you can send private mail) if it works or if it doesn't. Either
> way I'd like to know. I won't call this build final until I get a
> few OK's for each build.
>
> Two main things I want to verify:
>
> * I built this with Java 5 using a Java 1.2 target. Will this
> still work on older JVMs?
>
> * Did I miss anything in packaging up the build? It's been a
> while. :)
>
>
> I'm calling it 1.1 instead of 1.0.1 because there are some new
> public properties, methods, and constructors.
>
> Here's the list of additions and changes, from the CHANGES.txt file:
>
> Added an additional constructor to JDOMSource with an
> EntityResolver which is passed to the internal DocumentReader
> allowing the SAXOutputter to properly resolve DTDs.
>
> Added a forceNamespaceAware property to DOMOutputter which
> specifies you want a DOM constructed with namespaces even if the
> source JDOM document has no namespaces.
>
> Added support for attribute "INF" and "-INF" values, to indicate
> positive and negative infinity, as XML Schema allows.
>
> Moved isXMLWhitespace() method from private in XMLOutputter to
> public in
> Verifier.
>
> Clarified XMLOutputter behavior with newlines and indents:
> setIndent(" ") means newlines and " " indents
> setIndent("") means newlines and "" indents
> setIndent(null) means no newlines and no indents
>
> Added set/getIgnoringBoundaryWhitespace() methods and features to
> SAXBuilder and SAXHandler.
>
> Added a string constant for the JDOM_OBJECT_MODEL_URI used by JAXP
> 1.3. It deserves being part of the public API.
>
> Fixed bug in SAXOutputter where default namespaces would be
> declared as
> xmlns:="" with a spurious colon.
>
> Fixed bug when using attributes without a namespace and outputting
> to a
> JDOMResult.
>
> Removing check that a comment not start with a hyphen. A careful
> reading of production 15 in the XML 1.0 spec indicates leading
> hyphens are in fact allowed.
>
> Fixed bug where outputFragment() on SAXOutputter could cause a
> NullPointerException because the locator would be null during the
> call.
>
> Fixed bug where serializing ElementFilter causes a
> NullPointerException if the filter has no assigned namespace
>
> Fixed some subtle bad behaviors in listIterator.add() logic, using
> brand new iterator logic.
>
> Allowed a String to be passed to ContentList.add(int, Object).
>
> Simplified JDOMAbout and renamed info.xml to jdom-info.xml, so
> getResourceAsStream() won't suffer any name collision.
>
> Fixed tiny issue where CDATA could be set with illegal character
> content.
>
> Added logic to escape some special characters in namespace URIs.
>
> Fixed bug where the attribute type would change on a setAttribute()
> call.
>
> Improved performance on Namespace handling.
>
> Improved and clarified Javadocs.
>
> -jh-
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/
> youraddr@yourhost.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2203 bytes
Desc: not available
Url : http://www.jdom.org/pipermail/jdom-interest/attachments/20071112/36f33db8/smime.bin
From mj-lists at expertsystems.se Mon Nov 12 08:35:37 2007
From: mj-lists at expertsystems.se (Mattias Jiderhamn)
Date: Mon Nov 12 08:35:24 2007
Subject: [jdom-interest] JDOM 1.1 Release Candidate
In-Reply-To: <473567AA.6080102@servlets.com>
References: <473567AA.6080102@servlets.com>
Message-ID: <473880D9.9060301@expertsystems.se>
This is good news!
I would like to confirm that the patch I supplied for "Fixed bug when
using attributes without a namespace and outputting to a JDOMResult."
seems to be working fine with the "jdom-1.1-RC.zip" build.
Running JDK 1.5.
/Mattias
Jason Hunter wrote (2007-11-10 09:11):
> I just posted a JDOM 1.1 release candidate for download!
>
> This download is ready to go as far as I'm concerned, but I'm offering
> it up as a release candidate preview because I want your help to make
> sure.
>
> Please download the 1.1 candidate here:
>
> http://www.jdom.org/dist/binary/jdom-1.1-RC.tar.gz // Unix
> http://www.jdom.org/dist/binary/jdom-1.1-RC.zip // Windows
>
> (The only difference is the line endings.)
>
> Try the new build against your existing program(s). Let me know (you
> can send private mail) if it works or if it doesn't. Either way I'd
> like to know. I won't call this build final until I get a few OK's
> for each build.
>
> Two main things I want to verify:
>
> * I built this with Java 5 using a Java 1.2 target. Will this still
> work on older JVMs?
>
> * Did I miss anything in packaging up the build? It's been a while. :)
>
>
> I'm calling it 1.1 instead of 1.0.1 because there are some new public
> properties, methods, and constructors.
>
> Here's the list of additions and changes, from the CHANGES.txt file:
>
> Added an additional constructor to JDOMSource with an EntityResolver
> which is passed to the internal DocumentReader allowing the
> SAXOutputter to properly resolve DTDs.
>
> Added a forceNamespaceAware property to DOMOutputter which specifies
> you want a DOM constructed with namespaces even if the source JDOM
> document has no namespaces.
>
> Added support for attribute "INF" and "-INF" values, to indicate
> positive and negative infinity, as XML Schema allows.
>
> Moved isXMLWhitespace() method from private in XMLOutputter to public in
> Verifier.
>
> Clarified XMLOutputter behavior with newlines and indents:
> setIndent(" ") means newlines and " " indents
> setIndent("") means newlines and "" indents
> setIndent(null) means no newlines and no indents
>
> Added set/getIgnoringBoundaryWhitespace() methods and features to
> SAXBuilder and SAXHandler.
>
> Added a string constant for the JDOM_OBJECT_MODEL_URI used by JAXP
> 1.3. It deserves being part of the public API.
>
> Fixed bug in SAXOutputter where default namespaces would be declared as
> xmlns:="" with a spurious colon.
>
> Fixed bug when using attributes without a namespace and outputting to a
> JDOMResult.
>
> Removing check that a comment not start with a hyphen. A careful
> reading of production 15 in the XML 1.0 spec indicates leading hyphens
> are in fact allowed.
>
> Fixed bug where outputFragment() on SAXOutputter could cause a
> NullPointerException because the locator would be null during the call.
>
> Fixed bug where serializing ElementFilter causes a
> NullPointerException if the filter has no assigned namespace
>
> Fixed some subtle bad behaviors in listIterator.add() logic, using
> brand new iterator logic.
>
> Allowed a String to be passed to ContentList.add(int, Object).
>
> Simplified JDOMAbout and renamed info.xml to jdom-info.xml, so
> getResourceAsStream() won't suffer any name collision.
>
> Fixed tiny issue where CDATA could be set with illegal character content.
>
> Added logic to escape some special characters in namespace URIs.
>
> Fixed bug where the attribute type would change on a setAttribute() call.
>
> Improved performance on Namespace handling.
>
> Improved and clarified Javadocs.
>
> -jh-
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>
From jhunter at servlets.com Tue Nov 13 21:05:37 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Tue Nov 13 21:05:48 2007
Subject: [jdom-interest] JDOM 1.1 Release Candidate
In-Reply-To: <5FE0A6EC-AFD0-4821-9C31-2551457211E4@activemath.org>
References: <473567AA.6080102@servlets.com>
<5FE0A6EC-AFD0-4821-9C31-2551457211E4@activemath.org>
Message-ID: <473A8221.8050007@servlets.com>
> With jdom-1.1 and this change ported up... everything runs fine in
> ActiveMath after recompilation (running jdk1.5 on Linux).
>
> Before, however, I had the following:
>
> java.lang.NoSuchMethodError:
> org.jdom.Element.setAttributes(Ljava/util/List;)Lorg/jdom/Element;
> at
> org.activemath.exercises.InteractionManager.decorateElement(InteractionManager.java:1303)
>
> at
> org.activemath.exercises.InteractionManager.decorateElement(InteractionManager.java:1264)
>
>
> ... and indeed setAttributes was for List in JDOM 1.0...
> I would suggest you keep both methods.
Great catch! This is exactly why I make the release candidates.
I've added back setAttributes(List) and kept setAttributes(Collection)
as well. I don't think there's any other situations like this. But
please do check for me against the RC I'll build later tonight. The
goal of course is no recompile needed, just drop-in compatible.
-jh-
From jhunter at servlets.com Tue Nov 13 21:08:12 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Tue Nov 13 21:08:22 2007
Subject: [jdom-interest] JDOM 1.1 Release Candidate
In-Reply-To: <5FE0A6EC-AFD0-4821-9C31-2551457211E4@activemath.org>
References: <473567AA.6080102@servlets.com>
<5FE0A6EC-AFD0-4821-9C31-2551457211E4@activemath.org>
Message-ID: <473A82BC.5000401@servlets.com>
Paul Libbrecht wrote:
> Hello,
>
>
> I wanted to know if a possibility of bringing to protected the following
> methods of XMLOutputter.
>
> void printNamespace(Writer,Namespace,NamespaceStack)
> void printElementNamespace(Writer, Element,NamespaceStack)
>
> This way, it owuld be possible to make "DTDAwareXMLOutputter", using
> Mark Wutka's DTD-parser, which is an essential ingredient of any
> refactoring method for XML-editors that edit languages with many
> namespaces.
> (I sent a version with no subclass, I am happy to provide in contribs
> one as a subclass).
This one I'm leery of. If we make it protected that's a promise to
always keep it behaving the way it is right now. The NamespaceStack is
supposed to be an internal detail.
Can you picture a way to accomplish what you want without the
subclassing? Like some sort of strategy pattern?
-jh-
From jhunter at servlets.com Tue Nov 13 23:35:31 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Tue Nov 13 23:35:41 2007
Subject: [jdom-interest] JDOM 1.1 RC2
Message-ID: <473AA543.30709@servlets.com>
I've just posted a second release candidate.
http://www.jdom.org/dist/binary/jdom-1.1-rc2.tar.gz // unix
http://www.jdom.org/dist/binary/jdom-1.1-rc2.zip // windows
(Only difference between unix and windows is line endings.)
Changes since RC1:
* Restored the setAttributes(List) method because even though
setAttributes(Collection) is equivalent, the built JAR won't work as a
drop-in without an exact signature match; you'd need to recompile. Now
we have both methods and no recompile should be necessary. I'd like
people to verify this.
* Added XSLTransformer.setFactory(). Good, easy feature request.
* Patch in jdom-contrib from Laurent fixing an ElementScanner problem.
Please try this jdom.jar in your project and let me know how it works
for you. I'd like an email either way.
-jh-
From Clint.Redwood at xansa.com Thu Nov 15 02:03:36 2007
From: Clint.Redwood at xansa.com (Clint.Redwood@xansa.com)
Date: Thu Nov 15 02:11:37 2007
Subject: [jdom-interest] XSLTransformer.transform method - thread safe?
In-Reply-To: <200711142000.lAEK03nx029488@servlets.kattare.com>
Message-ID:
Hi,
I've just had an XSL transform go VERY weird, and I think it may be that
two threads tried to use the same XSLTransformer object at the same time.
The result seemed to be that it returned the untransformed data.
I'm using the Saxon 8.9 XSLT2.0 Engine, and also there are some SAXON-SQL
queries in the XSLT in question.
The Javadoc states that the XSLTransformer is thread safe, but I'm not sure
if I've either found an issue with this, or if there's something not
threadsafe in the Saxon implementation.
Any suggestions as to how I could confirm this would be appreaciated as
I've not done much in the way of multi-threaded debugging.
Yours,
Clint Redwood
Senior Solutions Architect - Boots Account
Xansa, a Steria company
t 0115 9595730 (Ext) 725730 (Int)
e clint.redwood@xansa.com
e clint.redwood@bcm-ltd.co.uk
http://www.xansa.com
Whilst this email has been checked for all known viruses, recipients should undertake their own virus checking as Xansa will not accept any liability whatsoever.
This email and any files transmitted with it are confidential and protected by client privilege. It is solely for the use of the intended recipient.
Please delete it and notify the sender if you have received it in
error. Unauthorised use is prohibited.
Any opinions expressed in this email are those of the individual and not
necessarily the organisation.
Xansa, Registered Office: 420 Thames Valley Park Drive,
Thames Valley Park, Reading, RG6 1PU, UK.
Registered in England No.1000954.
t +44 (0)8702 416181
w www.xansa.com
From laurent.bihanic at atosorigin.com Thu Nov 15 03:17:24 2007
From: laurent.bihanic at atosorigin.com (Laurent Bihanic)
Date: Thu Nov 15 03:17:37 2007
Subject: [jdom-interest] XSLTransformer.transform method - thread safe?
In-Reply-To:
References:
Message-ID: <473C2AC4.6020306@atosorigin.com>
Hi,
Clint.Redwood@xansa.com wrote:
> I've just had an XSL transform go VERY weird, and I think it may be that
> two threads tried to use the same XSLTransformer object at the same time.
> The result seemed to be that it returned the untransformed data.
>
> I'm using the Saxon 8.9 XSLT2.0 Engine, and also there are some SAXON-SQL
> queries in the XSLT in question.
>
> The Javadoc states that the XSLTransformer is thread safe, but I'm not sure
> if I've either found an issue with this, or if there's something not
> threadsafe in the Saxon implementation.
XSLTransformer is thread-safe in that it only shares a Templates object
between transformations and allocate a new TrAX Transformer for every call to
transform(). JAXP TrAX explicitely requires that Templates be thread-safe.
I don't recall ever having any multi-threading issue with Saxon.
Could it be an initialisation issue where your threads start performing
transformations before XSLTransformer constructor finishes ?
Laurent
From mike at saxonica.com Thu Nov 15 03:27:54 2007
From: mike at saxonica.com (Michael Kay)
Date: Thu Nov 15 03:28:15 2007
Subject: [jdom-interest] XSLTransformer.transform method - thread safe?
In-Reply-To:
References: <200711142000.lAEK03nx029488@servlets.kattare.com>
Message-ID: <010401c8277a$90e94840$6501a8c0@turtle>
The JDOM XSLTransformer class is really just a wrapper for a JAXP Templates
object, so it ought to be thread-safe. Bugs are always possible, but they
need evidence!
Note that when you do a Saxon transformation using this mechanism, it copies
the input from a JDOM tree to a Saxon tree. It's also possible to do a
transformation using Saxon that operates on the JDOM tree without copying,
by creating a net.sf.saxon.jdom.DocumentWrapper and supplying that as the
Source object. (However, this won't always perform better - it depends what
the transformation is actually doing).
There's only been one multithreading bug detected in Saxon over the last
year [1], and that only affects XQuery.
Michael Kay
http://www.saxonica.com/
[1]
http://sourceforge.net/tracker/index.php?func=detail&aid=1673048&group_id=29
872&atid=397617
> -----Original Message-----
> From: jdom-interest-bounces@jdom.org
> [mailto:jdom-interest-bounces@jdom.org] On Behalf Of
> Clint.Redwood@xansa.com
> Sent: 15 November 2007 10:04
> To: jdom-interest@jdom.org
> Subject: [jdom-interest] XSLTransformer.transform method -
> thread safe?
>
> Hi,
>
> I've just had an XSL transform go VERY weird, and I think it
> may be that two threads tried to use the same XSLTransformer
> object at the same time.
> The result seemed to be that it returned the untransformed data.
>
> I'm using the Saxon 8.9 XSLT2.0 Engine, and also there are
> some SAXON-SQL queries in the XSLT in question.
>
> The Javadoc states that the XSLTransformer is thread safe,
> but I'm not sure if I've either found an issue with this, or
> if there's something not threadsafe in the Saxon implementation.
>
> Any suggestions as to how I could confirm this would be
> appreaciated as I've not done much in the way of
> multi-threaded debugging.
>
> Yours,
>
> Clint Redwood
> Senior Solutions Architect - Boots Account Xansa, a Steria
> company t 0115 9595730 (Ext) 725730 (Int) e
> clint.redwood@xansa.com e clint.redwood@bcm-ltd.co.uk
> http://www.xansa.com
>
>
> Whilst this email has been checked for all known viruses,
> recipients should undertake their own virus checking as Xansa
> will not accept any liability whatsoever.
>
> This email and any files transmitted with it are confidential
> and protected by client privilege. It is solely for the use
> of the intended recipient.
> Please delete it and notify the sender if you have received
> it in error. Unauthorised use is prohibited.
>
> Any opinions expressed in this email are those of the
> individual and not necessarily the organisation.
> Xansa, Registered Office: 420 Thames Valley Park Drive,
> Thames Valley Park, Reading, RG6 1PU, UK.
> Registered in England No.1000954.
> t +44 (0)8702 416181
> w www.xansa.com
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@you
> rhost.com
From Clint.Redwood at xansa.com Thu Nov 15 03:47:17 2007
From: Clint.Redwood at xansa.com (Clint.Redwood@xansa.com)
Date: Thu Nov 15 03:48:10 2007
Subject: [jdom-interest] XSLTransformer.transform method - thread safe?
In-Reply-To: <010401c8277a$90e94840$6501a8c0@turtle>
Message-ID:
Micheal and Laurent,
Thanks for your resposes. I've rechecked my log files and I misread the
issue. It appears that my program has just managed to completely miss out
the transformation step on one of the threads.
Apologies for having wasted your time.
Yours,
Clint Redwood
Senior Solutions Architect - Boots Account
Xansa, a Steria company
t 0115 9595730 (Ext) 725730 (Int)
e clint.redwood@xansa.com
e clint.redwood@bcm-ltd.co.uk
http://www.xansa.com
"Michael Kay"
To
,
15 November 2007
11:27 GMT cc
Subject
RE: [jdom-interest]
XSLTransformer.transform method -
thread safe?
The JDOM XSLTransformer class is really just a wrapper for a JAXP Templates
object, so it ought to be thread-safe. Bugs are always possible, but they
need evidence!
Note that when you do a Saxon transformation using this mechanism, it
copies
the input from a JDOM tree to a Saxon tree. It's also possible to do a
transformation using Saxon that operates on the JDOM tree without copying,
by creating a net.sf.saxon.jdom.DocumentWrapper and supplying that as the
Source object. (However, this won't always perform better - it depends what
the transformation is actually doing).
There's only been one multithreading bug detected in Saxon over the last
year [1], and that only affects XQuery.
Michael Kay
http://www.saxonica.com/
[1]
http://sourceforge.net/tracker/index.php?func=detail&aid=1673048&group_id=29
872&atid=397617
> -----Original Message-----
> From: jdom-interest-bounces@jdom.org
> [mailto:jdom-interest-bounces@jdom.org] On Behalf Of
> Clint.Redwood@xansa.com
> Sent: 15 November 2007 10:04
> To: jdom-interest@jdom.org
> Subject: [jdom-interest] XSLTransformer.transform method -
> thread safe?
>
> Hi,
>
> I've just had an XSL transform go VERY weird, and I think it
> may be that two threads tried to use the same XSLTransformer
> object at the same time.
> The result seemed to be that it returned the untransformed data.
>
> I'm using the Saxon 8.9 XSLT2.0 Engine, and also there are
> some SAXON-SQL queries in the XSLT in question.
>
> The Javadoc states that the XSLTransformer is thread safe,
> but I'm not sure if I've either found an issue with this, or
> if there's something not threadsafe in the Saxon implementation.
>
> Any suggestions as to how I could confirm this would be
> appreaciated as I've not done much in the way of
> multi-threaded debugging.
>
> Yours,
>
> Clint Redwood
> Senior Solutions Architect - Boots Account Xansa, a Steria
> company t 0115 9595730 (Ext) 725730 (Int) e
> clint.redwood@xansa.com e clint.redwood@bcm-ltd.co.uk
> http://www.xansa.com
>
>
> Whilst this email has been checked for all known viruses,
> recipients should undertake their own virus checking as Xansa
> will not accept any liability whatsoever.
>
> This email and any files transmitted with it are confidential
> and protected by client privilege. It is solely for the use
> of the intended recipient.
> Please delete it and notify the sender if you have received
> it in error. Unauthorised use is prohibited.
>
> Any opinions expressed in this email are those of the
> individual and not necessarily the organisation.
> Xansa, Registered Office: 420 Thames Valley Park Drive,
> Thames Valley Park, Reading, RG6 1PU, UK.
> Registered in England No.1000954.
> t +44 (0)8702 416181
> w www.xansa.com
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@you
> rhost.com
Whilst this email has been checked for all known viruses, recipients should undertake their own virus checking as Xansa will not accept any liability whatsoever.
This email and any files transmitted with it are confidential and protected by client privilege. It is solely for the use of the intended recipient.
Please delete it and notify the sender if you have received it in
error. Unauthorised use is prohibited.
Any opinions expressed in this email are those of the individual and not
necessarily the organisation.
Xansa, Registered Office: 420 Thames Valley Park Drive,
Thames Valley Park, Reading, RG6 1PU, UK.
Registered in England No.1000954.
t +44 (0)8702 416181
w www.xansa.com
From Jasmin_Mehta at nexweb.org Thu Nov 15 11:50:15 2007
From: Jasmin_Mehta at nexweb.org (Jasmin_Mehta@nexweb.org)
Date: Thu Nov 15 11:50:37 2007
Subject: [jdom-interest] Merge two different XML document
Message-ID:
Hi,
I have two XML document as listed below:
1) (xmlDocA)
NP
Rockville
2442
1221 E Otem Circle
Miami
FL
91991
2) (xmlDocB)
I want to merge document 1) in to document 2) under
element.
Is it possible?
When I try to do that I get org.jdom.IllegalAddException: The Content
already has an existing parent
Code:
SAXBuilder saxBuilder = new SAXBuilder();
java.io.File xmlFile = new File("xmlDocA");
org.jdom.Document xmlDocumentA = saxBuilder.build(xmlFile);
xmlFile = new File("xmlDocB");
org.jdom.Document xmlDocumentB = saxBuilder.build(xmlFile);
Element rootA = xmlDocumentA.getRootElement();
List childrenDocA = rootA.getChildren();
Element rootB = xmlDocumentB.getRootElement();
Element childDocB = rootB.getChild("TransmissionBody");
childDocB.addContent(childrenDocA); ----------------- Exception at
this line
XMLOutputter xmlOutPutter = new
XMLOutputter(Format.getPrettyFormat());
xmlOutPutter.output(xmlDocumentB, System.out);
Thanks
Jasmin
******************************************************************************
ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION
Our domain name is changing. Please take note of the sender's
e-Mail address and make changes to your personal address list,
if needed. Both domains will continue to work, only for a limited
time.
******************************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or agency to whom they are addressed.
If you have received this email in error please notify the Navy
Exchange Service Command e-mail administrator. This footnote
also confirms that this email message has been scanned for the
presence of computer viruses.
Thank You!
******************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20071115/84e8a722/attachment.htm
From jhunter at servlets.com Thu Nov 15 13:38:48 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Thu Nov 15 13:38:59 2007
Subject: [jdom-interest] Merge two different XML document
In-Reply-To:
References:
Message-ID: <473CBC68.90608@servlets.com>
http://jdom.org/docs/faq.html#a0230
-jh-
Jasmin_Mehta@nexweb.org wrote:
>
> Hi,
>
> I have two XML document as listed below:
>
> 1) (xmlDocA)
>
>
>
> NP
>
>
> Rockville
>
>
>
>
> 2442
> 1221 E Otem Circle
>
> Miami
> FL
> 91991
>
>
>
>
> 2) (xmlDocB)
>
>
>
>
>
>
>
>
>
>
>
> I want to merge document 1) in to document 2) under
> element.
>
> Is it possible?
>
> When I try to do that I get org.jdom.IllegalAddException: The Content
> already has an existing parent
>
> Code:
>
> SAXBuilder saxBuilder = new SAXBuilder();
> java.io.File xmlFile = new File("xmlDocA");
> org.jdom.Document xmlDocumentA = saxBuilder.build(xmlFile);
>
> xmlFile = new File("xmlDocB");
> org.jdom.Document xmlDocumentB = saxBuilder.build(xmlFile);
>
> Element rootA = xmlDocumentA.getRootElement();
> List childrenDocA = rootA.getChildren();
>
> Element rootB = xmlDocumentB.getRootElement();
> Element childDocB = rootB.getChild("TransmissionBody");
>
> childDocB.addContent(childrenDocA);
> ----------------- Exception at this line
>
> XMLOutputter xmlOutPutter = new
> XMLOutputter(Format.getPrettyFormat());
> xmlOutPutter.output(xmlDocumentB, System.out);
>
> Thanks
> Jasmin
>
>
> *******************************************************************************
> *ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION
> Our domain name is changing. Please take note of the sender's
> e-Mail address and make changes to your personal address list,
> if needed. Both domains will continue to work, only for a limited
> time.
> ******************************************************************************
> This email and any files transmitted with it are intended solely for
> the use of the individual or agency to whom they are addressed.
> If you have received this email in error please notify the Navy
> Exchange Service Command e-mail administrator. This footnote
> also confirms that this email message has been scanned for the
> presence of computer viruses.
>
> Thank You!
> ********************************************************************************
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
From jhunter at servlets.com Thu Nov 15 14:24:03 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Thu Nov 15 14:24:10 2007
Subject: [jdom-interest] JDOM 1.1 RC2
In-Reply-To: <473AA543.30709@servlets.com>
References: <473AA543.30709@servlets.com>
Message-ID: <473CC703.5030605@servlets.com>
Reminder: Please do a check with this new JAR against your existing
code, to make sure you don't find yourself stuck with any breakage.
I've slated to formally go 1.1 on Monday.
-jh-
Jason Hunter wrote:
> I've just posted a second release candidate.
>
> http://www.jdom.org/dist/binary/jdom-1.1-rc2.tar.gz // unix
> http://www.jdom.org/dist/binary/jdom-1.1-rc2.zip // windows
>
> (Only difference between unix and windows is line endings.)
>
> Changes since RC1:
>
> * Restored the setAttributes(List) method because even though
> setAttributes(Collection) is equivalent, the built JAR won't work as a
> drop-in without an exact signature match; you'd need to recompile. Now
> we have both methods and no recompile should be necessary. I'd like
> people to verify this.
>
> * Added XSLTransformer.setFactory(). Good, easy feature request.
>
> * Patch in jdom-contrib from Laurent fixing an ElementScanner problem.
>
> Please try this jdom.jar in your project and let me know how it works
> for you. I'd like an email either way.
>
> -jh-
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
From paul at activemath.org Fri Nov 16 02:02:57 2007
From: paul at activemath.org (Paul Libbrecht)
Date: Fri Nov 16 02:09:23 2007
Subject: [jdom-interest] JDOM 1.1 RC2
In-Reply-To: <473CC703.5030605@servlets.com>
References: <473AA543.30709@servlets.com> <473CC703.5030605@servlets.com>
Message-ID:
I don't see the bug anymore.
The rest seems to work fine, drop-in.
Fine.
paul
Le 15 nov. 07 ? 23:24, Jason Hunter a ?crit :
> Reminder: Please do a check with this new JAR against your
> existing code, to make sure you don't find yourself stuck with any
> breakage.
>
> I've slated to formally go 1.1 on Monday.
>
> -jh-
>
> Jason Hunter wrote:
>> I've just posted a second release candidate.
>> http://www.jdom.org/dist/binary/jdom-1.1-rc2.tar.gz // unix
>> http://www.jdom.org/dist/binary/jdom-1.1-rc2.zip // windows
>> (Only difference between unix and windows is line endings.)
>> Changes since RC1:
>> * Restored the setAttributes(List) method because even though
>> setAttributes(Collection) is equivalent, the built JAR won't work
>> as a drop-in without an exact signature match; you'd need to
>> recompile. Now we have both methods and no recompile should be
>> necessary. I'd like people to verify this.
>> * Added XSLTransformer.setFactory(). Good, easy feature request.
>> * Patch in jdom-contrib from Laurent fixing an ElementScanner
>> problem.
>> Please try this jdom.jar in your project and let me know how it
>> works for you. I'd like an email either way.
From ramo at skuff-band.de Fri Nov 16 13:50:07 2007
From: ramo at skuff-band.de (Ramo At Skuff)
Date: Fri Nov 16 13:50:20 2007
Subject: [jdom-interest] Namespace problems
Message-ID: <001601c8289a$a765a430$f630ec90$@de>
Hi,
i wanted to add the xmlns="http://www.w3.org/1999/xhtml" namespace to my
"root" tag like this:
Namespace ns = Namespace.getNamespace("http://www.w3.org/1999/xhtml");
root = new Element(HtmlElementsDef.getHTML_STR(), ns);
This is not working. I'm getting no error messages or anything else. All
what i want is to add the namespace to the html tag,
Any ideas?
Best regards
Ramo
From jhunter at servlets.com Fri Nov 16 15:08:07 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Fri Nov 16 15:08:16 2007
Subject: [jdom-interest] Namespace problems
In-Reply-To: <001601c8289a$a765a430$f630ec90$@de>
References: <001601c8289a$a765a430$f630ec90$@de>
Message-ID: <473E22D7.1090303@servlets.com>
It's working just fine. You don't say how it's "not working". I'm
guessing when you look at the element you don't see a namespace prefix.
That's because you assigned that URI to the default element namespace,
which is printed without a prefix.
-jh-
Ramo At Skuff wrote:
> Hi,
>
> i wanted to add the xmlns="http://www.w3.org/1999/xhtml" namespace to my
> "root" tag like this:
>
> Namespace ns = Namespace.getNamespace("http://www.w3.org/1999/xhtml");
>
>
> root = new Element(HtmlElementsDef.getHTML_STR(), ns);
>
>
>
> This is not working. I'm getting no error messages or anything else. All
> what i want is to add the namespace to the html tag,
>
>
> Any ideas?
>
> Best regards
> Ramo
>
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
From jhunter at servlets.com Sun Nov 18 21:26:03 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Sun Nov 18 21:26:13 2007
Subject: [jdom-interest] JDOM 1.1 released!
Message-ID: <47411E6B.4030505@servlets.com>
I just posted the JDOM 1.1 release for download!
http://www.jdom.org/dist/binary/jdom-1.1.tar.gz // Unix
http://www.jdom.org/dist/binary/jdom-1.1.zip // Windows
(The only difference is the line endings.)
Below is the list of additions and changes:
Added an additional constructor to JDOMSource with an EntityResolver
which is passed to the internal DocumentReader allowing the SAXOutputter
to properly resolve DTDs.
Added a forceNamespaceAware property to DOMOutputter which specifies you
want a DOM constructed with namespaces even if the source JDOM document
has no namespaces.
Added support for attribute "INF" and "-INF" values, to indicate
positive and negative infinity, as XML Schema allows.
Moved isXMLWhitespace() method from private in XMLOutputter to public in
Verifier.
Clarified XMLOutputter behavior with newlines and indents:
setIndent(" ") means newlines and " " indents
setIndent("") means newlines and "" indents
setIndent(null) means no newlines and no indents
Added set/getIgnoringBoundaryWhitespace() methods and features to
SAXBuilder and SAXHandler.
Added a string constant for the JDOM_OBJECT_MODEL_URI used by JAXP 1.3.
It deserves being part of the public API.
Fixed bug in SAXOutputter where default namespaces would be declared as
xmlns:="" with a spurious colon.
Fixed bug when using attributes without a namespace and outputting to a
JDOMResult.
Removing check that a comment not start with a hyphen. A careful reading
of production 15 in the XML 1.0 spec indicates leading hyphens are in
fact allowed.
Fixed bug where outputFragment() on SAXOutputter could cause a
NullPointerException because the locator would be null during the call.
Fixed bug where serializing ElementFilter causes a NullPointerException
if the filter has no assigned namespace
Fixed some subtle bad behaviors in listIterator.add() logic, using brand
new iterator logic.
Allowed a String to be passed to ContentList.add(int, Object).
Simplified JDOMAbout and renamed info.xml to jdom-info.xml, so
getResourceAsStream() won't suffer any name collision.
Fixed tiny issue where CDATA could be set with illegal character content.
Added logic to escape some special characters in namespace URIs.
Fixed bug where the attribute type would change on a setAttribute() call.
Improved performance on Namespace handling.
Improved and clarified Javadocs.
-jh-
P.S. You can now search the JDOM mailing list history at
http://jdom.markmail.org. (MarkMail is my latest project.)
From Deepa.Janamatti at in.bosch.com Sun Nov 18 21:47:08 2007
From: Deepa.Janamatti at in.bosch.com (Deepa Janamatti (RBIN/EMT2))
Date: Sun Nov 18 21:47:44 2007
Subject: [jdom-interest] Jdom with internal DTD
Message-ID: <5CA0E7F9F0E0024095892716B9F4C53C06A1BEC7C2@SGPMBX01.APAC.bosch.com>
Hello,
Does JDOM 1.1 vaildates an xml file with internal DTDs?
Regards,
Deepa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20071119/97e228b9/attachment.htm
From jhunter at servlets.com Sun Nov 18 23:13:54 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Sun Nov 18 23:14:04 2007
Subject: [jdom-interest] Jdom with internal DTD
In-Reply-To: <5CA0E7F9F0E0024095892716B9F4C53C06A1BEC7C2@SGPMBX01.APAC.bosch.com>
References: <5CA0E7F9F0E0024095892716B9F4C53C06A1BEC7C2@SGPMBX01.APAC.bosch.com>
Message-ID: <474137B2.8010507@servlets.com>
It depends on the underlying parser you're using; in general the answer
is yes if you turn on validation.
-jh-
Deepa Janamatti (RBIN/EMT2) wrote:
> Hello,
> Does JDOM 1.1 vaildates an xml file with internal DTDs?
>
> Regards,
> Deepa
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
From cowtowncoder at yahoo.com Mon Nov 19 12:24:35 2007
From: cowtowncoder at yahoo.com (Tatu Saloranta)
Date: Mon Nov 19 12:24:46 2007
Subject: [jdom-interest] Jdom with internal DTD
In-Reply-To: <5CA0E7F9F0E0024095892716B9F4C53C06A1BEC7C2@SGPMBX01.APAC.bosch.com>
Message-ID: <793224.59048.qm@web32810.mail.mud.yahoo.com>
--- "Deepa Janamatti (RBIN/EMT2)"
wrote:
> Hello,
> Does JDOM 1.1 vaildates an xml file with internal
> DTDs?
JDOM itself does no parsing or validation, but uses
functionality underlying parser has. If validation
support is enabled (which by default I think it is
not), yes, xml file gets validated, as long parser
supports it.
And even without validation, DTD stuff from the
internal subset is always processed by dtd-handling
parsers.
-+ Tatu +-
____________________________________________________________________________________
Be a better pen pal.
Text or chat with friends inside Yahoo! Mail. See how. http://overview.mail.yahoo.com/
From mj-lists at expertsystems.se Tue Nov 20 00:03:05 2007
From: mj-lists at expertsystems.se (Mattias Jiderhamn)
Date: Tue Nov 20 00:02:39 2007
Subject: [jdom-interest] JDOM 1.1 released!
In-Reply-To: <47411E6B.4030505@servlets.com>
References: <47411E6B.4030505@servlets.com>
Message-ID: <474294B9.3050100@expertsystems.se>
Congratulations!
Now, I would agree it's time to start talking seriously about generics.
/Mattias
Jason Hunter wrote (2007-11-19 06:26):
> I just posted the JDOM 1.1 release for download!
>
> http://www.jdom.org/dist/binary/jdom-1.1.tar.gz // Unix
> http://www.jdom.org/dist/binary/jdom-1.1.zip // Windows
>
> (The only difference is the line endings.)
>
>
> Below is the list of additions and changes:
>
> Added an additional constructor to JDOMSource with an EntityResolver
> which is passed to the internal DocumentReader allowing the
> SAXOutputter to properly resolve DTDs.
>
> Added a forceNamespaceAware property to DOMOutputter which specifies
> you want a DOM constructed with namespaces even if the source JDOM
> document has no namespaces.
>
> Added support for attribute "INF" and "-INF" values, to indicate
> positive and negative infinity, as XML Schema allows.
>
> Moved isXMLWhitespace() method from private in XMLOutputter to public in
> Verifier.
>
> Clarified XMLOutputter behavior with newlines and indents:
> setIndent(" ") means newlines and " " indents
> setIndent("") means newlines and "" indents
> setIndent(null) means no newlines and no indents
>
> Added set/getIgnoringBoundaryWhitespace() methods and features to
> SAXBuilder and SAXHandler.
>
> Added a string constant for the JDOM_OBJECT_MODEL_URI used by JAXP
> 1.3. It deserves being part of the public API.
>
> Fixed bug in SAXOutputter where default namespaces would be declared as
> xmlns:="" with a spurious colon.
>
> Fixed bug when using attributes without a namespace and outputting to a
> JDOMResult.
>
> Removing check that a comment not start with a hyphen. A careful
> reading of production 15 in the XML 1.0 spec indicates leading hyphens
> are in fact allowed.
>
> Fixed bug where outputFragment() on SAXOutputter could cause a
> NullPointerException because the locator would be null during the call.
>
> Fixed bug where serializing ElementFilter causes a
> NullPointerException if the filter has no assigned namespace
>
> Fixed some subtle bad behaviors in listIterator.add() logic, using
> brand new iterator logic.
>
> Allowed a String to be passed to ContentList.add(int, Object).
>
> Simplified JDOMAbout and renamed info.xml to jdom-info.xml, so
> getResourceAsStream() won't suffer any name collision.
>
> Fixed tiny issue where CDATA could be set with illegal character content.
>
> Added logic to escape some special characters in namespace URIs.
>
> Fixed bug where the attribute type would change on a setAttribute() call.
>
> Improved performance on Namespace handling.
>
> Improved and clarified Javadocs.
>
> -jh-
From jhunter at servlets.com Tue Nov 20 01:13:06 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Tue Nov 20 01:13:20 2007
Subject: [jdom-interest] JDOM 1.1 released!
In-Reply-To: <474294B9.3050100@expertsystems.se>
References: <47411E6B.4030505@servlets.com> <474294B9.3050100@expertsystems.se>
Message-ID: <4742A522.3020500@servlets.com>
Mattias Jiderhamn wrote:
> Congratulations!
>
> Now, I would agree it's time to start talking seriously about generics.
>
> /Mattias
Can anyone cite what other projects have done in this situation? Do
they just one day say, "Forget Java 1.4" people? I'd be most interested
to hear stories from infrastructure library projects. Applications can
jump faster than reusable libraries.
-jh-
P.S. After reading your note, I thought, "What did Mattias say earlier
about the subject?" So I played with MarkMail to find out:
http://markmail.org/search/?q=from%3Amattias+list%3Ajdom+%22java+5%22
First message popped up: "Can't we get 1.01 first and *then* start
discussing generics/Java 5 seriously?" Now your note makes more sense. :)
Here's what all's been said before about "Java 5":
http://markmail.org/search/?q=list%3Ajdom+%22java+5%22
From mike at saxonica.com Tue Nov 20 03:32:51 2007
From: mike at saxonica.com (Michael Kay)
Date: Tue Nov 20 03:33:08 2007
Subject: [jdom-interest] JDOM 1.1 released!
In-Reply-To: <4742A522.3020500@servlets.com>
References: <47411E6B.4030505@servlets.com> <474294B9.3050100@expertsystems.se>
<4742A522.3020500@servlets.com>
Message-ID: <012201c82b69$15b14a40$6501a8c0@turtle>
> Can anyone cite what other projects have done in this
> situation?
Saxon 9.0 has introduced a new API, s9api, that exploits generics. Existing
users can continue to use older APIs. I'm hoping I can drop JDK 1.4 support
within a year or so - I suspect that people who need to stick with old Java
releases have no great urgency to move to new Saxon releases.
For JDOM, version 1.0 (and hopefully 1.1) are very stable, and I think you
could safely adopt the position "if you want to use an old JDK, then you can
use an old JDOM as well".
Michael Kay
http://www.saxonica.com/
From mj-lists at expertsystems.se Tue Nov 20 23:09:41 2007
From: mj-lists at expertsystems.se (Mattias Jiderhamn)
Date: Tue Nov 20 23:11:34 2007
Subject: [jdom-interest] JDOM 1.1 released!
In-Reply-To: <012201c82b69$15b14a40$6501a8c0@turtle>
References: <47411E6B.4030505@servlets.com> <474294B9.3050100@expertsystems.se>
<4742A522.3020500@servlets.com>
<012201c82b69$15b14a40$6501a8c0@turtle>
Message-ID: <4743D9B5.3030103@expertsystems.se>
Michael Kay wrote (2007-11-20 12:32):
> For JDOM, version 1.0 (and hopefully 1.1) are very stable, and I think you
> could safely adopt the position "if you want to use an old JDK, then you can
> use an old JDOM as well".
>
+1
(For those unfamiliar with Apache voting, I vote in favor of the above
proposed route)
/Mattias
From mj-lists at expertsystems.se Tue Nov 20 23:11:29 2007
From: mj-lists at expertsystems.se (Mattias Jiderhamn)
Date: Tue Nov 20 23:12:04 2007
Subject: [jdom-interest] JDOM 1.1 released!
In-Reply-To: <012201c82b69$15b14a40$6501a8c0@turtle>
References: <47411E6B.4030505@servlets.com> <474294B9.3050100@expertsystems.se>
<4742A522.3020500@servlets.com>
<012201c82b69$15b14a40$6501a8c0@turtle>
Message-ID: <4743DA21.7050903@expertsystems.se>
Michael Kay wrote (2007-11-20 12:32):
> For JDOM, version 1.0 (and hopefully 1.1) are very stable, and I think you
> could safely adopt the position "if you want to use an old JDK, then you can
> use an old JDOM as well".
>
+1
(For those unfamiliar with Apache voting, I vote in favor of the above
proposed route)
/Mattias
From victor.toni at ebuconnect.de Wed Nov 21 05:37:05 2007
From: victor.toni at ebuconnect.de (Victor Toni)
Date: Wed Nov 21 05:38:30 2007
Subject: [jdom-interest] JDOM 1.1 released!
In-Reply-To: <012201c82b69$15b14a40$6501a8c0@turtle>
References: <47411E6B.4030505@servlets.com>
<474294B9.3050100@expertsystems.se> <4742A522.3020500@servlets.com>
<012201c82b69$15b14a40$6501a8c0@turtle>
Message-ID: <47443481.9080607@ebuconnect.de>
Michael Kay wrote:
>> Can anyone cite what other projects have done in this
>> situation?
>>
>
> Saxon 9.0 has introduced a new API, s9api, that exploits generics. Existing
> users can continue to use older APIs. I'm hoping I can drop JDK 1.4 support
> within a year or so - I suspect that people who need to stick with old Java
> releases have no great urgency to move to new Saxon releases.
>
> For JDOM, version 1.0 (and hopefully 1.1) are very stable, and I think you
> could safely adopt the position "if you want to use an old JDK, then you can
> use an old JDOM as well".
>
> Michael Kay
> http://www.saxonica.com/
>
I suspect that enhancing JDOM with Generics is not as trivial as one
would think especially when one wants to go the whole way. One of the
reasons is erasure:
An example:
In AttributeList there are these two methods:
void add(int,Attribute);
public void add(int,Object);
Enhancing AttributeList with Generics would result in something like:
AttributeList {
void add(int,Attribute);
public void add(int,A);
}
which is not allowed. Reducing the code to
AttributeList {
public void add(int,A);
}
is possible but will break some code. I worry that a "JDOM 1.5" can't be
drop in replacement...
Victor Toni
From J.Dalton at ed.ac.uk Wed Nov 21 08:24:47 2007
From: J.Dalton at ed.ac.uk (J.Dalton@ed.ac.uk)
Date: Wed Nov 21 08:25:01 2007
Subject: [jdom-interest] Attribute namespace "collision" bug remains in 1.1
Message-ID: <20071121162447.h8skelqbk0o08cgo@mail.inf.ed.ac.uk>
I am trying to construct an element that looks like this:
where "mynamespace" is really a proper URL.
I get
Exception in thread "main" org.jdom.IllegalAddException: The namespace
xmlns="mynamespace" could not be added as a namespace to "xsd:schema":
The namespace prefix "" collides with an attribute namespace prefix
on the element
at org.jdom.Element.addNamespaceDeclaration(Element.java:342)
(Again, "mynamespace" was really a proper namespace.)
This used to work before 1.0, and I believe this is a known bug in 1.0.
I'm wondering whether there's a workaround or whether I need
to edit the source code and recompile.
BTW, this page appears to be about the same problem:
http://www.junlu.com/msg/166290.html
-- Jeff
From jhunter at servlets.com Wed Nov 21 23:02:25 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Wed Nov 21 23:02:48 2007
Subject: [jdom-interest] Attribute namespace "collision" bug remains in 1.1
In-Reply-To: <20071121162447.h8skelqbk0o08cgo@mail.inf.ed.ac.uk>
References: <20071121162447.h8skelqbk0o08cgo@mail.inf.ed.ac.uk>
Message-ID: <47452981.2030207@servlets.com>
Thanks for the bug reminder. I just put the fix in CVS.
For a workaround you could build the element using the
UnverifiedJDOMFactory that skips the Verifier step. Produces the same
object model result.
-jh-
J.Dalton@ed.ac.uk wrote:
> I am trying to construct an element that looks like this:
>
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns="mynamespace" targetNamespace="mynamespace"
> elementFormDefault="qualified">
>
> where "mynamespace" is really a proper URL.
>
> I get
>
> Exception in thread "main" org.jdom.IllegalAddException: The namespace
> xmlns="mynamespace" could not be added as a namespace to "xsd:schema":
> The namespace prefix "" collides with an attribute namespace prefix
> on the element
> at org.jdom.Element.addNamespaceDeclaration(Element.java:342)
>
> (Again, "mynamespace" was really a proper namespace.)
>
> This used to work before 1.0, and I believe this is a known bug in 1.0.
>
> I'm wondering whether there's a workaround or whether I need
> to edit the source code and recompile.
>
> BTW, this page appears to be about the same problem:
>
> http://www.junlu.com/msg/166290.html
>
> -- Jeff
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
From pabhishek at novell.com Thu Nov 22 07:37:05 2007
From: pabhishek at novell.com (Abhishek Parwal)
Date: Thu Nov 22 07:33:04 2007
Subject: [jdom-interest] Issue with xml prolog
Message-ID: <4745EF790200007E0000B209@lucius.provo.novell.com>
Hi,
I am getting following error when i try to parse the following xml
data
HI
There are no whitespaces before prolog of xml (ie before . But it still gives me the folllowing error.
org.jdom.input.JDOMParseException: Error on line 1: The processing
instruction target matching "[xX][mM][lL]" is not allowed
Most of the places i googled people tell to remove white spaces before prolog to correct it. But here in my xml data there are no white spaces before prolog.
Please suggest where i am going wrong.
Thanks and Regards,
Abhishek
From mike at saxonica.com Thu Nov 22 08:30:07 2007
From: mike at saxonica.com (Michael Kay)
Date: Thu Nov 22 08:30:18 2007
Subject: [jdom-interest] Issue with xml prolog
In-Reply-To: <4745EF790200007E0000B209@lucius.provo.novell.com>
References: <4745EF790200007E0000B209@lucius.provo.novell.com>
Message-ID: <01a101c82d24$f20fe660$6501a8c0@turtle>
An XML declaration is only allowed right at the beginning of the file.
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: jdom-interest-bounces@jdom.org
> [mailto:jdom-interest-bounces@jdom.org] On Behalf Of Abhishek Parwal
> Sent: 22 November 2007 15:37
> To: jdom-interest@jdom.org
> Subject: [jdom-interest] Issue with xml prolog
>
> Hi,
>
> I am getting following error when i try to parse the
> following xml data encoding="ISO-8859-1"?> HI
> There are no whitespaces before prolog
> of xml (ie before .
> But it still gives me the folllowing error.
>
> org.jdom.input.JDOMParseException: Error on line 1: The
> processing instruction target matching "[xX][mM][lL]" is not allowed
>
> Most of the places i googled people tell to remove white
> spaces before prolog to correct it. But here in my xml data
> there are no white spaces before prolog.
>
> Please suggest where i am going wrong.
>
> Thanks and Regards,
> Abhishek
>
>
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@you
> rhost.com
From pabhishek at novell.com Thu Nov 22 21:20:19 2007
From: pabhishek at novell.com (Abhishek Parwal)
Date: Thu Nov 22 23:33:51 2007
Subject: [jdom-interest] Issue with xml prolog
Message-ID: <4746B06B0200007E0000B228@lucius.provo.novell.com>
Thanks Michael But the xml declaration was not giving error in this
case:
HI
The difference here is id="1". Pls explain why it is not giving any
error on parsing it.
-Abhishek
On Thu, 2007-11-22 at 16:30 +0000, Michael Kay wrote:
> An XML declaration is only allowed right at the beginning of the file.
>
> Michael Kay
> http://www.saxonica.com/
>
> > -----Original Message-----
> > From: jdom-interest-bounces@jdom.org
> > [mailto:jdom-interest-bounces@jdom.org] On Behalf Of Abhishek Parwal
> > Sent: 22 November 2007 15:37
> > To: jdom-interest@jdom.org
> > Subject: [jdom-interest] Issue with xml prolog
> >
> > Hi,
> >
> > I am getting following error when i try to parse the
> > following xml data > encoding="ISO-8859-1"?> HI
> > There are no whitespaces before prolog
> > of xml (ie before .
> > But it still gives me the folllowing error.
> >
> > org.jdom.input.JDOMParseException: Error on line 1: The
> > processing instruction target matching "[xX][mM][lL]" is not allowed
> >
> > Most of the places i googled people tell to remove white
> > spaces before prolog to correct it. But here in my xml data
> > there are no white spaces before prolog.
> >
> > Please suggest where i am going wrong.
> >
> > Thanks and Regards,
> > Abhishek
> >
> >
> >
> > _______________________________________________
> > To control your jdom-interest membership:
> > http://www.jdom.org/mailman/options/jdom-interest/youraddr@you
> > rhost.com
>
From mike at saxonica.com Fri Nov 23 02:27:50 2007
From: mike at saxonica.com (Michael Kay)
Date: Fri Nov 23 02:28:10 2007
Subject: [jdom-interest] Issue with xml prolog
In-Reply-To: <4746B06B0200007E0000B228@lucius.provo.novell.com>
References: <4746B06B0200007E0000B228@lucius.provo.novell.com>
Message-ID: <00a901c82dbb$7fadccd0$6501a8c0@turtle>
>
> HI
>
>
> The difference here is id="1". Pls explain why it is not
> giving any error on parsing it.
I've no idea. If you find an XML parser that accepts that file without error
then you should raise a bug report, it's a blatant non-conformance. This is
how Xerces reports it:
Error on line 2 column 6 of file:/c:/temp/test.xml:
The processing instruction target matching "[xX][mM][lL]" is not allowed.
Michael Kay
http://www.saxonica.com/
From Jasmin_Mehta at nexweb.org Fri Nov 23 07:12:25 2007
From: Jasmin_Mehta at nexweb.org (Jasmin_Mehta@nexweb.org)
Date: Fri Nov 23 07:13:01 2007
Subject: [jdom-interest] How to build multiple XML documents by mergeing two
XML documents using JDOM
Message-ID:
I am building multiple dynamic xml documents from result set and storing
them to an ArrayList called 'xmlDocumentList'.
I have another static xml document called 'staticDocument'. Where static
document looks like:
Now I want to create another ArrayList 'finalDocumentList' out of mergeing
'staticDocument' with each element of 'xmlDocumentList'. That will be like
each element of 'finalDocumentList' is made from merging 'staticDocument'
with 'xmlDocumentList[i]' (one of dynamic document element) at
. When I do that with attached code snippet, it creates
the GlogFinal0.xml, GlogFinal1, GlogFinal2..etc file with all having same
content in them. It uses only first element of 'xmlDocumentList' to build
all elements of 'finalDocumentList'.
----------------------------------------------------------------------------------------------------------------------------------
ArrayList dynamicDocumentList =
xmlBuilder.getDynamicXmlDocuments();
Document staticDocument = xmlBuilder.getStaticXmlWrapper();
ArrayList finalDocumentList = new ArrayList();
Element staticRoot = staticDocument.getRootElement();
Element staticChild = staticRoot.getChild("TransmissionBody");
Element dynamicRoot = null;
for(int i = 0; i < dynamicDocumentList.size(); i++)
{
dynamicRoot =
((Document)dynamicDocumentList.get(i)).getRootElement();
staticChild.addContent(dynamicRoot.detach());
finalDocumentList.add(staticDocument);
}
FileOutputStream finalXmlFile = null;
XMLOutputter xmlOutPutter = null;
for (int i = 0; i < finalDocumentList.size(); i++)
{
finalXmlFile = new
FileOutputStream("F:\\JavaProjects\\WorkspaceDev\\OTM\\xsl\\GLogFinal"+i+".xml");
xmlOutPutter = new XMLOutputter(Format.getPrettyFormat());
xmlOutPutter.output((Document)(finalDocumentList.get(i)),
finalXmlFile);
}
******************************************************************************
ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION
Our domain name is changing. Please take note of the sender's
e-Mail address and make changes to your personal address list,
if needed. Both domains will continue to work, only for a limited
time.
******************************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or agency to whom they are addressed.
If you have received this email in error please notify the Navy
Exchange Service Command e-mail administrator. This footnote
also confirms that this email message has been scanned for the
presence of computer viruses.
Thank You!
******************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20071123/075806cd/attachment.htm
From cowtowncoder at yahoo.com Fri Nov 23 10:48:37 2007
From: cowtowncoder at yahoo.com (Tatu Saloranta)
Date: Fri Nov 23 10:48:51 2007
Subject: [jdom-interest] Issue with xml prolog
In-Reply-To: <4746B06B0200007E0000B228@lucius.provo.novell.com>
Message-ID: <582430.9036.qm@web32804.mail.mud.yahoo.com>
--- Abhishek Parwal wrote:
>
> Thanks Michael But the xml declaration was not
> giving error in this
> case:
>
>
>
>
> HI
>
>
This is not a well-formed xml document, and parsers
should fail to parse it. It is illegal to have
processing instructions with target that starts with
"xml" (case insensitive) -- only xml declaration can
look like that, and it can only start document with no
preceding content of any kind, not even white space.
> The difference here is id="1". Pls explain why it is
> not giving any
> error on parsing it.
You should get an error parsing such content, and I
don't see how this would not happen.
Existence of attribute should make no difference.
Just remove the thing that looks like xml declaration
(but can not be since it does not start the document),
and you should be good to go.
-+ Tatu +-
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
From bashiro at myway.com Fri Nov 23 12:23:33 2007
From: bashiro at myway.com (Bashiro)
Date: Fri Nov 23 12:23:32 2007
Subject: [jdom-interest] Seaching for attributes
Message-ID: <20071123202333.48B6A233D1@mprdmxin.myway.com>
Hello folks,
I am trying to use jdom to seach for attribute values.
When found I get a value in return.
I want the code to return a message when not found.
I have the ff code;
Iterator iterator = attributes.iterator();
while (iterator.hasNext()) {
Attribute attribute = (Attribute) iterator.next();
String name = attribute.getName();
String value = attribute.getValue();
if(name.equals("xml_name")&&value.equals(xml_value.trim())){
jTextArea1.append(" Domain Exists: " + value + "\n");
return;
}
else {
//jTextArea1.append(" No such domain \n");
}
The problem is if I uncomment "the else clause" it appends "No such domain" on any value that does not march.
In other words if the no march values are 50, the code appends "No such domain" 50 times. How do I let the code to append only one time "No such domain"
Thanks in advance
Bashiro
_______________________________________________
No banners. No pop-ups. No kidding.
Make My Way your home on the Web - http://www.myway.com
From grzegorz.kaczor at gmail.com Fri Nov 23 12:36:47 2007
From: grzegorz.kaczor at gmail.com (Grzegorz Kaczor)
Date: Fri Nov 23 12:36:56 2007
Subject: [jdom-interest] How to build multiple XML documents by mergeing
two XML documents using JDOM
In-Reply-To:
References:
Message-ID:
Hi,
I think you should clone the staticDocument before running each merge. Now
you have the same staticDocument stored multiple times in the
finalDocumentList so all the output files are identical.
Regards,
GK
2007/11/23, Jasmin_Mehta@nexweb.org :
>
>
> I am building multiple dynamic xml documents from result set and storing
> them to an ArrayList called 'xmlDocumentList'.
> I have another static xml document called 'staticDocument'. Where static
> document looks like:
>
>
>
>
>
>
>
>
>
>
>
> Now I want to create another ArrayList 'finalDocumentList' out of mergeing
> 'staticDocument' with each element of 'xmlDocumentList'. That will be like
> each element of 'finalDocumentList' is made from merging 'staticDocument'
> with 'xmlDocumentList[i]' (one of dynamic document element) at
> . When I do that with attached code snippet, it creates
> the GlogFinal0.xml, GlogFinal1, GlogFinal2..etc file with all having same
> content in them. It uses only first element of 'xmlDocumentList' to build
> all elements of 'finalDocumentList'.
>
>
> ----------------------------------------------------------------------------------------------------------------------------------
> ArrayList dynamicDocumentList = xmlBuilder.getDynamicXmlDocuments
> ();
> Document staticDocument = xmlBuilder.getStaticXmlWrapper();
> ArrayList finalDocumentList = new ArrayList();
> Element staticRoot = staticDocument.getRootElement();
> Element staticChild = staticRoot.getChild("TransmissionBody");
> Element dynamicRoot = null;
> for(int i = 0; i < dynamicDocumentList.size(); i++)
> {
> dynamicRoot =
> ((Document)dynamicDocumentList.get(i)).getRootElement();
> staticChild.addContent(dynamicRoot.detach());
> finalDocumentList.add(staticDocument);
> }
> FileOutputStream finalXmlFile = null;
> XMLOutputter xmlOutPutter = null;
> for (int i = 0; i < finalDocumentList.size(); i++)
> {
> finalXmlFile = new
> FileOutputStream("F:\\JavaProjects\\WorkspaceDev\\OTM\\xsl\\GLogFinal"+i+".xml");
> xmlOutPutter = new XMLOutputter(Format.getPrettyFormat());
> xmlOutPutter.output((Document)(finalDocumentList.get(i)),
> finalXmlFile);
> }
>
> *
> ******************************************************************************
> *ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION
> Our domain name is changing. Please take note of the sender's
> e-Mail address and make changes to your personal address list,
> if needed. Both domains will continue to work, only for a limited
> time.
>
> ******************************************************************************
> This email and any files transmitted with it are intended solely for
> the use of the individual or agency to whom they are addressed.
> If you have received this email in error please notify the Navy
> Exchange Service Command e-mail administrator. This footnote
> also confirms that this email message has been scanned for the
> presence of computer viruses.
>
> Thank You!
> *
> ******************************************************************************
> *
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>
--
"Cho? tyle wiemy w?asnym do?wiadczeniem:
W nas jest Raj, Piek?o - i do obu - szlaki."
J.K.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20071123/aa192c0c/attachment.htm
From talden at gmail.com Wed Nov 28 17:30:06 2007
From: talden at gmail.com (Talden)
Date: Wed Nov 28 17:30:15 2007
Subject: [jdom-interest] JDOM 1.1 released!
In-Reply-To: <47443481.9080607@ebuconnect.de>
References: <47411E6B.4030505@servlets.com> <474294B9.3050100@expertsystems.se>
<4742A522.3020500@servlets.com>
<012201c82b69$15b14a40$6501a8c0@turtle>
<47443481.9080607@ebuconnect.de>
Message-ID: <738d207f0711281730r4625fa9auca7bf4ec77964fb@mail.gmail.com>
> I suspect that enhancing JDOM with Generics is not as trivial as one
> would think especially when one wants to go the whole way. One of the
> reasons is erasure:
...
> is possible but will break some code. I worry that a "JDOM 1.5" can't be
> drop in replacement...
Agreed but then I don't believe it should try to be a drop-in. Having
looked over this exact issue, the amount of practical generification
without hitting erasure issues yielded such limited improvements as to
make the effort worthless. It would be much better to take the
lessons learned about what makes JDOM a useful tool and design an API
that properly leverages the 1.5 enhancements to their fullest.
Bug-fixes can continue to be made against JDOM 1.1 for those that are
strictly unable to move forward from Java2 1.4.x but JDOM needs to
move on and embrace the Java 5.0 features and conventions that came
into being over three years ago.
The lack of Java 5.0 feature adoption is likely costing JDOM in terms
of adoption and certainly costing adopters in terms of productivity.
It's going to take a long time to get the API right so planning should
start sooner rather than later.
--
Talden
From cowtowncoder at yahoo.com Wed Nov 28 22:15:37 2007
From: cowtowncoder at yahoo.com (Tatu Saloranta)
Date: Wed Nov 28 22:15:46 2007
Subject: [jdom-interest] JDOM 1.1 released!
In-Reply-To: <738d207f0711281730r4625fa9auca7bf4ec77964fb@mail.gmail.com>
Message-ID: <716722.23723.qm@web32814.mail.mud.yahoo.com>
--- Talden wrote:
...
> The lack of Java 5.0 feature adoption is likely
> costing JDOM in terms
> of adoption and certainly costing adopters in terms
> of productivity.
> It's going to take a long time to get the API right
> so planning should
> start sooner rather than later.
While I have nothing against moving to Java 5 for JDOM
2.0, and think that it's a good thing when done in a
way to get real benefits, I don't think this matters a
whole lot wrt. JDOM adoption at this point.
I don't think other tree model implementations are
moving to Java 5 particularly fast either, and
specifically core DOM will (have to) move slowly.
So it's a great idea to start thinking how API can be
improved for the next major, non-backwards-compatible
version, focusing on specific benefits: use cases that
can be simplified; typing that can be improved (using
enums as well as generics) to help with IDE
auto-completion amongst other things.
-+ Tatu +-
____________________________________________________________________________________
Get easy, one-click access to your favorites.
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs
From jdom at tuis.net Thu Nov 29 04:40:52 2007
From: jdom at tuis.net (Rolf Lear)
Date: Thu Nov 29 04:41:11 2007
Subject: [jdom-interest] JDOM 1.1 released! - thinking JDOM2
In-Reply-To: <4742A522.3020500@servlets.com>
References: <47411E6B.4030505@servlets.com> <474294B9.3050100@expertsystems.se>
<4742A522.3020500@servlets.com>
Message-ID: <474EB354.3020801@tuis.net>
Hi Jason, All.
After some consideration, I will volunteer to create a 'pilot' or
'proof-of-concept' Java5 conversion of JDom. I will be happy for it to
act as a baseline for simple discussion or perhaps be the foundation of
the 'generified' JDom release.
I figure I can get something out by the end of next week or so.
Rolf
Jason Hunter wrote:
> Mattias Jiderhamn wrote:
>> Congratulations!
>>
>> Now, I would agree it's time to start talking seriously about generics.
>>
>> /Mattias
>
> Can anyone cite what other projects have done in this situation? Do
> they just one day say, "Forget Java 1.4" people? I'd be most
> interested to hear stories from infrastructure library projects.
> Applications can jump faster than reusable libraries.
>
> -jh-
>
> P.S. After reading your note, I thought, "What did Mattias say
> earlier about the subject?" So I played with MarkMail to find out:
>
> http://markmail.org/search/?q=from%3Amattias+list%3Ajdom+%22java+5%22
>
> First message popped up: "Can't we get 1.01 first and *then* start
> discussing generics/Java 5 seriously?" Now your note makes more
> sense. :)
>
> Here's what all's been said before about "Java 5":
>
> http://markmail.org/search/?q=list%3Ajdom+%22java+5%22
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>
From jhunter at servlets.com Thu Nov 29 14:31:45 2007
From: jhunter at servlets.com (Jason Hunter)
Date: Thu Nov 29 14:32:01 2007
Subject: [jdom-interest] JDOM 1.1 released! - thinking JDOM2
In-Reply-To: <474EB354.3020801@tuis.net>
References: <47411E6B.4030505@servlets.com> <474294B9.3050100@expertsystems.se>
<4742A522.3020500@servlets.com> <474EB354.3020801@tuis.net>
Message-ID: <474F3DD1.90301@servlets.com>
OK, sounds like you're a pro at this so go for it.
If you look in the archives there are various people who have sent in
Java 5 "editions" also.
-jh-
Rolf Lear wrote:
> Hi Jason, All.
>
> After some consideration, I will volunteer to create a 'pilot' or
> 'proof-of-concept' Java5 conversion of JDom. I will be happy for it to
> act as a baseline for simple discussion or perhaps be the foundation of
> the 'generified' JDom release.
>
> I figure I can get something out by the end of next week or so.
>
> Rolf
>
> Jason Hunter wrote:
>> Mattias Jiderhamn wrote:
>>> Congratulations!
>>>
>>> Now, I would agree it's time to start talking seriously about generics.
>>>
>>> /Mattias
>>
>> Can anyone cite what other projects have done in this situation? Do
>> they just one day say, "Forget Java 1.4" people? I'd be most
>> interested to hear stories from infrastructure library projects.
>> Applications can jump faster than reusable libraries.
>>
>> -jh-
>>
>> P.S. After reading your note, I thought, "What did Mattias say
>> earlier about the subject?" So I played with MarkMail to find out:
>>
>> http://markmail.org/search/?q=from%3Amattias+list%3Ajdom+%22java+5%22
>>
>> First message popped up: "Can't we get 1.01 first and *then* start
>> discussing generics/Java 5 seriously?" Now your note makes more
>> sense. :)
>>
>> Here's what all's been said before about "Java 5":
>>
>> http://markmail.org/search/?q=list%3Ajdom+%22java+5%22
>> _______________________________________________
>> To control your jdom-interest membership:
>> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>>
>