Permalink
Commits on Sep 9, 2004
  1. Fixing sample. Wouldn't build before.

    jhunter committed Sep 9, 2004
    -jh-
  2. More stuff for the future.

    jhunter committed Sep 9, 2004
    -jh-
Commits on Sep 7, 2004
  1. Same i.e. fix in contrib.

    jhunter committed Sep 7, 2004
    -jh-
  2. s/i.e./i.e./ in Javadocs to avoid warnings.

    jhunter committed Sep 7, 2004
    -jh-
  3. 1.0 here too.

    jhunter committed Sep 7, 2004
    -jh-
  4. 1.0 here too.

    jhunter committed Sep 7, 2004
    -jh-
  5. Marking version as "1.0" in preparation for the real build. This

    jhunter committed Sep 7, 2004
    feels good.
    
    -jh-
  6. Cleaning up the samples. Thanks to Joe Bowbeer for sending in a handy

    jhunter committed Sep 7, 2004
    patch.  Removed Count.java as it doesn't seem to serve any useful
    purpose.
    
    -jh-
Commits on Sep 3, 2004
  1. Adding LICENSE.txt to the jdom.jar file, at the suggestion of Ashley

    jhunter committed Sep 3, 2004
    Martens.
    
    Note this does *not* mean people should not include the LICENSE.txt
    file next to the JAR; it's simply a backup location.
    
    -jh-
  2. Javadoc fix, removing line about parser reuse and files in sequence

    jhunter committed Sep 3, 2004
    which should have been removed in r1.78.
    
    -jh-
  3. Noting getParentElement().

    jhunter committed Sep 3, 2004
    -jh-
  4. Cleaning up code with getParentElement().

    jhunter committed Sep 3, 2004
    -jh-
  5. Cleaning up jaxen-jdom patch to use getParentElement(). Makes for

    jhunter committed Sep 3, 2004
    much cleaner code.
    
    -jh-
  6. Changing to use new getParentElement().

    jhunter committed Sep 3, 2004
    -jh-
  7. Putting getParentElement() on Content where it belongs. Duh.

    jhunter committed Sep 3, 2004
    -jh-
  8. Added an Element getParentElement() method which has the same behavior

    jhunter committed Sep 3, 2004
    as getParent() used to.  This should give people an easier upgrade path.
    
        /**
         * <p>
         * A convenience method that returns any parent element for this element,
         * or null if the element is unattached or is a root element.  This was the
         * original behavior of getParent() in JDOM Beta 9 which began returning
         * Parent in Beta 10.  This method provides a convenient upgrade path for
         * JDOM Beta 10 and 1.0 users.
         * </p>
         *
         * @return the containing Element or null if unattached or a root element
         */
        public Element getParentElement() {
            Parent parent = getParent();
            return (Element) ((parent instanceof Element) ? parent : null);
        }
    
    -jh-
  9. Patch from Brad bringing ElementScanner up to Beta 10 (and current CVS)

    jhunter committed Sep 3, 2004
    levels with the getParent() behavior.
    
    -jh-
  10. Patch from Laurent building on his past patch, with thanks to Brad for

    jhunter committed Sep 3, 2004
    vetting it and converting it to a patch against the latest:
    
    --
    Three remarks on SAXOutputter :
    
    - I don't think having a method output(Content node) is a good idea as
    the output() methods aim at producing full documents, i.e. they do fire
    start/endDocument. It makes little sense to have a document with only
    a comment or a text node. That's why I enforced output(Element node).
    What do you think?
    
    - I refactored dtdEvents() to rely on XMLOutputter rather than having
    its own copy of the DTD outputting code. It didn't make it to CVS.
    Do you think it's a problem to have SAXOutputter relying on XMLOutputter?
    
    - I modified some Javadoc comments to help better understanding
    document well-formedness issues of the output() mathods.
    
    Attached is a diff between the current CVS head and my copy.
    --
    
    -jh-
  11. Removing some unused private methods. Thanks to Phill Perryman

    jhunter committed Sep 3, 2004
    for pointing these out.
    
    -jh-
