[rkward] packages/XiMpLe: fixed XMLScanDeep()

m.eik michalke meik.michalke at uni-duesseldorf.de
Sun Oct 11 17:24:25 UTC 2015


Git commit 64dc858cba88a2d4dc24db07466b521b0b14c06d by m.eik michalke.
Committed on 11/10/2015 at 17:01.
Pushed by meikm into branch 'master'.

fixed XMLScanDeep()

  - XMLScanDeep() was hardwired to examine attributes, it now also checks node names and values

M  +7    -1    packages/XiMpLe/ChangeLog
M  +8    -11   packages/XiMpLe/DESCRIPTION
M  +1    -1    packages/XiMpLe/NAMESPACE
M  +5    -6    packages/XiMpLe/R/XiMpLe-package.R
M  +22   -7    packages/XiMpLe/R/zzz_is_get_utils.R
M  +4    -4    packages/XiMpLe/inst/CITATION
M  +13   -1    packages/XiMpLe/inst/NEWS.Rd
M  +-    --    packages/XiMpLe/inst/doc/XiMpLe_vignette.pdf
M  +3    -2    packages/XiMpLe/man/XMLGetters-methods.Rd
M  +2    -1    packages/XiMpLe/man/XMLNode.Rd
M  +2    -1    packages/XiMpLe/man/XMLTree.Rd
M  +8    -7    packages/XiMpLe/man/XiMpLe-package.Rd
M  +2    -1    packages/XiMpLe/man/node.Rd
M  +2    -1    packages/XiMpLe/man/parseXMLTree.Rd
M  +2    -1    packages/XiMpLe/man/pasteXML-methods.Rd
M  +2    -1    packages/XiMpLe/man/pasteXMLTag.Rd
M  +2    -1    packages/XiMpLe/man/show-methods.Rd

http://commits.kde.org/rkward/64dc858cba88a2d4dc24db07466b521b0b14c06d

diff --git a/packages/XiMpLe/ChangeLog b/packages/XiMpLe/ChangeLog
index 8fb844e..e846f75 100644
--- a/packages/XiMpLe/ChangeLog
+++ b/packages/XiMpLe/ChangeLog
@@ -1,8 +1,14 @@
 ChangeLog for package XiMpLe
 
-changes in version 0.03-23 (2014-12-14)
+changes in version 0.03-23 (2015-10-11)
+unreleased:
+  - this release is under development
 changed:
   - relocated the unit tests to tests/testthat
+fixed:
+  - XMLScanDeep() was said to examine node names, children and values as well
+    as attributes, but in fact it was hard-wired on attributes only. removed
+    children from the list and added support for names and values
 
 changes in version 0.03-22 (2014-12-02)
 fixed:
diff --git a/packages/XiMpLe/DESCRIPTION b/packages/XiMpLe/DESCRIPTION
index 5e62a1b..fe23647 100644
--- a/packages/XiMpLe/DESCRIPTION
+++ b/packages/XiMpLe/DESCRIPTION
@@ -1,28 +1,25 @@
 Package: XiMpLe
 Type: Package
-Title: A simple XML tree parser and generator
-Author: Meik Michalke
+Title: A Simple XML Tree Parser and Generator
+Author: Meik Michalke [aut, cre]
 Maintainer: Meik Michalke <meik.michalke at hhu.de>
 Depends:
     R (>= 2.9.0),methods
 Suggests:
     testthat
-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 the R GUI and IDE
-    RKWard, to make plugin development easier. You can install RKWard from
-    http://rkward.kde.org.
+    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 developed for the R GUI and IDE RKWard (https://
+    rkward.kde.org), to make plugin development easier.
 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")))
+Authors at R: c(person(given="Meik", family="Michalke", email="meik.michalke at hhu.de", role=c("aut", "cre")))
 Version: 0.03-23
-Date: 2014-12-14
+Date: 2015-10-11
 Collate:
     '00_class_01_XiMpLe.node.R'
     '00_class_02_XiMpLe.doc.R'
diff --git a/packages/XiMpLe/NAMESPACE b/packages/XiMpLe/NAMESPACE
index 39cd99c..464dff6 100644
--- a/packages/XiMpLe/NAMESPACE
+++ b/packages/XiMpLe/NAMESPACE
@@ -1,4 +1,4 @@
-# Generated by roxygen2 (4.0.2): do not edit by hand
+# Generated by roxygen2 (4.1.1): do not edit by hand
 
 export("XMLAttrs<-")
 export("XMLChildren<-")
