[jdom-interest] JDom and Java5
jdom at tuis.net
Fri Feb 22 07:44:24 PST 2008
I have checked and things appear to be in order. I have calcualted an
MD5 sum on the jar:
I wonder if there is a cached file in a proxy somewhere..... I should perhaps start versioning things..... I'll do that next time.
Just in case, I have created a symbolic link, and this should avoid proxy's for the moment:
I have taken your example code and built a simple main() method that tests it, and it works fine with the web-site's jar file in the classpath.
Mattias Jiderhamn wrote:
> Is the JAR at http://git.tuis.net/jdom/jdom.jar really updated...? I
> get the same result for both cases.
> Regarding List<?> I believe that List = List<?> = List<? extends
> Hopefully you should be able to use this code as the basis for a test
> TransformerFactory transformerFactory =
> StreamSource streamSource = new StreamSource(new StringReader(
> "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" +
> "<xsl:stylesheet version=\"1.0\"
> xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n" +
> " <xsl:template match=\"/\">\n" +
> " <foo>" +
> "<bar myAttribute=\"myValue\" />" +
> "<ns:bar xmlns:ns=\"http://foo/bar\" myAttribute=\"myValue\"
> ns:attribute2=\"prefixed\" />" +
> "</foo>\n" +
> " </xsl:template>\n" +
> Transformer transformer =
> JDOMSource source = new JDOMSource(new org.jdom.Document(new
> JDOMResult result = new JDOMResult();
> transformer.transform(source, result);
> Rolf Lear wrote (2008-02-22 15:28):
>> Hi Mattias
>> Thanks for the feedback.
>> The XSLT issue is a bug I introduced with the port. Previously there
>> was a single inner class of JDOMSource that could deal with either
>> Document or Content Lists. With the port I created two inner classes,
>> one for Documents only, and the second for List<Content> only. I
>> introduced a bug in the process. Easy fix (just poor testing - I
>> should introduce a test in jdom-test for the XSLT stuff - can you put
>> together a simple test case of the bug?).
>> The second issue is also cool. The XPath code is implemented by the
>> jaxen library which is not (yet) generified. As a consequence, I
>> hacked the calles to Jaxen to get List<Object>. By removing the hacks
>> and providing List<?> as output it is actually simpler. I am not sure
>> if you were anticipating just plain List as output instead of
>> List<?>, is there a difference?
>> I have updated the code repo, jar, apidocs, and website, etc.
>> Mattias Jiderhamn wrote:
>>> This is good news!
>>> At least a first step towards an official Java5 JDOM version.
>>> I downloaded your JAR and put it in my dev environment. Here are a
>>> few problems I ran into (which I haven't had time to analyze myself):
>>> When trying to do XSLT from a JDOMSource to a JDOMResult I got this
>>> org.xml.sax.SAXNotSupportedException: Only JDOM Documents are
>>> supported as input
>>> XPath.selectNodes() now returns a List<Object> rather than an
>>> "untyped" List. I would be preferrable if it would still return a
>>> plain List which could be cast to a List<Element> if you know only
>>> Elements will be returned.
>>> /Mattias Jiderhamn
>>> Rolf Lear wrote (2008-02-21 16:28):
>>>> Hi All.
More information about the jdom-interest