swh:1:snp:7d9f1bc35e120776766db9334626062f837c20ad
Tip revision: 9ee7aebbd4099fb9a462c14f75a73eb3755b1612 authored by Duncan Temple Lang on 03 October 2007, 00:00:00 UTC
version 1.93-2
version 1.93-2
Tip revision: 9ee7aeb
Changes
Version 1.93-1
* Method for xmlNamespace with a character is now exported! Needed for cases that arise in
SSOAP.
Version 1.93-0
* The closeTag() function within an XMLInternalDOM object returned by xmlTree() provides
support for closing nodes by name or position in the stack of open nodes.
* xmlRoot() method for an XMLInternalDOM tree.
* Added a parent argument to the constructor functions for internal nodes, e.g. newXMLNode,
newXMLPINode, newXMLCDataNode, etc.
* doc argument for the constructor functions for internal nodes is now moved from second to third.
Calling
* Potentially changed the details about creating XML documents and nodes with namespaces. If these
negatively effect your code, please send me email (duncan@wald.ucdavis.edu).
* Enhancements and fixes for creating XML nodes and trees, especially with name spaces.
* Many minor changes to catch special cases in working with internal nodes.
Version 1.92-1
* Make addNode()/addTag() in XMLInternalDOM work with previously created XML nodes via newXMLNode().
Thanks to Seth Falcon for pointing out this omission. More improvements in the pipeline for generating
XML.
* addChildren for an XMLInternalNode can be given a list of XMLInternalNodes and/or character strings.
* xmlSource() handles r:codeIds better.
Version 1.92-0
* Added removeNodes function for unlinking XMLInternalNode objects directly by reference.
* xmlRoot() handles empty documents.
* Documentation cleanups.
Version 1.91-1
* Remove output about "cleaning"/releasing an internal document pointer.
* The warning from getNodeSet/xpathApply about using a prefix for the default namespace
now has a class/type of condition, specificall "XPathDefaultNamespace".
Version 1.91-0
* argument to add a finalizer for an XMLInternalDocument in xmlTreeParse()/htmlTreeParse() when
useInternalNodes = TRUE. If this is set, automatic garbage collection is done which will free
any sub-nodes. If you want to work with any of these nodes after the top-level tree variable
has been released, specify addFinalizer = FALSE and explicitly free the document yourself with the
free() function.
* Sme improvements on namespace prefixes in internal nodes. See newXMLNode().
* classes for additional XMLInternalNodes (e.g. XMLInternalCDataNode) now exported
* removeAttributes() has a .all argument to easily remove all the attributes within a node.
Supported for both R and internal style nodes.
* xmlAttrs<-() function for simply appending attributes to a node.
* If xmlTreeParse() is called with asText = FALSE and the file is not found, an error of class
"FileNotFound" is raised.
* [[ opertor for XMLInternalDocument to get the first/only entry in
the node set from an XPath query. This is a convenience
mechansim for accessing the element when there is only one.
Version 1.9-0
* Added xmlAncestors() functions for finding chain of parent nodes, and optionally applying a
function to each.
* xmlDoc() allows one to create a new XML document by copying an existing internal node, allowing
for work with sub-trees as regular documents, e.g. XPath queries restricted to a subset of the
tree.
* Ability to do XPath searches on sub-nodes within a document. getNodeSet() and xpathApply()
can now operate on an XMLInternalNode by creating a copy of the node and its sub-nodes into a
new document. However, these is memory leak associated with this and you should us xmlDoc()
to create a new document from the node and then perform the XPath query on that and free the
document.
Version 1.8-0
* Added xinclude argument to xmlTreeParse() and htmlTreeParse() to control whether
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"> should be resolved and
the appropriate nodes inserted and the actual <include> node discarded.
* The namespaces argument of getNodeSet() (and implicitly of the [ method for an
XMLInternalDocument object) can be a simple prefix name when referring to the
default namespace of the document, e.g.
getNodeSet(doc, "/r:help/r:keyword", "r")
when the document has a default namespace.
* Added a 'recursive = FALSE' parameter to xmlNamespaceDefinitions() to be able to
process all descendant nodes and so fetch the namespace definitions in an entire
sub-tree. This can be used as input to getNodeSet(), for example.
* as() method for converting an XMLInternalDocument to a node.
* xmlNamespaceDefinitions() handles the case where the top-level element
is not the first node, e.g. when there is a DOCTYPE node and/or a comment.
Version 1.7-3
* addChildren() coerces a string to an internal text node before adding the child.
Version 1.7-2
* Trivial error in free() for XMLInternalDocument objects fixed so the memory is released.
Version 1.7-1
* addition to configuration to detect whether the checked field of the xmlEntity structure is present.
Version 1.7-0
This a quite comprehensive enhancement to the facilities in the XML package. A lot of work on
the tools for creating or authoring XML from within R were added and improved. Using internal
nodes directly with newXMLNode() and friends, or using xmlTree() is probably the simplest.
But xmlHashTree() creates them in R.
* IMPORTANT: one can and should use the names .comment, .startElement, .processingInstruction,
.text, etc. when identifying general element handlers that apply to all elements of a particular type
in an XML document rather than to nodes that have a particular name. This differentiates between
a handler for a node named, say, text and a handler for all text elements found in the document.
To use this new approach, call xmlTreeParse() or xmlEventParse() with
useDotNames = TRUE
This will become the default in future releases.
* namespaceHandlers() function provided to deal with node handler functions with XML name spaces where
there may be multiple handlers for the same node name but which are in different XML name spaces.
* signature for entityDeclaration function in SAX interface is changed so that the second argument
identifies the type of entity. Also, to query the value of an entity, the C code calls the
getEntity() method of the handlers.
* addChildren() & removeChildren() and addAttributes() & removeAttributes() for an existing node allows for
post-creation modification of an XML node.
* Improved support for name spaces on node attributes.
* xmlName<-() methods for internal and R-level XML nodes to change the name of a node.
* saveXML() and as(, "character") method for XMLInternalNode objects now to create a text representation of the
internal nodes.
* xmlTree() allows for creating a top-level node in the call to xmlTree() directly and does not
ignore these arguments.
* DTD and associated DOCTYPE can be created separately or directly in xmlTree().
* xmlTree() now allows the caller to specify the doc object as an argument, including NULL
for when the nodes do not need to have a document object.
* Better support in xmlTree() for namespaces and maintaining a default/active namespace prefix that is to be
inserted on each subsequent node.
* new functions for creating different internal node types - newXMLCDataNode, newXMLPINode, newXMLCommentNode, newXMLDTDNode.
* newXMLNode() handles text, using the new newXMLTextNode() and coerce methods.
* xmlTree() supports an active/default name space prefix which is used for new nodes.
* Resetting the state of the xmlSubstituteEntities variable is handled correctly in the case of an error.
Version 1.6-4
* xmlSize() method for an XMLInternalNode.
Version 1.6-3
* Handle change from Sys.putenv() to Sys.setenv().
Version 1.6-2
* Added a URI (old) class label to the result of parseURI, and exported that class for use in
other packages (specifically SSOAP, at present).
* For subsetting child nodes by name, there is a new all = FALSE parameter which allows the caller
to get the first element(s) that matches the name(s), or all of them with, e.g.
node["bob", all = TRUE]. This allows us to avoid the equivalent idiom
node[ names(node) == "bob" ]
which is complicated when node is the result of an inline computation.
* added method for setting names on an XMLNode (names<-.XMLNode), not just for retrieving them.
Version 1.6-1
* Added catalogResolve() function for looking up local files and aliases for URIs, and
PUBLIC and SYSTEM identifiers, e.g. in DOCTYPE nodes.
* saveXML method added for XMLFlatTree. (Identified by Alberto Monteiro.)
* Fixed saveXML methods for various classes.
* Doctype class: added validity method, improved coercion to character, and slightly more flexible
constructor function. Validates PUBLIC identifier.
Version 1.6-0
* In saveXML() method for XMLInternalDocument, we "support" the encoding argument by passing it to
xmlDocDumpFormatMemoryEnc() or xmlSaveFileEnc() in the libxml2 C code.
We could also use the xmlSave() API of libxml2.
* htmlTreeParse() supports an encoding argument, e.g. htmlTreeParse("9003.html", encoding = "UTF-8").
This allows one to correctly process HTML documents that do not contain their encoding information in the
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=..."/> tag.
The argument is also present in xmlTreeParse() but currently ignored.
Version 1.5-1
* updated documentation for the alias for free method for XMLInternalDocument.
Version 1.5-0
* added free() generic function and method for XMLInternalDocument
Version 1.4-2
* xmlTreeParse and htmlTreeParse will accept a character vector of length > 1
and treat it as the contents of the XML stream and so call
paste(file, collapse = "\n") before parsing. The asText = TRUE is implied.
Thanks to Ingo Feinerer for prompting this addition.
Version 1.4-1
* Fix to ensure a connection is closed in saveXML. Identified by Herve Pages
* Update definition and documentation for xmlAttrs to take ... arguments.
Version 1.4-0
* Added fullNamespaceInfo parameter for xmlTreeParse() which, if TRUE,
provides the namespace for each node as a named character vector giving
the URI of the namespace and the prefix as the element name, i.e. c(prefix = uri)
The default is FALSE to preserve the earlier behavior. The namespace object
has a class XMLNamespacePrefix for the old-style, and XMLNamespace for the new
style with c(name = uri) form.
This information makes comparing namespaces a lot simpler, e.g. in SOAP.
Version 1.3-2
Mainly fixes for internal nodes.
* Export XMLNode, XMLInternalNode, XMLInternalElementNode classes
* as() method for XMLInternalNode wasn't recognized properly because
the classes weren't exported.
Also, the internal function asRXMLNode() accepts trim and ignoreBlanks
arguments for cleaning up the XML node text elements that are created.
* export coerce methods.
Version 1.3-1
* parseURI() sets the port to NA if the value is 0.
Version 1.3-0
* The SAX parser now has a branches argument that identifies XML elements
which are to be built into (internal) nodes and then the sub-tree/node
is passed to the handler function specified in the element of the branches
argument. This mixes the efficient SAX event-driven parsing with the easier
programming tree-based model, i.e. DOM.
* XMLInternalNode objects in R now have extra class information identifying them as
as regular element, text, CDATA, PI, ...
Version 1.2-0
* names() method for XMLInternalNode
* [ method for XMLInternalDocument and string using XPath notation.
* getNodeSet() has support for default namespaces in the XML document.
It is available, by default, to the XPath expression with the prefix 'd'.
* Exported xmlNamespace() method for XMLInternalNode.
* xmlNamespaceDefinitions() made generic (S3) and new method for
XMLInternalNode class.
Version 1.1-1
* Change to handling entities in printing of regular R-level XML text nodes
created during xmlTreeParse() call. Identified by Ingo Feinerer.
* saveXML for an XMLNode object will take a file name and write to the corresponding
file, overwriting it if it already exists.
Version 1.1-0
* xpathApply and getNodeSet take functions to be applied to nodes in a node
set resulting from an XPath query.
Version 1.0-0
* Version skipped as it is not a milestone release, just ran out of numbers!
Version 0.99-94
Changes from Russell Almond and suggestions from Franck Giolat for creating XML in R
* xmlNode() puts the names on children if omitted. Caller can use names other
than the XML element name (but this is not necessarily advisable).
* Added xmlChildren() method to set the children.
* Printing of an XML node to the console handles empty nodes and text nodes better.
* xmlTextNode() will replace reserved characters with their entity equivalent, e.g.
& with & and < with <. One can specify the entity vector including providing
an empty one should one want to avoid replacement.
Version 0.99-93
Changes from Martin Morgan
* import normalizePath from utils.
* Changes to configure.win to find 3rd party DLLs in bin/ directory, not lib/
Version 0.99-92
* Fix for setting DTD entity field uncovered by the strict type checking in R internals.
Version 0.99-91
* Added an encoding argument to saveXML(), initially for use in the Sxslt package.
Version 0.99-9
* Example of using namespaces in getNodeSet()
* Examples for xmlHashTree().
Version 0.99-8
* Introduced initial version of flat trees for storing the DOM in a
non-hierarchical data structure in R. This allows us to work with
a mutable tree and to perform certain operations across all the
nodes more efficiently, i.e. non-recursively. Importantly, one
can find the parent node of a given node in the tree which is not
possible with the list of list approach. It does mean more
computation for some common operations, specifically parsing.
Indeed, it can be 25 times slower for a non-trivial file, i.e. one
with. However, for a file with 7700 nodes, it still only takes 2
1/2 seconds. So there is a trade-off. While there are a few
versions in the code, xmlHashTree() is the one to use for speed
reasons. xmlFlatListTree() is another and xmlFlatTree() is
excruciatingly slow. See tests/timings.R for some comparisons.
xmlGetElementsByTagName and other facilities work on these types
of trees.
More functions and methods can and should be provided to work with
these trees if they turn out to be used in any significant way.
* add the R attribute 'namespaces' to an XML node's attributes
vector so that one can differentiate between conflicting attribute
names with different namespaces.
* added parseURI() to return the elements of a URI from a string.
Version 0.99-7
* Example of reading HTML tables using XPath and internal nodes in bondsTables.R
* Some additional methods for XMLInternalNode.
Version 0.99-6
* configure does not require the GNU sed, but can use any version of sed now that the
use of + in the regular expression has been removed.
Version 0.99-5
* Added append.XMLNode and append.xmlNode to the exported symbols from the NAMESPACE
file.
Version 0.99-4
* Fix for addComment() in xmlOutputDOM().
* Removed all the compilation warnings about interchanging xmlChar* and char*.
Version 0.99-3
* Added support in print methods for XML objects for indent = FALSE,
and tagSeparator, which defaults to "\n". These can be used to print
a faithful representation of an original XML document, but only when
used in combination with
xmlTreeParse( skipBlanks = FALSE, trim = FALSE)
Version 0.99-2
* Problems compiling with libxml2-2.5.11 and libxml2-2.6.{1,2}, so
we now test for a recent version of libxml. The test uses sed -r
which may cause problems. If one really wants to avoid the tests
set the environment variable FORCE_XML2 to any value before running
R CMD INSTALL XML.
* Documentation for getNodeSet() didn't refer to the new namespaces argument.
Version 0.99-1
* getNodeSet() takes a namespaces argument which is named character vector of
prefix = URI pairs of namespaces used in the XPath expression.
* Handlers for xmlEventParse() can include startDocument and endDocument elements
to catch those particular events. Useful for closing connections and general cleanup,
especially in the "pull" data source, i.e. connections or functions.
* xmlEventParse() when called with a function as the data source now doesn't have
a new line appended to each string returned to the parser by the function.
* Passing a connection to xmlEventParse() now uses a regular R function to call
readLines(con, 1) and no longer does this via C code to call readLines().
* Fix to the example in xmlEventParse() using the state variable.
Version 0.99-0
* Implementation for the endElement in the xmlEventParse() for saxVersion == 2.
* In xmlEventParse( , saxVersion = 2), the namespaces come as a named vector
in the fourth argument.
Version 0.98-1
* Messages from errors are now more informative. Using saxVersion = 2 in xmlEventParse(), you get
get the line and column information about the error.
Version 0.98
* Added saxVersion parameter to xmlEventParse() to control which interface is used at the C level.
This changes the arguments to the startElement handler, adding the namespace for the
element.
* Added xmlValidity() function to set the value of the default validity action. This allows us to do the
setting in the R code. This is currently not exported.
* Added recursive parameter to xmlElementsByTagName() function. This provides functionality
similar to getElementsByTagName() in XML parsing APIs for other languages.
* xmlTreeParse() called with no handlers and useInternalNodes returns a reference to the
C-level xmlDocPtr instance. This is an object of class "XMLInternalDocument". This can be
used in much the same way as the regular "XMLDocument" tree returned by xmlTreeParse,
e.g. xmlRoot, etc.
* Added getNodeSet() to evaluate XPath expressions on an XMLInternalDocument object.
* Added a validate parameter to the xmlEventParse() function.
Version 0.97-8
* Fix error where CDATA nodes and potentially other types of nodes (without element names) were being
omitted from the R tree in a simple call to xmlTreeParse("filename") (i.e. with no handlers).
Version 0.97-7
* Documentation updates.
Version 0.97-6
* useInternalNodes added to xmlTreeParse() and htmlTreeParse().
This allows one to avoid the overhead of converting the contents of nodes to
R objects for each handler function call. Also, can access parents, siblings,
etc. from within a handler function.
* Included parameterizations for Windows from Uwe Ligges to aid automated-building
and finding the libxml DLL at run time.
Version 0.97-5
* Methods for accessing component of XMLInternalDocument and XMLInternalNode objects,
e.g. xmlName, xmlNamespace, xmlAttrs, xmlChildren
* saveXML.XMLInternalDOM now supports specification of a Doctype (see Doctype).
* saveXML uses NextMethod and arguments are transferred. Identified by Vincent Carey.
* Suppress warnings from R CMD check.
* Change of the output file in saveXML() example to avoid conflict with Microsoft
Windows use of name con.xml.
Version 0.97-4
* Quote URI values in namespace definitions in print.XMLNode.
Version 0.97-3
* Added a method for xmlRoot for HTMLDocument
* Changed the maintainer email address.
Version 0.97-2
* Added cdata to the collection of functions that are used in the handlers
for xmlEventParse(). Omission identified by Jeff Gentry.
* Fixed the maintainer email address to duncan@wald.ucdavis.edu
Version 0.97-1
* Put the correct S3method declarations in the NAMESPACE.
Version 0.97-0
* Using a NAMESPACE for the package
Version 0.96-0
* Using libxml2 by default rather than libxml.
* Fixed typo. in PACKAGE when initializing the library.
Version 0.95-7
* When creating a namespace identifier, if the namespace doesn't have an href, then we put
in an <NA> string.
Version 0.95-6
* Documentation updates for synchronization with the code.
Version 0.95-5
* Trivial bug of including extra arguments in call to UseMethod for
dtdElementValidEntry that generated warnings.
Version 0.95-4
* Configuration now tries to find libxml 1, then libxml 2 unless explicitly
instructed to find libxml 2 via --with-libxml2. So the change is to pick
up libxml 2 if libxml 1 is not found rather than signal an error.
Version 0.95-3
* Remove the need to define xmlParserError. Instead, set the value of the error
routine/function pointer to our error handler in the different default handlers
in libxml. We now initialize these default objects when we load the library.
* When setting the environment variables LIBXML_INCDIR and LIBXML_LIBDIR, one
needs to specify the -I and -L prefixes for the compiler and linker respectively
in front of directory names.
* Detect whether the routine for xmlHashScan (in libxml2) provides a return value
or not. This changed in version 2.4.21 of libxml2.
Version 0.95-2
* Configuration detects Darwin and handles multiplicity of xmlParserError
symbol.
Version 0.95-1
* Configuration now supports the specification of the xml-config script
to use via the environment variable XML_CONFIG or the --with-xml-config
as in --with-xml-config=xml2-config
* Recognize file:/// prefix as URL and not switch to treating file name as
XML text.
Version 0.95-0
* Event-driven parsing (SAX) can take a connection object or a function
that is called when the parser needs more input. See the documentation
for xmlEventParse().
* Classes and methods explicitly created during the installation.
This will cause problems with namespaces until the saving of the image
model works with namespaces.
Version 0.94-1
* Minor change to configuration script to avoid -L-L in specification of
directory for XML library (libxml).
Version 0.94-0
* Use registration of C routines
* Added methods for saveXML for XMLNode and XMLOutputStream objects.
Version 0.93-4
* replaceEntities argument for xmlEventParse.
* S4 SAX methods assigned to the correct database.
Version 0.93-3
* Correct support for DTDs and namespaces in the internal nodes
used in xmlTree(). Errors identified by Vincent Carey.
Version 0.93-2
* Bug in trimming white space discovered by Ott Toomet.
Version 0.93-1
* Documentation updates. Included xmlGetAttr.Rd.
Version 0.93-0
* Added toString.XMLNode
* Fixed the printing of degenerate namespaces in an XML node,
i.e. the spurious `:'.
Version 0.92-2
* Fixed C bug caused by using namespace without a suffix,
e.g. xmlns="http:...." assumed prefix was present.
Thanks to David Meyer.
Version 0.92-1
* Display the namespace definitions when printing an XMLNode object.
* New addAttributeNamespaces argument for xmlTreeParse() that controls whether
namespaces are included in attribute names.
Version 0.92-0
* XMLNode class now contains a field for namespace definitions
The `namespace' field is a character string identifying the prefix's
namespace. The `namespaceDefinition' field contains the full definitions
of each of the namespaces defined within a node.
* Printing of XLM nodes displays the namespace.
* xmlName() takes a `full' argument that controls whether the
namespace prefix is prepended to the tag name.
Version 0.91-0
* Added a mechanism to the SAX parser to allow a state object
be passed between the callbacks and returned as the result of
the parsing. This avoids the need for closures. Also, works
with S4 classes and the genericSAXHandlers() methods by allowing
one to write methods for these generic callbacks that dispatch
based on the type of the state object.
* Fix to make work properly with S4 class system.
Version 0.9-1
* Formatting of the help files to avoid long lines
identified by Ott Toomet
* Addition of `ignoreComments' argument for xmlValue()
* Date in the DESCRIPTION file corrected (thanks to Doug Bates).
Version 0.9-0
* Added addCData() and addPI() to the handlers of the different
XMLOutputStream classes.
Code for XMLInternalDOM (i.e. xmlTree()) from Byron Ellis.
* print() method for XMLProcessingInstruction node has the terminating `?'
as in <?pi-name text ?>.
Version 0.8-2
* Changes to support libxml2-2.4.21 (specifically the issues with
the headers and parse error regarding xmlValidCtxt). Thanks to
Wolfgang Huber for identifying this.
* Ignoring R_VERSION now, so dependency is R >= 1.2.0
Version 0.8-1
* Added an `attrs' argument to the xmlOutputBuffer and xmlTree
functions for specifying the top-level node.
Version 0.8-0
* xmlValue() extended to work recursively if a node has
only one child.
* T and F replaced by TRUE and FALSE
Version 0.7-4
* Support for Windows
Version 0.7-3
* Documents without <DOCTYPE ..> are handled correctly.
* Configuration tweak to set LD_LIBRARY_PATH to handle the case
that the user specifies LIBXML_LIBDIR and it is needed to run the
version test.
* Keyword XML changed to IO.
Version 0.7-2
* Fix for printing XMLNode objects to handle comments and elements
with name "text". Identified by Andrew Schuh.
Version 0.7-1
* Minor fixes for passing R CMD check.
Version 0.7-0
* Generating XML trees using internal libxml structures:
xmlTree(), newXMLDoc(), newXMLNode(), saveXML().
* Support parsing HTML (htmlTreeParse()) using DOM.
Suggestion from Luis Torgo.
* Additional updates for libxml2, relating to DTDs.
Version 0.6-3
* Installation using --with-xml2 now attempts to link against libxml2.so
and the appropriate header files.
* Use libxml's xml-config or xml2-config scripts if these are available.
Version 0.6
* xmlDOMApply for recursively applying a function to each node in a tree.
Version 0.5-1
* simplification of xmlOutputBuffer so that it doesn't put
the namespace definition in each and every tag.
* configuration changes to support libxml2-2.3.6
(look for libxml2, check if xmlHashSize is available)
* now dropping nodes if the handler function returns NULL.
Updated documentation.
* spelling correction in the documentation
Version 0.5
* xmlOutputBuffer now accepts a connection.
* Fixes for using libxml2, specifically 2.2.12.
Also works for libxml2.2.8
* Enhanced configuration script to determine what features are available.
Version 0.4
* `namespace' handler in xmlTreeParse is called when a namespace
declaration is encountered. This is called before the child nodes
are processed.
* More documentation, in Tour.
* xmlValue, xmlApply, xmlSApply, xmlRoot, xmlNamespace, length, names
* Constructors for different types of nodes: XMLNode, XMLTextNode, XMLProcessingInstruction.
* Methods for print(), subsetting ([ and [[), accessing the fields
in an XMLNode object.
* New classes for the different node types (e.g. XMLTextNode)
* Event driven parsing available via libxml. Expat is not needed but
can be used.
* Document sources can be URLs (ftp and http) when using the libxml parser.
* Examples for processing MathML and SVG files. See examples/ directory.
* Examples for event driven parsing.
* Class of result from xmlTreeParse is XMLDocument.
* Comments, Entities, Text, etc. inherit from XMLNode
in addition to defining their own XML<type> class.