[rkward-cvs] SF.net SVN: rkward:[3902] trunk/rkward/packages/XiMpLe
m-eik at users.sourceforge.net
m-eik at users.sourceforge.net
Fri Oct 7 20:03:59 UTC 2011
Revision: 3902
http://rkward.svn.sourceforge.net/rkward/?rev=3902&view=rev
Author: m-eik
Date: 2011-10-07 20:03:58 +0000 (Fri, 07 Oct 2011)
Log Message:
-----------
XiMpLe: fixed small XML tree parsing bug
Modified Paths:
--------------
trunk/rkward/packages/XiMpLe/ChangeLog
trunk/rkward/packages/XiMpLe/DESCRIPTION
trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R
trunk/rkward/packages/XiMpLe/R/XiMpLe-package.R
trunk/rkward/packages/XiMpLe/inst/CITATION
trunk/rkward/packages/XiMpLe/man/XiMpLe-package.Rd
Modified: trunk/rkward/packages/XiMpLe/ChangeLog
===================================================================
--- trunk/rkward/packages/XiMpLe/ChangeLog 2011-10-07 19:38:33 UTC (rev 3901)
+++ trunk/rkward/packages/XiMpLe/ChangeLog 2011-10-07 20:03:58 UTC (rev 3902)
@@ -1,5 +1,9 @@
ChangeLog for package XiMpLe
+## 0.03-5 (2011-10-07)
+ - fixed tree parsing bug (in rare cases, comment and CDATA entries caused parsing to choke on
+ empty lines)
+
## 0.03-4 (2011-10-01)
- added show methods for objects of class XiMpLe.doc and XiMpLe.node
Modified: trunk/rkward/packages/XiMpLe/DESCRIPTION
===================================================================
--- trunk/rkward/packages/XiMpLe/DESCRIPTION 2011-10-07 19:38:33 UTC (rev 3901)
+++ trunk/rkward/packages/XiMpLe/DESCRIPTION 2011-10-07 20:03:58 UTC (rev 3902)
@@ -19,8 +19,8 @@
URL: http://rkward.sourceforge.net
Authors at R: c(person(given="Meik", family="Michalke",
email="meik.michalke at hhu.de", role=c("aut", "cre")))
-Version: 0.03-4
-Date: 2011-10-01
+Version: 0.03-5
+Date: 2011-10-07
Collate:
'XiMpLe.node-class.R'
'XiMpLe.doc-class.R'
Modified: trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R 2011-10-07 19:38:33 UTC (rev 3901)
+++ trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R 2011-10-07 20:03:58 UTC (rev 3902)
@@ -31,12 +31,12 @@
ifelse(is.null(treat.this), next, TRUE)
# steps are as follows, to be sure:
# - cut stream at beginning CDATA/comment entries
- cut.trees <- unlist(strsplit(tree, split=treat.this[["split.start"]]))
+ cut.trees <- trim(unlist(strsplit(tree, split=treat.this[["split.start"]])))
# - re-add the cut-off CDATA/comment start
got.cut <- grep(treat.this[["split.end"]], cut.trees)
cut.trees[got.cut] <- paste(treat.this[["prefix"]], cut.trees[got.cut], sep="")
# - cut stream at ending CDATA/comment entries
- cut.trees <- unlist(strsplit(cut.trees, split=treat.this[["split.end"]]))
+ cut.trees <- trim(unlist(strsplit(cut.trees, split=treat.this[["split.end"]])))
# - re-add the cut-off CDATA/comment ending
got.cut <- grep(treat.this[["split.start"]], cut.trees)
cut.trees[got.cut] <- paste(cut.trees[got.cut], treat.this[["suffix"]], sep="")
@@ -51,7 +51,7 @@
} else {
split.me <- TRUE
}
- if(isTRUE(split.me)){
+ if(isTRUE(split.me) & grepl("(.*)<(.*)>(.*)", this.tree)){
return(paste(unlist(strsplit(trim(this.tree), split=">[[:space:]]*")), ">", sep=""))
} else {
return(this.tree)
@@ -60,6 +60,7 @@
} else {
single.tags <- paste(unlist(strsplit(tree, split=">[[:space:]]*")), ">", sep="")
}
+ names(single.tags) <- NULL
# if there's values between tags, they do now precede them
has.value <- grepl("^[^<]", single.tags)
if(any(has.value)){
Modified: trunk/rkward/packages/XiMpLe/R/XiMpLe-package.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/XiMpLe-package.R 2011-10-07 19:38:33 UTC (rev 3901)
+++ trunk/rkward/packages/XiMpLe/R/XiMpLe-package.R 2011-10-07 20:03:58 UTC (rev 3902)
@@ -3,8 +3,8 @@
#' \tabular{ll}{
#' Package: \tab XiMpLe\cr
#' Type: \tab Package\cr
-#' Version: \tab 0.03-4\cr
-#' Date: \tab 2011-10-01\cr
+#' Version: \tab 0.03-5\cr
+#' Date: \tab 2011-10-07\cr
#' Depends: \tab R (>= 2.9.0),methods\cr
#' Enhances: \tab rkward\cr
#' Encoding: \tab UTF-8\cr
Modified: trunk/rkward/packages/XiMpLe/inst/CITATION
===================================================================
--- trunk/rkward/packages/XiMpLe/inst/CITATION 2011-10-07 19:38:33 UTC (rev 3901)
+++ trunk/rkward/packages/XiMpLe/inst/CITATION 2011-10-07 20:03:58 UTC (rev 3902)
@@ -2,12 +2,12 @@
title="XiMpLe: A simple XML tree parser and generator",
author="Meik Michalke",
year="2011",
- note="(Version 0.03-4)",
+ note="(Version 0.03-5)",
url="http://rkward.sourceforge.net",
textVersion =
paste("Michalke, M. (2011). ",
- "XiMpLe: A simple XML tree parser and generator (Version 0.03-4). ",
+ "XiMpLe: A simple XML tree parser and generator (Version 0.03-5). ",
"Available from http://rkward.sourceforge.net",
sep=""),
Modified: trunk/rkward/packages/XiMpLe/man/XiMpLe-package.Rd
===================================================================
--- trunk/rkward/packages/XiMpLe/man/XiMpLe-package.Rd 2011-10-07 19:38:33 UTC (rev 3901)
+++ trunk/rkward/packages/XiMpLe/man/XiMpLe-package.Rd 2011-10-07 20:03:58 UTC (rev 3902)
@@ -8,8 +8,8 @@
}
\details{
\tabular{ll}{ Package: \tab XiMpLe\cr Type: \tab
- Package\cr Version: \tab 0.03-4\cr Date: \tab
- 2011-10-01\cr Depends: \tab R (>= 2.9.0),methods\cr
+ Package\cr Version: \tab 0.03-5\cr Date: \tab
+ 2011-10-07\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://rkward.sourceforge.net\cr }
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