diff --git a/packages/XiMpLe/R/XiMpLe-package.R b/packages/XiMpLe/R/XiMpLe-package.R
index 6a328f1..b1bc495 100644
--- a/packages/XiMpLe/R/XiMpLe-package.R
+++ b/packages/XiMpLe/R/XiMpLe-package.R
@@ -1,12 +1,11 @@
-#' A simple XML tree parser and generator.
+#' A Simple XML Tree Parser and Generator.
 #'
 #' \tabular{ll}{
 #' Package: \tab XiMpLe\cr
 #' Type: \tab Package\cr
 #' Version: \tab 0.03-23\cr
-#' Date: \tab 2014-12-14\cr
+#' Date: \tab 2015-10-11\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
@@ -15,9 +14,9 @@
 #'
 #' 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 the R GUI and IDE RKWard, to make plugin
-#' development easier. You can install RKWard from http://rkward.kde.org.
+#' 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 developed for the R GUI and IDE RKWard (https://rkward.kde.org), to make plugin
+#' development easier.
 #'
 #' @aliases XiMpLe-package
 #' @name XiMpLe-package
diff --git a/packages/XiMpLe/R/zzz_is_get_utils.R b/packages/XiMpLe/R/zzz_is_get_utils.R
index d9f09a6..c7e8f1d 100644
--- a/packages/XiMpLe/R/zzz_is_get_utils.R
+++ b/packages/XiMpLe/R/zzz_is_get_utils.R
@@ -504,7 +504,7 @@ setMethod("XMLScan<-",
 
 #' @param find Character, name of element to scan for.
 #' @param search Character, name of the slot to scan, one of \code{"attributes"},
-#'    \code{"name"}, \code{"children"}, or \code{"value"} for nodes.
+#'    \code{"name"}, or \code{"value"} for nodes.
 #' @rdname XMLGetters-methods
 #' @docType methods
 #' @export
@@ -517,13 +517,28 @@ recursiveScan <- function(robj, rfind, rsearch, recResult=list(), result, envID=
       recursiveScan(robj=this.child, rfind=rfind, rsearch=rsearch, recResult=recResult, result=result, envID=envID)
     }))
   } else if(is.XiMpLe.node(robj)){
-    attrs <- XMLAttrs(robj)[[rfind]]
-    if(!is.null(attrs)){
-      attrResult <- as.list(result)
+    foundThis <- NULL
+    if(identical(rsearch, "attributes")){
+      foundThis <- XMLAttrs(robj)[[rfind]]
+    } else if(identical(rsearch, "name")){
+      objName <- XMLName(robj)
+      if(identical(objName, rfind)){
+        foundThis <- objName
+      } else {}
+    } else if(identical(rsearch, "value")){
+      objValue <- XMLValue(robj)
+      if(identical(objValue, rfind)){
+        foundThis <- objValue
+      } else {}
+    } else {
+      stop(simpleError("Only \"attributes\", \"name\" or \"value\" are valid for search!"))
+    }
+    if(!is.null(foundThis)){
+      thisResult <- as.list(result)
       nodeName <- XMLName(robj)
-      attrResult[[envID]] <- append(attrResult[[envID]], attrs)
-      names(attrResult[[envID]])[length(attrResult[[envID]])] <- nodeName
-      list2env(attrResult, envir=result)
+      thisResult[[envID]] <- append(thisResult[[envID]], foundThis)
+      names(thisResult[[envID]])[length(thisResult[[envID]])] <- nodeName
+      list2env(thisResult, envir=result)
     } else {}
     recResult <- append(recResult, lapply(robj at children, function(this.child){
       recursiveScan(robj=this.child, rfind=rfind, rsearch=rsearch, recResult=recResult, result=result, envID=envID)
diff --git a/packages/XiMpLe/inst/CITATION b/packages/XiMpLe/inst/CITATION
index 3f048fa..5e16018 100644
--- a/packages/XiMpLe/inst/CITATION
+++ b/packages/XiMpLe/inst/CITATION
@@ -1,13 +1,13 @@
 bibentry("Manual",
-    title="XiMpLe: A simple XML tree parser and generator",
+    title="XiMpLe: A Simple XML Tree Parser and Generator",
     author="Meik Michalke",
-    year="2014",
+    year="2015",
     note="(Version 0.03-23)",
     url="http://reaktanz.de/?c=hacking&s=XiMpLe",
 
     textVersion =
-    paste("Michalke, M. (2014). ",
-        "XiMpLe: A simple XML tree parser and generator (Version 0.03-23). ",
+    paste("Michalke, M. (2015). ",
+        "XiMpLe: A Simple XML Tree Parser and Generator (Version 0.03-23). ",
         "Available from http://reaktanz.de/?c=hacking&s=XiMpLe",
         sep=""),
 
diff --git a/packages/XiMpLe/inst/NEWS.Rd b/packages/XiMpLe/inst/NEWS.Rd
index c7b76b2..f615ba6 100644
--- a/packages/XiMpLe/inst/NEWS.Rd
+++ b/packages/XiMpLe/inst/NEWS.Rd
@@ -1,12 +1,24 @@
 \name{NEWS}
 \title{News for Package 'XiMpLe'}
 \encoding{UTF-8}
-\section{Changes in XiMpLe version 0.03-23 (2014-12-14)}{
+\section{Changes in XiMpLe version 0.03-23 (2015-10-11)}{
+  \subsection{unreleased}{
+    \itemize{
+      \item this release is under development
+    }
+  }
   \subsection{changed}{
     \itemize{
       \item relocated the unit tests to tests/testthat
     }
   }
+  \subsection{fixed}{
+    \itemize{
+      \item \code{XMLScanDeep()} was said to examine node names, children and values as well
+        as attributes, but in fact it was hard-wired on attributes only. removed
+        children from the list and added support for names and values
+    }
+  }
 }
 \section{Changes in XiMpLe version 0.03-22 (2014-12-02)}{
   \subsection{fixed}{
diff --git a/packages/XiMpLe/inst/doc/XiMpLe_vignette.pdf b/packages/XiMpLe/inst/doc/XiMpLe_vignette.pdf
index 0cb8d60..95a1208 100644
Binary files a/packages/XiMpLe/inst/doc/XiMpLe_vignette.pdf and b/packages/XiMpLe/inst/doc/XiMpLe_vignette.pdf differ
diff --git a/packages/XiMpLe/man/XMLGetters-methods.Rd b/packages/XiMpLe/man/XMLGetters-methods.Rd
index 633f3e9..12187d2 100644
--- a/packages/XiMpLe/man/XMLGetters-methods.Rd
+++ b/packages/XiMpLe/man/XMLGetters-methods.Rd
@@ -1,4 +1,5 @@
-% Generated by roxygen2 (4.0.2): do not edit by hand
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/zzz_is_get_utils.R
 \docType{methods}
 \name{XMLName}
 \alias{XMLAttrs}
@@ -151,7 +152,7 @@ it will be returned as as single \code{XiMpLe.node}.}
 \item{find}{Character, name of element to scan for.}
 
 \item{search}{Character, name of the slot to scan, one of \code{"attributes"},
-\code{"name"}, \code{"children"}, or \code{"value"} for nodes.}
+\code{"name"}, or \code{"value"} for nodes.}
 }
 \description{
 Used to get/set certain slots from objects of class \code{\link[XiMpLe:XiMpLe.doc-class]{XiMpLe.doc}}
diff --git a/packages/XiMpLe/man/XMLNode.Rd b/packages/XiMpLe/man/XMLNode.Rd
index 27302f9..9e3aee4 100644
--- a/packages/XiMpLe/man/XMLNode.Rd
+++ b/packages/XiMpLe/man/XMLNode.Rd
@@ -1,4 +1,5 @@
-% Generated by roxygen2 (4.0.2): do not edit by hand
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/XMLNode.R, R/zzz_is_get_utils.R
 \name{XMLNode}
 \alias{XMLNode}
 \alias{is.XiMpLe.node}
diff --git a/packages/XiMpLe/man/XMLTree.Rd b/packages/XiMpLe/man/XMLTree.Rd
index 118348f..bb650b3 100644
--- a/packages/XiMpLe/man/XMLTree.Rd
+++ b/packages/XiMpLe/man/XMLTree.Rd
@@ -1,4 +1,5 @@
-% Generated by roxygen2 (4.0.2): do not edit by hand
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/XMLTree.R, R/zzz_is_get_utils.R
 \name{XMLTree}
 \alias{XMLTree}
 \alias{is.XiMpLe.doc}
diff --git a/packages/XiMpLe/man/XiMpLe-package.Rd b/packages/XiMpLe/man/XiMpLe-package.Rd
index 1027949..93885db 100644
--- a/packages/XiMpLe/man/XiMpLe-package.Rd
+++ b/packages/XiMpLe/man/XiMpLe-package.Rd
@@ -1,19 +1,19 @@
-% Generated by roxygen2 (4.0.2): do not edit by hand
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/XiMpLe-package.R
 \docType{package}
 \name{XiMpLe-package}
 \alias{XiMpLe-package}
 \title{The XiMpLe Package}
 \description{
-A simple XML tree parser and generator.
+A Simple XML Tree Parser and Generator.
 }
 \details{
 \tabular{ll}{
 Package: \tab XiMpLe\cr
 Type: \tab Package\cr
 Version: \tab 0.03-23\cr
-Date: \tab 2014-12-14\cr
+Date: \tab 2015-10-11\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
@@ -22,10 +22,11 @@ URL: \tab http://reaktanz.de/?c=hacking&s=XiMpLe\cr
 
 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 the R GUI and IDE RKWard,
+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 developed for the R GUI and IDE RKWard (https://rkward.kde.org),
       to make plugin
-development easier. You can install RKWard from http://rkward.kde.org.
+development easier.
 }
 \author{
 Meik Michalke
diff --git a/packages/XiMpLe/man/node.Rd b/packages/XiMpLe/man/node.Rd
index 663a81f..fe50966 100644
--- a/packages/XiMpLe/man/node.Rd
+++ b/packages/XiMpLe/man/node.Rd
@@ -1,4 +1,5 @@
-% Generated by roxygen2 (4.0.2): do not edit by hand
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/01_method_02_node.R
 \docType{methods}
 \name{node}
 \alias{node}
diff --git a/packages/XiMpLe/man/parseXMLTree.Rd b/packages/XiMpLe/man/parseXMLTree.Rd
index 8dd5a1a..1e7cd97 100644
--- a/packages/XiMpLe/man/parseXMLTree.Rd
+++ b/packages/XiMpLe/man/parseXMLTree.Rd
@@ -1,4 +1,5 @@
-% Generated by roxygen2 (4.0.2): do not edit by hand
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/parseXMLTree.R
 \name{parseXMLTree}
 \alias{parseXMLTree}
 \title{Read an XML file into an R object}
diff --git a/packages/XiMpLe/man/pasteXML-methods.Rd b/packages/XiMpLe/man/pasteXML-methods.Rd
index 019f1b8..b9f5426 100644
--- a/packages/XiMpLe/man/pasteXML-methods.Rd
+++ b/packages/XiMpLe/man/pasteXML-methods.Rd
@@ -1,4 +1,5 @@
-% Generated by roxygen2 (4.0.2): do not edit by hand
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/01_method_01_pasteXML.R
 \docType{methods}
 \name{pasteXML}
 \alias{pasteXML}
diff --git a/packages/XiMpLe/man/pasteXMLTag.Rd b/packages/XiMpLe/man/pasteXMLTag.Rd
index ee02dac..15c07e8 100644
--- a/packages/XiMpLe/man/pasteXMLTag.Rd
+++ b/packages/XiMpLe/man/pasteXMLTag.Rd
@@ -1,4 +1,5 @@
-% Generated by roxygen2 (4.0.2): do not edit by hand
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/pasteXMLTag.R
 \name{pasteXMLTag}
 \alias{pasteXMLTag}
 \title{Write an XML tag}
diff --git a/packages/XiMpLe/man/show-methods.Rd b/packages/XiMpLe/man/show-methods.Rd
index d3a7275..0f116c0 100644
--- a/packages/XiMpLe/man/show-methods.Rd
+++ b/packages/XiMpLe/man/show-methods.Rd
@@ -1,4 +1,5 @@
-% Generated by roxygen2 (4.0.2): do not edit by hand
+% Generated by roxygen2 (4.1.1): do not edit by hand
+% Please edit documentation in R/01_method_03_show.R
 \docType{methods}
 \name{show,XiMpLe.XML-method}
 \alias{show,-methods}



More information about the rkward-tracker mailing list