Commits on Sep 1, 2004
  1. Recording the current changes.

    jhunter committed Sep 1, 2004
    -jh-
  2. Changed to cloning Format objects when they're set/get. Thinking on

    jhunter committed Sep 1, 2004
    it, this seems better as in the TrAX PI patch we've begun doing
    temporary tweaks on the outputter formats which, if we're not cloning,
    would mean we wouldn't be thread safe on output.
    
    -jh-
  3. Prioritizing items that will be done later in 1.1.

    jhunter committed Sep 1, 2004
    -jh-
  4. Added a new method to JDOMFactory. Implemented it with the default and

    jhunter committed Sep 1, 2004
    unchecked factory varieties.
    
    public Document document(Element rootElement, DocType docType, String baseURI)
    
    This matches an existing Document constructor.
    
    -jh-
Commits on Aug 31, 2004
  1. Changing the Verifier.isXXX() methods from private to public.

    jhunter committed Aug 31, 2004
    Wolfgang Frech argued effectively for this change:
    
    --
    Subject: [jdom-interest] Enhancement: make internal isXML* methods in Verifier public
    From: Wolfgang.FrechATxenium.de
    Date: Thu, 19 Aug 2004 09:01:08 +0200
    To: jdom-interest@jdom.org
    
    Request for Enhancement
    
    Make the internal XML character test methods of the class Verifier public.
    A list of these methods is given below.
    
    
    Rationale
    
    The character test methods are a valuable implementation of a tedious
    detail of the XML recommendation. They could be used for additional
    purposes if made public.
    On the other hand, making these methods public does not expose an
    implementation detail that is likely to be changed. The character test
    methods have a clear and stable definition. They will not change except by
    a revision of the XML recommendation itself.
    
    
    Example for Additional Usage: Name Token
    
    To test if an attribute value is a XML name token (production [7]), one
    could use the method isXMLNameCharacter (productions [4]).
    A workaround is to check if the value is not empty, prepend an underscore
    and use checkXMLName.  Other workarounds would require to copy or patch
    JDOM code.
    
    
    Details
    
    The class org.jdom.Verifier uses the following methods internally:
    
    isXMLCharacter
    isXMLNameCharacter
    isXMLNameStartCharacter
    isXMLLetterOrDigit
    isXMLLetter
    isXMLCombiningChar
    isXMLExtender
    isXMLDigit
    isXMLPublicIDCharacter
    isHexDigit
    isURICharacter
    
    The methods isHexDigit and isURICharacter are XML character test methods as
    well, because they implement productions of the XML recommendation.
    All these methods should be made public.
    --
    
    -jh-
  2. First, added the factory method

    jhunter committed Aug 31, 2004
    entityRef(String elementName, String systemID) to match the EntityRef
    constructor with the same parameter signature.  We've been matching
    constructors with factory calls but overlooked this one.
    
    People who wrote their own factories and didn't subclass
    DefaultJDOMFactory will need to take note!
    
    Second, moved addContent() and setContent() from Parent into Document
    and Element directly.  This restores the method chaining that some
    people really like.  It behaves more like Beta 9 code now.  This could break code that changed for b10 if it called the methods on the Parent
    interface.
    
    When we move to J2SE 5.0 we can use covariant return types to put the
    methods in Parent while avoiding the cast in Document and Element.
    That's the ideal.
    
    -jh-
  3. Patch from Laurent based on a problem report by Richard Allen.

    jhunter committed Aug 31, 2004
    --
    Hi Richard,
    
    Sorry for the long delay. I had a chance to look at your problem.
    Indeed, this is a problem in ElementScanner and your analysis is correct.
    
    > To fix, I removed the if (this.activeRules.size() != 0) test that contained
    > the startElement() call to XMLScanner, so that it always propogates the
    > event to the SAXHandler.
    
    Your fix proposal to always propagate the startElement events to
    SAXHandler is quite dangerous as it forces SAXHandler to build a
    full JDOM document from the parser output (which is pr�cisely what
    ElementScanner aims at avoiding).
    
    Thus, I think we should keep the "if (this.activeRules.size() != 0)"
    test to support extracting some nodes from huge document while using
    as little memory as possible.
    
    Attached is another patch proposal: Instead of directly using SAXHandler,
    it relies on a subclass (FragmentHandler, borrowed from JDOMResult) that
    inserts a dummy root document in SAXHandler's document.
    
    This guarantees that, whatever your matching rules, SAXHandler will
    always have a single root document.
    --
    
    -jh-
  4. Conglomeration patch to SAXOutputter based on patches from Laurent.

    jhunter committed Aug 31, 2004
    Items fixed include:
    
    * start/endPrefixMapping was not being fired for no namespace
    * DocType was being improperly constructed
    * Assign a DefaultHandler to the dtd parser by default to better
      suppress unimportant problems
    
    New feature:
    
    * Support for outputting fragments of documents.
    
    New methods:
    
    output(Content)
    outputFragment(List)
    outputFragment(Content)
    
    -jh-
  5. Patch developed by Brad and me based on a bug report from

    jhunter committed Aug 31, 2004
    Wolfgang Frech:
    
    --
    FilterIterator does not comply to the java.util.Iterator spec in the
    following detail:
    
    If next() is called on a non-empty FilterIterator without a preceding
    hasNext(), the FilterIterator throws a NoSuchElementException.
    The expected behavior is: next returns the next element, regardless of
    preceding calls to hasNext.
    
    This problem can be avoided by a straightforward workaround: always call
    hasNext() before next().
    
    A comment at FilterIterator.remove hints that the author is aware of a
    similar problem with a call to remove before hasNext.
    --
    
    Simple one-liner.
    
    -jh-
  6. Patch from Edwin Wiles (aka "spindizzy"). From his email:

    jhunter committed Aug 31, 2004
    --
    This was a problem where DOMOutputter was adding a namespace
    declaration to an element that used an attribute from a
    different namespace, even though the attribute's namespace
    was already "in scope".
    
    Original XML Document:
    
    <?xml version="1.0" encoding="UTF-8"?>
    <test xmlns="http://foo/test#" xmlns:rdf="http://pseudo/rdf">
    	<rdf:embedded rdf:ID="1">
    		<rdf:type rdf:resource="sometypehere" />
    		<otherobject rdf:resource="resourcerefhere" />
    		<otherprop>propvalue</otherprop>
    	</rdf:embedded>
    </test>
    
    Result of Text -> JDOM -> W3C DOM -> Text (note the extra namespace):
    
    <?xml version="1.0" encoding="UTF-8"?>
    <test xmlns="http://foo/test#" xmlns:rdf="http://pseudo/rdf">
        <rdf:embedded rdf:ID="1">
            <rdf:type rdf:resource="sometypehere"/>
            <otherobject rdf:resource="resourcerefhere" xmlns:rdf="http://pseudo/rdf"/>
            <otherprop>propvalue</otherprop>
        </rdf:embedded>
    </test>
    
    Edwin tested this patch and it removes the extra namespace.
    
    -jh-
  7. Changed checkCharacterData() to allow surrogate pairs. Required changing

    jhunter committed Aug 31, 2004
    isXMLCharacter(char) to isXMLCharacter(int).
    
    Patch from Dave Byrne, vetted by Brad.
    
    Note: We still need to change XMLOutputter to handle surrogate pairs.
    
    -jh-
  8. flushCharacters() is protected again. Needed for flushing text by

    jhunter committed Aug 31, 2004
    subclasses.  Patch (and persistence) by Laurent.  :)  Vetted by Brad.
    
    -jh-
  9. Patch from Laurent, vetted by Brad.

    jhunter committed Aug 31, 2004
    "Force flush of pending text before returning result list."
    
    -jh-
  10. Patch from Laurent, vetted by Brad.

    jhunter committed Aug 31, 2004
    "Avoid IllegalStateException when applications access the partial document
    when parse failure occurs right after the beginning of the parse."
    
    -jh-