[rkward-cvs] SF.net SVN: rkward:[4184] trunk/rkward/packages/XiMpLe
m-eik at users.sourceforge.net
m-eik at users.sourceforge.net
Sat Mar 17 00:58:14 UTC 2012
Revision: 4184
http://rkward.svn.sourceforge.net/rkward/?rev=4184&view=rev
Author: m-eik
Date: 2012-03-17 00:58:13 +0000 (Sat, 17 Mar 2012)
Log Message:
-----------
added pasteXML methods as replacements for pasteXMLNode() and paste XMLTree() and generalized show method accordingly
Modified Paths:
--------------
trunk/rkward/packages/XiMpLe/ChangeLog
trunk/rkward/packages/XiMpLe/DESCRIPTION
trunk/rkward/packages/XiMpLe/NAMESPACE
trunk/rkward/packages/XiMpLe/R/XMLTree.R
trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R
trunk/rkward/packages/XiMpLe/R/XiMpLe-package.R
trunk/rkward/packages/XiMpLe/R/XiMpLe.node-class.R
trunk/rkward/packages/XiMpLe/R/node.R
trunk/rkward/packages/XiMpLe/inst/CITATION
trunk/rkward/packages/XiMpLe/inst/NEWS.Rd
trunk/rkward/packages/XiMpLe/man/XMLTree.Rd
trunk/rkward/packages/XiMpLe/man/XiMpLe-package.Rd
trunk/rkward/packages/XiMpLe/man/node.Rd
trunk/rkward/packages/XiMpLe/man/show-methods.Rd
Added Paths:
-----------
trunk/rkward/packages/XiMpLe/R/pasteXML-methods.R
trunk/rkward/packages/XiMpLe/R/show-methods.R
trunk/rkward/packages/XiMpLe/man/pasteXML-methods.Rd
Removed Paths:
-------------
trunk/rkward/packages/XiMpLe/R/pasteXMLNode.R
trunk/rkward/packages/XiMpLe/R/pasteXMLTree.R
trunk/rkward/packages/XiMpLe/R/show.XiMpLe.doc.R
trunk/rkward/packages/XiMpLe/R/show.XiMpLe.node.R
trunk/rkward/packages/XiMpLe/man/pasteXMLNode.Rd
trunk/rkward/packages/XiMpLe/man/pasteXMLTree.Rd
Modified: trunk/rkward/packages/XiMpLe/ChangeLog
===================================================================
--- trunk/rkward/packages/XiMpLe/ChangeLog 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/ChangeLog 2012-03-17 00:58:13 UTC (rev 4184)
@@ -1,8 +1,11 @@
ChangeLog for package XiMpLe
-changes in version 0.03-12 (2012-03-15)
+changes in version 0.03-12 (2012-03-16)
- node() now also works with single XiMpLe.node objects (not only full trees)
- - fixed dropped text value if node also had child nodes in pasteXMLNode()
+ - added pasteXML methods to paste objects of classes XiMpLe.node and XiMpLe.doc in a more
+ general manner. the former functions pasteXMLNode() and pasteXMLTree() are replaced by mere
+ wrapper frunctions to pasteXML() and should not be used any longer.
+ - fixed dropped text value if node also had child nodes in pasteXML()
changes in version 0.03-11 (2012-03-14)
- added functions XMLNode() and XMLTree() as constructor functions for XML nodes and trees.
Modified: trunk/rkward/packages/XiMpLe/DESCRIPTION
===================================================================
--- trunk/rkward/packages/XiMpLe/DESCRIPTION 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/DESCRIPTION 2012-03-17 00:58:13 UTC (rev 4184)
@@ -6,30 +6,29 @@
Depends:
R (>= 2.9.0),methods
Enhances: rkward
-Description: This package provides a simple XML tree parser/generator. It
- includes functions to read XML files into R objects, get information out of
- and into nodes, and write R objects back to XML code. It's not as powerful
- as the XML package and doesn't aim to be, but for simple XML handling it
- could be useful. It was originally programmed for RKWard.
+Description: This package provides a simple XML tree parser/generator.
+ It includes functions to read XML files into R objects, get
+ information out of and into nodes, and write R objects back to
+ XML code. It's not as powerful as the XML package and doesn't
+ aim to be, but for simple XML handling it could be useful. It
+ was originally programmed for RKWard.
License: GPL (>= 3)
Encoding: UTF-8
LazyLoad: yes
URL: http://reaktanz.de/?c=hacking&s=XiMpLe
Authors at R: c(person(given="Meik", family="Michalke",
email="meik.michalke at hhu.de", role=c("aut", "cre")))
-Version: 0.03-11
-Date: 2012-03-15
+Version: 0.03-12
+Date: 2012-03-16
Collate:
+ 'XiMpLe-internal.R'
'XiMpLe.node-class.R'
'XiMpLe.doc-class.R'
'node.R'
'parseXMLTree.R'
- 'pasteXMLNode.R'
+ 'pasteXML-methods.R'
'pasteXMLTag.R'
- 'pasteXMLTree.R'
- 'show.XiMpLe.doc.R'
- 'show.XiMpLe.node.R'
- 'XiMpLe-internal.R'
+ 'show-methods.R'
'XiMpLe-internal.roxy.all.R'
'XiMpLe-package.R'
'XMLNode.R'
Modified: trunk/rkward/packages/XiMpLe/NAMESPACE
===================================================================
--- trunk/rkward/packages/XiMpLe/NAMESPACE 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/NAMESPACE 2012-03-17 00:58:13 UTC (rev 4184)
@@ -2,6 +2,7 @@
exportClasses(XiMpLe.node)
exportMethods(node)
exportMethods("node<-")
+exportMethods(pasteXML)
exportMethods(show)
export(parseXMLTree)
export(pasteXMLNode)
Modified: trunk/rkward/packages/XiMpLe/R/XMLTree.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/XMLTree.R 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/R/XMLTree.R 2012-03-17 00:58:13 UTC (rev 4184)
@@ -2,7 +2,6 @@
#'
#' Can be used to create full XML trees.
#'
-#' @param name Character string, the tag name.
#' @param ... Optional children for the XML tree. Must be either objects of class XiMpLe.node or character strings,
#' which are treated as simple text values.
#' @param xml A named list, XML declaration of the XML tree. Currently just pasted, no checking is done.
Modified: trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R 2012-03-17 00:58:13 UTC (rev 4184)
@@ -1,6 +1,5 @@
## internal functions, not exported
-
## function child.list()
# convenience function to let single children be provided without list()
child.list <- function(children){
Modified: trunk/rkward/packages/XiMpLe/R/XiMpLe-package.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/XiMpLe-package.R 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/R/XiMpLe-package.R 2012-03-17 00:58:13 UTC (rev 4184)
@@ -3,8 +3,8 @@
#' \tabular{ll}{
#' Package: \tab XiMpLe\cr
#' Type: \tab Package\cr
-#' Version: \tab 0.03-11\cr
-#' Date: \tab 2012-03-15\cr
+#' Version: \tab 0.03-12\cr
+#' Date: \tab 2012-03-16\cr
#' Depends: \tab R (>= 2.9.0),methods\cr
#' Enhances: \tab rkward\cr
#' Encoding: \tab UTF-8\cr
Modified: trunk/rkward/packages/XiMpLe/R/XiMpLe.node-class.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/XiMpLe.node-class.R 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/R/XiMpLe.node-class.R 2012-03-17 00:58:13 UTC (rev 4184)
@@ -23,6 +23,7 @@
# @keywords classes
#' @noRd
# @rdname XiMpLe.node-class
+#' @include XiMpLe.doc-class.R
# @exportClass XiMpLe.node
#' @export
Modified: trunk/rkward/packages/XiMpLe/R/node.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/node.R 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/R/node.R 2012-03-17 00:58:13 UTC (rev 4184)
@@ -18,8 +18,16 @@
#' elements will be returned.
#' @include XiMpLe.doc-class.R
#' @include XiMpLe.node-class.R
+#' @include XiMpLe-internal.R
#' @import methods
-#' @aliases node,XiMpLe.doc-method node<- node<-,XiMpLe.doc-method
+#' @aliases
+#' node,XiMpLe.doc-method
+#' node,XiMpLe.node-method
+#' node,XiMpLe.XML-method
+#' node<-
+#' node<-,XiMpLe.doc-method
+#' node<-,XiMpLe.node-method
+#' node<-,XiMpLe.XML-method
#' @examples
#' \dontrun{
#' node(my.xml.tree, node=list("html","body"), what="attributes")
Added: trunk/rkward/packages/XiMpLe/R/pasteXML-methods.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/pasteXML-methods.R (rev 0)
+++ trunk/rkward/packages/XiMpLe/R/pasteXML-methods.R 2012-03-17 00:58:13 UTC (rev 4184)
@@ -0,0 +1,136 @@
+#' Paste methods for XiMpLe XML objects
+#'
+#' These methods can be used to paste objects if class \code{\link[XiMpLe:XiMpLe.node]{XiMpLe.node}}
+#' or \code{\link[XiMpLe:XiMpLe.doc]{XiMpLe.doc}}.
+#'
+#' @note The functions pasteXMLNode() and pasteXMLTree() have been replaced by the pasteXML methods.
+#' They should no longer be used.
+#'
+#' @param obj An object of class \code{XiMpLe.node} or \code{XiMpLe.doc}.
+#' @param level Indentation level.
+#' @param shine Integer, controlling if the output should be formatted for better readability. Possible values:
+#' \describe{
+#' \item{0}{No formatting.}
+#' \item{1}{Nodes will be indented.}
+#' \item{2}{Nodes will be indented and each attribute gets a new line.}
+#' }
+#' @param indent.by A charachter string defining how indentation should be done. Defaults to tab.
+#' @param tidy Logical, if \code{TRUE} the special characters "<" and ">" will be replaced with the entities
+#' "<" and "gt;" in attributes and text values.
+#' @aliases
+#' pasteXML,-methods
+#' pasteXML,XiMpLe.doc-method
+#' pasteXMLNode
+#' pasteXMLTree
+#' @seealso \code{\link[XiMpLe:XiMpLe.node-class]{XiMpLe.node}}
+#' \code{\link[XiMpLe:XiMpLe.doc-class]{XiMpLe.doc}}
+#' @keywords methods
+#' @rdname pasteXML-methods
+#' @include XiMpLe.node-class.R
+#' @include XiMpLe.doc-class.R
+#' @exportMethod pasteXML
+setGeneric("pasteXML", function(obj, ...) standardGeneric("pasteXML"))
+
+#' @usage pasteXML(obj, level=1, shine=1, indent.by="\t", tidy=TRUE)
+#' @rdname pasteXML-methods
+#' @aliases
+#' pasteXML,XiMpLe.node-method
+#' @export
+setMethod("pasteXML",
+ signature=signature(obj="XiMpLe.node"),
+ function(obj, level=1, shine=1, indent.by="\t", tidy=TRUE){
+
+ new.indent <- ifelse(shine > 0, indent(level+1, by=indent.by), "")
+ new.node <- ifelse(shine > 0, "\n", "")
+
+ # get the slot contents
+ node.name <- slot(obj, "name")
+ node.attr <- slot(obj, "attributes")
+ node.chld <- slot(obj, "children")
+ node.val <- slot(obj, "value")
+
+ if(!length(node.attr) > 0){
+ node.attr <- NULL
+ } else {}
+
+ if(length(node.chld) > 0){
+ node.chld <- paste(unlist(sapply(node.chld, function(this.node){
+ return(pasteXMLNode(this.node, level=(level + 1), shine=shine, indent.by=indent.by, tidy=tidy))})), collapse="", sep="")
+ node.empty <- FALSE
+ } else {
+ node.chld <- NULL
+ node.empty <- TRUE
+ }
+
+ # take care of text value
+ if(length(node.val) > 0){
+ node.empty <- FALSE
+ if(nchar(node.val) > 0){
+ if(isTRUE(tidy)){
+ node.val <- sapply(node.val, xml.tidy)
+ } else {}
+ node.chld <- paste(node.chld, paste(new.indent, node.val, new.node, collapse=" "), sep="")
+ } else {}
+ } else {}
+
+ pasted.node <- pasteXMLTag(node.name, attr=node.attr, child=node.chld, empty=node.empty, level=level, allow.empty=TRUE, rename=NULL, shine=shine, indent.by=indent.by, tidy=tidy)
+
+ return(pasted.node)
+ }
+)
+#' @usage
+#' # S4 method for objects of class XiMpLe.doc
+#' pasteXML(obj, shine=1, indent.by="\t", tidy=TRUE)
+#' @rdname pasteXML-methods
+#' @export
+setMethod("pasteXML",
+ signature=signature(obj="XiMpLe.doc"),
+ function(obj, shine=1, indent.by="\t", tidy=TRUE){
+
+ filename <- slot(obj, "file")
+ tree.xml <- slot(obj, "xml")
+ tree.doctype <- slot(obj, "dtd")
+ tree.nodes <- slot(obj, "children")
+
+ if(any(nchar(unlist(tree.xml)) > 0)) {
+ doc.xml <- pasteXMLTag("?xml", attr=tree.xml, child=NULL, empty=TRUE, level=1, allow.empty=FALSE, rename=NULL, shine=min(1, shine), indent.by=indent.by, tidy=tidy)
+ doc.xml <- gsub("/>", "\\?>", doc.xml)
+ } else {
+ doc.xml <- ""
+ }
+
+ if(any(nchar(unlist(tree.doctype)) > 0)) {
+ new.node <- ifelse(shine > 0, "\n", "")
+ doc.doctype <- paste("<!DOCTYPE ", paste(tree.doctype[["doctype"]], tree.doctype[["id"]], sep=" "), sep="")
+ if(length(tree.doctype[["refer"]]) > 0) {
+ if(nchar(tree.doctype[["refer"]]) > 0){
+ doc.doctype <- paste(doc.doctype, " \"",tree.doctype[["refer"]], "\"", sep="")
+ } else {}
+ } else {}
+ doc.doctype <- paste(doc.doctype, ">", new.node, sep="")
+ } else {
+ doc.doctype <- ""
+ }
+
+ if(length(tree.nodes) > 0) {
+ doc.nodes <- paste(unlist(sapply(tree.nodes, function(this.node){
+ return(pasteXMLNode(this.node, level=1, shine=shine, indent.by=indent.by, tidy=tidy))})), collapse="", sep="")
+ } else {
+ doc.nodes <- ""
+ }
+
+ doc.all <- paste(doc.xml, doc.doctype, doc.nodes, collapse="", sep="")
+
+ return(doc.all)
+ }
+)
+
+# for compatibility reasons, deploy wrapper functions
+#' @export
+pasteXMLNode <- function(node, level=1, shine=1, indent.by="\t", tidy=TRUE){
+ pasteXML(node, level=level, shine=shine, indent.by=indent.by, tidy=tidy)
+}
+#' @export
+pasteXMLTree <- function(obj, shine=1, indent.by="\t", tidy=TRUE){
+ pasteXML(obj, shine=shine, indent.by=indent.by, tidy=tidy)
+}
Deleted: trunk/rkward/packages/XiMpLe/R/pasteXMLNode.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/pasteXMLNode.R 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/R/pasteXMLNode.R 2012-03-17 00:58:13 UTC (rev 4184)
@@ -1,63 +0,0 @@
-#' Paste an XML node from a XiMpLe.node object
-#'
-#' @param node An object of class \code{XiMpLe.node}.
-#' @param level Indentation level.
-#' @param shine Integer, controlling if the output should be formatted for better readability. Possible values:
-#' \describe{
-#' \item{0}{No formatting.}
-#' \item{1}{Nodes will be indented.}
-#' \item{2}{Nodes will be indented and each attribute gets a new line.}
-#' }
-#' @param indent.by A charachter string defining how indentation should be done. Defaults to tab.
-#' @param tidy Logical, if \code{TRUE} the special characters "<" and ">" will be replaced with the entities
-#' "<" and "gt;" in attributes and text values.
-#' @include XiMpLe.node-class.R
-#' @export
-pasteXMLNode <- function(node, level=1, shine=1, indent.by="\t", tidy=TRUE){
- if(!inherits(node, "XiMpLe.node")){
- if(inherits(node, "XiMpLe.doc")){
- # hand over to pasteXMLTree()
- warning("'node' is of class XiMpLe.doc, called pasteXMLTree() instead.")
- return(pasteXMLTree(obj=node, shine=shine, indent.by=indent.by, tidy=tidy))
- } else {
- stop(simpleError("'node' must be of class XiMpLe.node!"))
- }
- } else {}
-
- new.indent <- ifelse(shine > 0, indent(level+1, by=indent.by), "")
- new.node <- ifelse(shine > 0, "\n", "")
-
- # get the slot contents
- node.name <- slot(node, "name")
- node.attr <- slot(node, "attributes")
- node.chld <- slot(node, "children")
- node.val <- slot(node, "value")
-
- if(!length(node.attr) > 0){
- node.attr <- NULL
- } else {}
-
- if(length(node.chld) > 0){
- node.chld <- paste(unlist(sapply(node.chld, function(this.node){
- return(pasteXMLNode(this.node, level=(level + 1), shine=shine, indent.by=indent.by, tidy=tidy))})), collapse="", sep="")
- node.empty <- FALSE
- } else {
- node.chld <- NULL
- node.empty <- TRUE
- }
-
- # take care of text value
- if(length(node.val) > 0){
- node.empty <- FALSE
- if(nchar(node.val) > 0){
- if(isTRUE(tidy)){
- node.val <- sapply(node.val, xml.tidy)
- } else {}
- node.chld <- paste(node.chld, paste(new.indent, node.val, new.node, collapse=" "), sep="")
- } else {}
- } else {}
-
- pasted.node <- pasteXMLTag(node.name, attr=node.attr, child=node.chld, empty=node.empty, level=level, allow.empty=TRUE, rename=NULL, shine=shine, indent.by=indent.by, tidy=tidy)
-
- return(pasted.node)
-}
Deleted: trunk/rkward/packages/XiMpLe/R/pasteXMLTree.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/pasteXMLTree.R 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/R/pasteXMLTree.R 2012-03-17 00:58:13 UTC (rev 4184)
@@ -1,61 +0,0 @@
-#' Paste an XML tree structure from a XiMpLe.doc object
-#'
-#' @param obj An object of class \code{XiMpLe.doc}.
-#' @param shine Integer, controlling if the output should be formatted for better readability. Possible values:
-#' \describe{
-#' \item{0}{No formatting.}
-#' \item{1}{Nodes will be indented.}
-#' \item{2}{Nodes will be indented and each attribute gets a new line.}
-#' }
-#' @param indent.by A charachter string defining how indentation should be done. Defaults to tab.
-#' @param tidy Logical, if \code{TRUE} the special characters "<" and ">" will be replaced with the entities
-#' "<" and "gt;" in attributes and text values.
-#' @include XiMpLe.doc-class.R
-#' @export
-pasteXMLTree <- function(obj, shine=1, indent.by="\t", tidy=TRUE){
- if(!inherits(obj, "XiMpLe.doc")){
- if(inherits(obj, "XiMpLe.node")){
- # hand over to pasteXMLNode()
- warning("'node' is of class XiMpLe.node, called pasteXMLNode() instead.")
- return(pasteXMLNode(node=obj, shine=shine, indent.by=indent.by, tidy=tidy))
- } else {
- stop(simpleError("'obj' must be of class XiMpLe.doc!"))
- }
- } else {}
-
- filename <- slot(obj, "file")
- tree.xml <- slot(obj, "xml")
- tree.doctype <- slot(obj, "dtd")
- tree.nodes <- slot(obj, "children")
-
- if(any(nchar(unlist(tree.xml)) > 0)) {
- doc.xml <- pasteXMLTag("?xml", attr=tree.xml, child=NULL, empty=TRUE, level=1, allow.empty=FALSE, rename=NULL, shine=min(1, shine), indent.by=indent.by, tidy=tidy)
- doc.xml <- gsub("/>", "\\?>", doc.xml)
- } else {
- doc.xml <- ""
- }
-
- if(any(nchar(unlist(tree.doctype)) > 0)) {
- new.node <- ifelse(shine > 0, "\n", "")
- doc.doctype <- paste("<!DOCTYPE ", paste(tree.doctype[["doctype"]], tree.doctype[["id"]], sep=" "), sep="")
- if(length(tree.doctype[["refer"]]) > 0) {
- if(nchar(tree.doctype[["refer"]]) > 0){
- doc.doctype <- paste(doc.doctype, " \"",tree.doctype[["refer"]], "\"", sep="")
- } else {}
- } else {}
- doc.doctype <- paste(doc.doctype, ">", new.node, sep="")
- } else {
- doc.doctype <- ""
- }
-
- if(length(tree.nodes) > 0) {
- doc.nodes <- paste(unlist(sapply(tree.nodes, function(this.node){
- return(pasteXMLNode(this.node, level=1, shine=shine, indent.by=indent.by, tidy=tidy))})), collapse="", sep="")
- } else {
- doc.nodes <- ""
- }
-
- doc.all <- paste(doc.xml, doc.doctype, doc.nodes, collapse="", sep="")
-
- return(doc.all)
-}
Added: trunk/rkward/packages/XiMpLe/R/show-methods.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/show-methods.R (rev 0)
+++ trunk/rkward/packages/XiMpLe/R/show-methods.R 2012-03-17 00:58:13 UTC (rev 4184)
@@ -0,0 +1,25 @@
+#' Shows method for S4 objects of XiMpLe XML classes
+#'
+#' Used to display objects of class \code{\link[XiMpLe:XiMpLe.doc-class]{XiMpLe.doc}}
+#' and \code{\link[XiMpLe:XiMpLe.node-class]{XiMpLe.node}}
+#'
+#' @param object An object of class \code{XiMpLe.doc} or \code{XiMpLe.node}
+#' @aliases
+#' show,-methods
+#' show,XiMpLe.doc-method
+#' show,XiMpLe.node-method
+#' show,XiMpLe.XML-method
+#' @seealso
+#' \code{\link[XiMpLe:XiMpLe.doc-class]{XiMpLe.doc}}
+#' \code{\link[XiMpLe:XiMpLe.node-class]{XiMpLe.node}}
+#' @keywords methods
+#' @exportMethod show
+#' @rdname show-methods
+setGeneric("show")
+
+#' @rdname show-methods
+#' @include XiMpLe.node-class.R
+#' @include XiMpLe.doc-class.R
+setMethod("show", signature(object="XiMpLe.XML"), function(object){
+ cat(pasteXML(object))
+})
Deleted: trunk/rkward/packages/XiMpLe/R/show.XiMpLe.doc.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/show.XiMpLe.doc.R 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/R/show.XiMpLe.doc.R 2012-03-17 00:58:13 UTC (rev 4184)
@@ -1,15 +0,0 @@
-#' Show method for S4 objects of class \code{\link[XiMpLe:XiMpLe.doc-class]{XiMpLe.doc}}
-#'
-#' @title Show method for objects of class XiMpLe.doc
-#' @param object An object of class \code{XiMpLe.doc}
-#' @aliases show,-methods show,XiMpLe.doc-method
-#' @seealso \code{\link[XiMpLe:XiMpLe.doc-class]{XiMpLe.doc}}
-#' @keywords methods
-#' @exportMethod show
-#' @rdname show-methods
-setGeneric("show")
-
-#' @rdname show-methods
-setMethod("show", signature(object="XiMpLe.doc"), function(object){
- cat(pasteXMLTree(object))
-})
Deleted: trunk/rkward/packages/XiMpLe/R/show.XiMpLe.node.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/show.XiMpLe.node.R 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/R/show.XiMpLe.node.R 2012-03-17 00:58:13 UTC (rev 4184)
@@ -1,15 +0,0 @@
-#' Show method for S4 objects of class \code{\link[XiMpLe:XiMpLe.node-class]{XiMpLe.node}}
-#'
-#' @title Show method for objects of class XiMpLe.node
-#' @param object An object of class \code{XiMpLe.node}
-#' @aliases show,-methods show,XiMpLe.node-method
-#' @seealso \code{\link[XiMpLe:XiMpLe.node-class]{XiMpLe.node}}
-#' @keywords methods
-#' @exportMethod show
-#' @rdname show-methods
-setGeneric("show")
-
-#' @rdname show-methods
-setMethod("show", signature(object="XiMpLe.node"), function(object){
- cat(pasteXMLNode(object))
-})
Modified: trunk/rkward/packages/XiMpLe/inst/CITATION
===================================================================
--- trunk/rkward/packages/XiMpLe/inst/CITATION 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/inst/CITATION 2012-03-17 00:58:13 UTC (rev 4184)
@@ -2,12 +2,12 @@
title="XiMpLe: A simple XML tree parser and generator",
author="Meik Michalke",
year="2012",
- note="(Version 0.03-11)",
+ note="(Version 0.03-12)",
url="http://reaktanz.de/?c=hacking&s=XiMpLe",
textVersion =
paste("Michalke, M. (2012). ",
- "XiMpLe: A simple XML tree parser and generator (Version 0.03-11). ",
+ "XiMpLe: A simple XML tree parser and generator (Version 0.03-12). ",
"Available from http://reaktanz.de/?c=hacking&s=XiMpLe",
sep=""),
Modified: trunk/rkward/packages/XiMpLe/inst/NEWS.Rd
===================================================================
--- trunk/rkward/packages/XiMpLe/inst/NEWS.Rd 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/inst/NEWS.Rd 2012-03-17 00:58:13 UTC (rev 4184)
@@ -1,10 +1,13 @@
\name{NEWS}
\title{News for Package 'XiMpLe'}
\encoding{UTF-8}
-\section{Changes in XiMpLe version 0.03-12 (2012-03-15)}{
+\section{Changes in XiMpLe version 0.03-12 (2012-03-16)}{
\itemize{
\item \code{node()} now also works with single XiMpLe.node objects (not only full trees)
- \item fixed dropped text value if node also had child nodes in \code{pasteXMLNode()}
+ \item added pasteXML methods to paste objects of classes XiMpLe.node and XiMpLe.doc in a more
+ general manner. the former functions \code{pasteXMLNode()} and \code{pasteXMLTree()} are replaced by mere
+ wrapper frunctions to \code{pasteXML()} and should not be used any longer.
+ \item fixed dropped text value if node also had child nodes in \code{pasteXML()}
}
}
\section{Changes in XiMpLe version 0.03-11 (2012-03-14)}{
Modified: trunk/rkward/packages/XiMpLe/man/XMLTree.Rd
===================================================================
--- trunk/rkward/packages/XiMpLe/man/XMLTree.Rd 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/man/XMLTree.Rd 2012-03-17 00:58:13 UTC (rev 4184)
@@ -6,8 +6,6 @@
.children = list(...))
}
\arguments{
- \item{name}{Character string, the tag name.}
-
\item{...}{Optional children for the XML tree. Must be
either objects of class XiMpLe.node or character strings,
which are treated as simple text values.}
Modified: trunk/rkward/packages/XiMpLe/man/XiMpLe-package.Rd
===================================================================
--- trunk/rkward/packages/XiMpLe/man/XiMpLe-package.Rd 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/man/XiMpLe-package.Rd 2012-03-17 00:58:13 UTC (rev 4184)
@@ -8,8 +8,8 @@
}
\details{
\tabular{ll}{ Package: \tab XiMpLe\cr Type: \tab
- Package\cr Version: \tab 0.03-11\cr Date: \tab
- 2012-03-15\cr Depends: \tab R (>= 2.9.0),methods\cr
+ Package\cr Version: \tab 0.03-12\cr Date: \tab
+ 2012-03-16\cr Depends: \tab R (>= 2.9.0),methods\cr
Enhances: \tab rkward\cr Encoding: \tab UTF-8\cr License:
\tab GPL (>= 3)\cr LazyLoad: \tab yes\cr URL: \tab
http://reaktanz.de/?c=hacking&s=XiMpLe\cr }
Modified: trunk/rkward/packages/XiMpLe/man/node.Rd
===================================================================
--- trunk/rkward/packages/XiMpLe/man/node.Rd 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/man/node.Rd 2012-03-17 00:58:13 UTC (rev 4184)
@@ -3,6 +3,10 @@
\alias{node<-}
\alias{node<-,XiMpLe.doc-method}
\alias{node,XiMpLe.doc-method}
+\alias{node<-,XiMpLe.node-method}
+\alias{node,XiMpLe.node-method}
+\alias{node<-,XiMpLe.XML-method}
+\alias{node,XiMpLe.XML-method}
\title{Extract/manipulate a node or parts of it from an XML tree}
\arguments{
\item{obj}{An object of class \code{XiMpLe.doc} or
Added: trunk/rkward/packages/XiMpLe/man/pasteXML-methods.Rd
===================================================================
--- trunk/rkward/packages/XiMpLe/man/pasteXML-methods.Rd (rev 0)
+++ trunk/rkward/packages/XiMpLe/man/pasteXML-methods.Rd 2012-03-17 00:58:13 UTC (rev 4184)
@@ -0,0 +1,43 @@
+\name{pasteXML}
+\alias{pasteXML}
+\alias{pasteXML,-methods}
+\alias{pasteXMLNode}
+\alias{pasteXMLTree}
+\alias{pasteXML,XiMpLe.doc-method}
+\alias{pasteXML,XiMpLe.node-method}
+\title{Paste methods for XiMpLe XML objects}
+\arguments{
+ \item{obj}{An object of class \code{XiMpLe.node} or
+ \code{XiMpLe.doc}.}
+
+ \item{level}{Indentation level.}
+
+ \item{shine}{Integer, controlling if the output should be
+ formatted for better readability. Possible values:
+ \describe{ \item{0}{No formatting.} \item{1}{Nodes will
+ be indented.} \item{2}{Nodes will be indented and each
+ attribute gets a new line.} }}
+
+ \item{indent.by}{A charachter string defining how
+ indentation should be done. Defaults to tab.}
+
+ \item{tidy}{Logical, if \code{TRUE} the special
+ characters "<" and ">" will be replaced with the entities
+ "<" and "gt;" in attributes and text values.}
+}
+\description{
+ These methods can be used to paste objects if class
+ \code{\link[XiMpLe:XiMpLe.node]{XiMpLe.node}} or
+ \code{\link[XiMpLe:XiMpLe.doc]{XiMpLe.doc}}.
+}
+\note{
+ The functions pasteXMLNode() and pasteXMLTree() have been
+ replaced by the pasteXML methods. They should no longer
+ be used.
+}
+\seealso{
+ \code{\link[XiMpLe:XiMpLe.node-class]{XiMpLe.node}}
+ \code{\link[XiMpLe:XiMpLe.doc-class]{XiMpLe.doc}}
+}
+\keyword{methods}
+
Deleted: trunk/rkward/packages/XiMpLe/man/pasteXMLNode.Rd
===================================================================
--- trunk/rkward/packages/XiMpLe/man/pasteXMLNode.Rd 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/man/pasteXMLNode.Rd 2012-03-17 00:58:13 UTC (rev 4184)
@@ -1,29 +0,0 @@
-\name{pasteXMLNode}
-\alias{pasteXMLNode}
-\title{Paste an XML node from a XiMpLe.node object}
-\usage{
- pasteXMLNode(node, level = 1, shine = 1,
- indent.by = "\t", tidy = TRUE)
-}
-\arguments{
- \item{node}{An object of class \code{XiMpLe.node}.}
-
- \item{level}{Indentation level.}
-
- \item{shine}{Integer, controlling if the output should be
- formatted for better readability. Possible values:
- \describe{ \item{0}{No formatting.} \item{1}{Nodes will
- be indented.} \item{2}{Nodes will be indented and each
- attribute gets a new line.} }}
-
- \item{indent.by}{A charachter string defining how
- indentation should be done. Defaults to tab.}
-
- \item{tidy}{Logical, if \code{TRUE} the special
- characters "<" and ">" will be replaced with the entities
- "<" and "gt;" in attributes and text values.}
-}
-\description{
- Paste an XML node from a XiMpLe.node object
-}
-
Deleted: trunk/rkward/packages/XiMpLe/man/pasteXMLTree.Rd
===================================================================
--- trunk/rkward/packages/XiMpLe/man/pasteXMLTree.Rd 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/man/pasteXMLTree.Rd 2012-03-17 00:58:13 UTC (rev 4184)
@@ -1,27 +0,0 @@
-\name{pasteXMLTree}
-\alias{pasteXMLTree}
-\title{Paste an XML tree structure from a XiMpLe.doc object}
-\usage{
- pasteXMLTree(obj, shine = 1, indent.by = "\t",
- tidy = TRUE)
-}
-\arguments{
- \item{obj}{An object of class \code{XiMpLe.doc}.}
-
- \item{shine}{Integer, controlling if the output should be
- formatted for better readability. Possible values:
- \describe{ \item{0}{No formatting.} \item{1}{Nodes will
- be indented.} \item{2}{Nodes will be indented and each
- attribute gets a new line.} }}
-
- \item{indent.by}{A charachter string defining how
- indentation should be done. Defaults to tab.}
-
- \item{tidy}{Logical, if \code{TRUE} the special
- characters "<" and ">" will be replaced with the entities
- "<" and "gt;" in attributes and text values.}
-}
-\description{
- Paste an XML tree structure from a XiMpLe.doc object
-}
-
Modified: trunk/rkward/packages/XiMpLe/man/show-methods.Rd
===================================================================
--- trunk/rkward/packages/XiMpLe/man/show-methods.Rd 2012-03-15 16:41:00 UTC (rev 4183)
+++ trunk/rkward/packages/XiMpLe/man/show-methods.Rd 2012-03-17 00:58:13 UTC (rev 4184)
@@ -3,22 +3,19 @@
\alias{show,-methods}
\alias{show,XiMpLe.doc-method}
\alias{show,XiMpLe.node-method}
-\title{Show method for objects of class XiMpLe.doc}
+\alias{show,XiMpLe.XML-method}
+\title{Shows method for S4 objects of XiMpLe XML classes}
\arguments{
- \item{object}{An object of class \code{XiMpLe.doc}}
-
- \item{object}{An object of class \code{XiMpLe.node}}
+ \item{object}{An object of class \code{XiMpLe.doc} or
+ \code{XiMpLe.node}}
}
\description{
- Show method for S4 objects of class
- \code{\link[XiMpLe:XiMpLe.doc-class]{XiMpLe.doc}}
-
- Show method for S4 objects of class
+ Used to display objects of class
+ \code{\link[XiMpLe:XiMpLe.doc-class]{XiMpLe.doc}} and
\code{\link[XiMpLe:XiMpLe.node-class]{XiMpLe.node}}
}
\seealso{
\code{\link[XiMpLe:XiMpLe.doc-class]{XiMpLe.doc}}
-
\code{\link[XiMpLe:XiMpLe.node-class]{XiMpLe.node}}
}
\keyword{methods}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list