39f91b981b1d6d33a9048bd0d4e9eb54a7968227 |
19-Mar-2010 |
Jesse Wilson <jessewilson@google.com> |
Fixing namespace+prefix mode in Expat and removing optional fields from callbacks. The first part is related to bug 6632: http://code.google.com/p/android/issues/detail?id=6632 I added these optional fields back when I was originally updating the XML parser for Froyo. I've decided to remove them to simplify migrating between Android and the RI. It should also save some object allocations. Note that the RI v5 and the RI v6 behave differently for optional values on attributes; this motivated me to add the otherwise unfortunate assertOneOf() method to the testcase. (We behave more like RI v6, which is to supply the values upon request) Change-Id: Icfa5d29976a86bf194b3ed7c0d9e2275c3bff9dd
xpatReader.java
|
312752642a4539788952260fc517d286f6a6202e |
18-Mar-2010 |
Jesse Wilson <jessewilson@google.com> |
Fixing 10 of the XPath failures caused by a malformed Document. See bug 2518858. This makes our XPath implementation fail the exact same tests as the RI's. (which we assume is also based on Apache Xalan) Change-Id: I9a98323113c95609651e948ad11113f84ccd87ec
arsers/DocumentBuilderImpl.java
|
271825415aa961bdd9f28a551575bcee6f27b4ab |
16-Mar-2010 |
Jesse Wilson <jessewilson@google.com> |
Implementing Document.renameNode() and DOMImplementation.getFeature(). The rename code required moving some behaviour from ElementImpl and AttrImpl up to their common superclass, NodeImpl. Change-Id: I30910de146f525a5ecc837895ce5808928b858a0
om/AttrImpl.java
om/DOMImplementationImpl.java
om/DocumentImpl.java
om/ElementImpl.java
om/NodeImpl.java
|
92e01317d2428856cee52965745d17699a33be5a |
12-Mar-2010 |
Jesse Wilson <jessewilson@google.com> |
Adding support for DOM3 attribute IDs and SchemaTypeInfos. Change-Id: I35e56ed989820df6b8fea36bbf81fe0314c76304
om/AttrImpl.java
om/ElementImpl.java
om/NodeImpl.java
|
3c5ed1cf96d6b0c24076d60202c9db43315e451d |
11-Mar-2010 |
Jesse Wilson <jessewilson@google.com> |
Implementing getBaseUri() for DOM. The tests for this uncover problems with the RI's implementation. It does bizarre things with hashes, trashing the absolute URI and returning a page-relative one (like "#foo"). Change-Id: Ib8af163a7b359e3f72a9c94eb3dd7e81e3a9a95c
om/NodeImpl.java
|
4daa600befc82e6f29ee943645dbbcc51f12097e |
10-Mar-2010 |
Jesse Wilson <jessewilson@google.com> |
Implement adoptNode() and importNode(). importNode() shares all of its implementation with Node.clone(); the only areas they differ are the ones we don't support. The shared code is in 2 new methods, shallowCopy() and cloneOrImportNode(), both based on the old clone() method. Also removing some unnecessary "throws DOMException" clauses. The tests for the new methods are slightly cumbersome. Most move/copy nodes to another document, serialize that, and compare. Change-Id: Id9fb076e020d8327a8f70da401af9bd95d7a3d1b
om/AttrImpl.java
om/DocumentImpl.java
om/NodeImpl.java
|
e14d736a739d6523fd13d98f13e9d51167197a34 |
09-Mar-2010 |
Jesse Wilson <jessewilson@google.com> |
Adding support for getUserData() and setUserData() to DOM nodes. Also making sure both Document and DocumentType get assigned a Document value when possible; this is necessary to store the user data objects.
om/DOMImplementationImpl.java
om/DocumentImpl.java
om/DocumentTypeImpl.java
om/ElementImpl.java
om/InnerNodeImpl.java
om/NamedNodeMapImpl.java
om/NodeImpl.java
om/TextImpl.java
arsers/DocumentBuilderImpl.java
|
e5aa5453769a682192ead8b1203e4096879ecacd |
02-Mar-2010 |
Jesse Wilson <jessewilson@google.com> |
Implementing almost all of Document.normalizeDocument(). This follows the rules specified by DOMConfiguration. In particular: - replacing CDATA nodes with text - splitting CDATA nodes - merging text nodes - stripping comments - detecting invalid characters I haven't added the normalization code for XML validation or namespaces.
om/CDATASectionImpl.java
om/CharacterDataImpl.java
om/CommentImpl.java
om/DOMConfigurationImpl.java
om/DocumentImpl.java
om/InnerNodeImpl.java
om/ProcessingInstructionImpl.java
om/TextImpl.java
|
21d27c095fee51fd6eac6a68d50b79df4dc97d85 |
27-Feb-2010 |
Jesse Wilson <jessewilson@google.com> |
New implementation for DOMConfiguration. This API is disgusting. Its not regular, not typesafe, sparsely implemented and overly specific. I'm implementing the minimum I can get away with - exactly the same route taken by the RI. The Parameter stuff feels a little bit like overkill, but it allowed me to group related chunks of code together and avoid long chains of equalsIgnoreCase if statements. This is necessary to implement Document.normalize(), one of the last remaining APIs in DOMv3. Also fixing our implementation of Node.normalize() and adding tests to discover a bug in that code. Previously a document like this: "<foo>abc<br>def</foo>" Would be normalized to this: "<foo>abcdef<br></foo>" Which is a horrible bug! Yuck. Implementation and tests for Document.normalize() are forthcoming.
om/DOMConfigurationImpl.java
om/DocumentImpl.java
om/InnerNodeImpl.java
|
0baa7c3c2da7d5467c3f8176813646503410b7a2 |
26-Feb-2010 |
Jesse Wilson <jessewilson@google.com> |
Adding tests to parse document attributes from the DOM. This adds implementation and tests for these methods: getInputEncoding(), getDocumentURI(). And tests for these methods: getXmlEncoding(), getXmlVersion(), getXmlStandalone().
om/DOMImplementationImpl.java
om/DocumentImpl.java
arsers/DocumentBuilderImpl.java
|
606d8d2d12b615f58bc7614c490f9c48cf923e95 |
24-Feb-2010 |
Jesse Wilson <jessewilson@google.com> |
Implementing still more DOM API for text nodes. - Text.isElementContentWhitespace() - Text.getWholeText() - Text.replaceWholeText()
om/CDATASectionImpl.java
om/CharacterDataImpl.java
om/DOMImplementationImpl.java
om/DocumentImpl.java
om/NodeImpl.java
om/TextImpl.java
arsers/DocumentBuilderImpl.java
|
cacbb893cd1361e7c7a63aa49ae85c0232813b9c |
20-Feb-2010 |
Jesse Wilson <jessewilson@google.com> |
More XML DOM v3 APIs. This adds the following APIs and tests: - Node.isDefaultNamespace - DomImplementation.hasFeature - Node.isSupported - Node.getFeature - Node.isEqualNode
om/DOMImplementationImpl.java
om/DocumentImpl.java
om/NodeImpl.java
|
12547dd7a3879e22e618f0464eb71a69cc15e2cc |
19-Feb-2010 |
Jesse Wilson <jessewilson@google.com> |
DOM setTextContent() tests and implementation fixes.
om/AttrImpl.java
om/NodeImpl.java
om/TextImpl.java
|
a76b64ab7f0ece60b794af13154d4150ca0170fa |
19-Feb-2010 |
Jesse Wilson <jessewilson@google.com> |
Filling in some gaps in our XML DOM v3 API. Specifically, these methods on Node: - setTextContent() - isSameNode() - lookupPrefix() - lookupNamespaceURI() In order to implement the last 2 I needed to fix our KXml parser to include namespace attributes (ie. xmlns) in the pulled document. Previously these were being elided. Added a new testcase to verify our behaviour. It passes the RI. On Dalvik we have a small issue with entity declarations. Added a new testcase to verify Node.getBaseURI(). This test fails because the method isn't implemented. Part of this test required moving a method out to Support_Resources.java; in order to verify the BaseURI the XML must be read from a file and not a stream (so that path information exists). Also... - Style cleanup: changing static calls to look like static calls. - Efficiency: avoiding concatenating with "" when unnecessary - Duplication: sharing prefix validation between attributes and elements - Renaming NodeTests to NodeTest for vogar-friendliness Outstanding: - I need to write a test for setTextContent().
om/AttrImpl.java
om/ElementImpl.java
om/NodeImpl.java
arsers/DocumentBuilderImpl.java
|
2583639a965660e62e2a4552049619f84af37021 |
11-Feb-2010 |
Jesse Wilson <jessewilson@google.com> |
Fixing problems with the test runner's ability to parse expected results files. It appears that the original authors of this testing framework didn't really know whether these files were supposed to be XML or HTML, UTF-8 or UTF-16, and so there's quite a mess of processing in order to canonicalize them.
om/InnerNodeImpl.java
|
fb1a80758587eecaa912130640bd9f3ef0d0d7bf |
02-Feb-2010 |
Jesse Wilson <jessewilson@google.com> |
Fixing some of our XSLT implementation issues. These changes move our XSLT code to passing 1898/3173 of the OASIS tests. To contrast, the RI passes 2105/3173 tests. Highlights: - Implementing getTextContent() for nodes - Removing validation during transforms. We don't support validation! - Fixing attribute constraints to match the spec - Fixing test suite to not confuse BaseURI from NamespaceURI
om/AttrImpl.java
om/DocumentImpl.java
om/DocumentTypeImpl.java
om/InnerNodeImpl.java
om/NodeImpl.java
|
e4402d94d3bed9d3b8a0aa0496db177e6dfd1473 |
02-Feb-2010 |
Jesse Wilson <jessewilson@google.com> |
Restore our ability to parse an XML Document given a File argument directly, rather than via a stream. When I updated DocumentBuilder but not its subclass DocumentBuilderImpl, some of the assumptions by DocumentBuilderImpl were violated.
arsers/DocumentBuilderImpl.java
|
4c7a0d97cf2b27790e6236965a1d798d710d7ec7 |
27-Jan-2010 |
Jesse Wilson <jessewilson@google.com> |
Bring our XML APIs up to date with Java 5. New packages for Java 5 compatiblity: - javax.xml.datatype - javax.xml.namespace - javax.xml.parsers (updated) - javax.xml.transform - javax.xml.transform.dom - javax.xml.transform.sax - javax.xml.transform.stream - javax.xml.validation - javax.xml.xpath - org.w3c.dom (updated) - org.w3c.dom.events - org.w3c.dom.ls (load/save) - org.w3c.dom.traversal - org.w3c.dom.views Omitted packages (that otherwise exist in Java 5) - org.w3c.dom.bootstrap. This package facilitates pluggable implementations of DOM. I'm not including this because there's little need for it in practice; and because it adds an unnecessary layer of complexity. This decision is also reflected in TransformerFactory.newInstance(), SAXParserFactory.newInstance(), and DocumentBuilderFactory.newInstance(). New packages that pseudo-exist in Java 5 - org.w3c.dom.traversal This package is referenced by Java 5's org.w3c.dom.ls.LSSerializerFilter, but isn't included in the Javadoc API. Their spec isn't self-consistent. - org.w3c.dom.views This package is referenced by Java 5's org.w3c.dom.events.MouseEvent, but isn't included in the Javadoc API. Another spec that isn't self-consistent. This upgrades DOM from v2 to v3. http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/ This includes some API-incompatible changes; notably introducing new methods into interfaces. I believe this is still safe, and Java made a similar backwards incompatible change when they upgraded DOM from v2 to v3 between Java 1.4 and Java 5.0. Source for the new APIs comes from Apache XML commons. http://svn.apache.org/repos/asf/xml/commons/trunk rev 901014. This code currently contains several gaps in its implementation. In particular, the impelementations of the DOM model classes (AttrImpl, ElementImpl, NodeImpl) have DOM v3 methods that throw UnsupportedOperationExceptions. I intend to address this problem in an immediate follow-up CL. All gaps are marked with TODO comments, and they all live in the org.apache.harmony.xml.dom package. To implement these APIs, I've included Apache Xalan. In a follow-up change I intend to remove most of the code we don't actually need. I'm using their pristine copy from SVN so Git can track our local modifications. http://svn.apache.org/repos/asf/xalan/java/trunk rev 889881.
om/AttrImpl.java
om/CDATASectionImpl.java
om/CharacterDataImpl.java
om/CommentImpl.java
om/DOMImplementationImpl.java
om/DocumentFragmentImpl.java
om/DocumentImpl.java
om/ElementImpl.java
om/EntityImpl.java
om/EntityReferenceImpl.java
om/InnerNodeImpl.java
om/LeafNodeImpl.java
om/NodeImpl.java
om/NotationImpl.java
om/ProcessingInstructionImpl.java
om/TextImpl.java
|
369a8d273180de03122c1b90a0949ce7b52427ba |
18-Dec-2009 |
Elliott Hughes <enh@google.com> |
Depessimize string conversions. Why does this idiom persist? It's ugly, and it's the least efficient way to do it. (I found the ones in DecimalFormatSymbols while invesigating why "new SimpleDateFormat()" burns through so many StringBuilders. grep(1) found the rest.) The DocumentBuilderImpl removes an unnecessary level of indirection, since we implement Character.toString in terms of String.valueOf. (I wouldn't have bothered except this was the only use of Character.toString in the core libraries, and I added it myself a few weeks ago.)
arsers/DocumentBuilderImpl.java
|
544e7bef94f6c8e91d6eb5eaf49b5369fa04a23a |
10-Dec-2009 |
Elliott Hughes <enh@google.com> |
Implement DTDHandler support for ExpatParser. Every time a third-party developer gets their DefaultHandler method signatures wrong (making it impossible for us to call them), they see this in the log and complain that SAX parsing is broken on Android: WARN/ExpatReader(704): DTD handlers aren't supported. This patch adds that support -- even though no-one wants it -- so we can get rid of the irrelevant log message.
xpatParser.java
xpatReader.java
|
094afca45544ca924da51f359ebfdd174ba3ba08 |
17-Nov-2009 |
Elliott Hughes <enh@google.com> |
Various XML fixes. Add tests for bug 2487, exploring the situations where "]]>" is and isn't allowed. Fix the bug by changing KXmlParser so it pays attention to whether it's dealing with normal text or text in an attribute value and reports errors appropriately. In order to pass the new tests, we also need to fix DocumentBuilder to pay attention to its DocumentBuilderFactory's "coalescing" setting: whether or not adjacent text/CDATA nodes should be coalesced. This in turn fixes a @KnownFailure in DocumentBuilderFactoryTest: previously we didn't allow the caller to turn "coalescing" off (though until my previous patch, we didn't actually coalesce anyway). Now we support both, and I've made coalescing the default, because bug reports tell us that's what users want. It's how the RI behaves, too. Bug: 2487
arsers/DocumentBuilderFactoryImpl.java
arsers/DocumentBuilderImpl.java
|
ef4b3bb4dc2c1c5b0b29209f6d3ea2126be3be0d |
10-Nov-2009 |
Elliott Hughes <enh@google.com> |
Fix DOM parsing of character references/entities. Our DOM parser didn't support { or š character references, and didn't merge adjacent text nodes into one (so "a&b" would be three text nodes rather than one; SAX allows the former, but DOM guarantees the latter). This patch fixes both bugs, and adds tests. Bug: 2607 (and duplicates)
arsers/DocumentBuilderImpl.java
|
5894bfbbbee7f9cd5b3b33e628c7d0291e2ece79 |
24-Sep-2009 |
Elliott Hughes <enh@google.com> |
Fix Node.getNextSibling bounds checking. Obvious copy & paste error in InnerNodeImpl compared to LeafNodeImpl, plus new test. I've also fixed a typo that annoys me whenever I look at the XML test results, and removed a KnownFailure for a test that passes (and has been passing for some time). Bug: 779
om/InnerNodeImpl.java
|
f6c387128427e121477c1b32ad35cdcaa5101ba3 |
04-Mar-2009 |
The Android Open Source Project <initial-contribution@android.com> |
auto import from //depot/cupcake/@135843
xpatAttributes.java
xpatException.java
xpatParser.java
xpatPullParser.java
xpatReader.java
om/AttrImpl.java
om/CDATASectionImpl.java
om/CharacterDataImpl.java
om/CommentImpl.java
om/DOMImplementationImpl.java
om/DocumentFragmentImpl.java
om/DocumentImpl.java
om/DocumentTypeImpl.java
om/ElementImpl.java
om/EntityImpl.java
om/EntityReferenceImpl.java
om/InnerNodeImpl.java
om/LeafNodeImpl.java
om/NamedNodeMapImpl.java
om/NodeImpl.java
om/NodeListImpl.java
om/NotationImpl.java
om/ProcessingInstructionImpl.java
om/TextImpl.java
arsers/DocumentBuilderFactoryImpl.java
arsers/DocumentBuilderImpl.java
arsers/SAXParserFactoryImpl.java
arsers/SAXParserImpl.java
|
f72d5de56a522ac3be03873bdde26f23a5eeeb3c |
04-Mar-2009 |
The Android Open Source Project <initial-contribution@android.com> |
auto import from //depot/cupcake/@135843
xpatAttributes.java
xpatException.java
xpatParser.java
xpatPullParser.java
xpatReader.java
om/AttrImpl.java
om/CDATASectionImpl.java
om/CharacterDataImpl.java
om/CommentImpl.java
om/DOMImplementationImpl.java
om/DocumentFragmentImpl.java
om/DocumentImpl.java
om/DocumentTypeImpl.java
om/ElementImpl.java
om/EntityImpl.java
om/EntityReferenceImpl.java
om/InnerNodeImpl.java
om/LeafNodeImpl.java
om/NamedNodeMapImpl.java
om/NodeImpl.java
om/NodeListImpl.java
om/NotationImpl.java
om/ProcessingInstructionImpl.java
om/TextImpl.java
arsers/DocumentBuilderFactoryImpl.java
arsers/DocumentBuilderImpl.java
arsers/SAXParserFactoryImpl.java
arsers/SAXParserImpl.java
|
2ad60cfc28e14ee8f0bb038720836a4696c478ad |
21-Oct-2008 |
The Android Open Source Project <initial-contribution@android.com> |
Initial Contribution
xpatAttributes.java
xpatException.java
xpatParser.java
xpatPullParser.java
xpatReader.java
om/AttrImpl.java
om/CDATASectionImpl.java
om/CharacterDataImpl.java
om/CommentImpl.java
om/DOMImplementationImpl.java
om/DocumentFragmentImpl.java
om/DocumentImpl.java
om/DocumentTypeImpl.java
om/ElementImpl.java
om/EntityImpl.java
om/EntityReferenceImpl.java
om/InnerNodeImpl.java
om/LeafNodeImpl.java
om/NamedNodeMapImpl.java
om/NodeImpl.java
om/NodeListImpl.java
om/NotationImpl.java
om/ProcessingInstructionImpl.java
om/TextImpl.java
arsers/DocumentBuilderFactoryImpl.java
arsers/DocumentBuilderImpl.java
arsers/SAXParserFactoryImpl.java
arsers/SAXParserImpl.java
|