[rkward-cvs] SF.net SVN: rkward:[3746] trunk/rkward/rkward/rbackend/rpackages/XiMpLe

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Sun Sep 11 15:59:43 UTC 2011


Revision: 3746
          http://rkward.svn.sourceforge.net/rkward/?rev=3746&view=rev
Author:   m-eik
Date:     2011-09-11 15:59:43 +0000 (Sun, 11 Sep 2011)
Log Message:
-----------
XiMpLe: fixed issue with value pseudo tags

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rpackages/XiMpLe/ChangeLog
    trunk/rkward/rkward/rbackend/rpackages/XiMpLe/DESCRIPTION
    trunk/rkward/rkward/rbackend/rpackages/XiMpLe/NAMESPACE
    trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe-internal.R
    trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe-internal.roxy.all.R
    trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe-package.R
    trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe.node-class.R
    trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/pasteXMLNode.R
    trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/pasteXMLTag.R
    trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/pasteXMLTree.R
    trunk/rkward/rkward/rbackend/rpackages/XiMpLe/inst/CITATION
    trunk/rkward/rkward/rbackend/rpackages/XiMpLe/man/XiMpLe-package.Rd

Modified: trunk/rkward/rkward/rbackend/rpackages/XiMpLe/ChangeLog
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/XiMpLe/ChangeLog	2011-09-11 12:08:17 UTC (rev 3745)
+++ trunk/rkward/rkward/rbackend/rpackages/XiMpLe/ChangeLog	2011-09-11 15:59:43 UTC (rev 3746)
@@ -1,5 +1,9 @@
 ChangeLog for package XiMpLe
 
+## 0.03-1 (2011-09-11)
+  - fixed outstanding issue with complex value structures
+  - changed "Author at R" to "Authors at R" in DESCRIPTION (for R >= 2.14)
+
 ## 0.02-2 (2011-09-01)
   - fixed missing "methods" dependecy
   - adjusted docs a little

Modified: trunk/rkward/rkward/rbackend/rpackages/XiMpLe/DESCRIPTION
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/XiMpLe/DESCRIPTION	2011-09-11 12:08:17 UTC (rev 3745)
+++ trunk/rkward/rkward/rbackend/rpackages/XiMpLe/DESCRIPTION	2011-09-11 15:59:43 UTC (rev 3746)
@@ -17,10 +17,10 @@
 Encoding: UTF-8
 LazyLoad: yes
 URL: http://rkward.sourceforge.net
-Author at R: c(person(given="Meik", family="Michalke",
-    email="meik.michalke at hhu.de"))
-Version: 0.02-2
-Date: 2011-09-02
+Authors at R: c(person(given="Meik", family="Michalke",
+    email="meik.michalke at hhu.de", role=c("aut", "cre")))
+Version: 0.03-1
+Date: 2011-09-11
 Collate:
     'XiMpLe.node-class.R'
     'XiMpLe.doc-class.R'

Modified: trunk/rkward/rkward/rbackend/rpackages/XiMpLe/NAMESPACE
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/XiMpLe/NAMESPACE	2011-09-11 12:08:17 UTC (rev 3745)
+++ trunk/rkward/rkward/rbackend/rpackages/XiMpLe/NAMESPACE	2011-09-11 15:59:43 UTC (rev 3746)
@@ -1,7 +1,7 @@
 exportClasses(XiMpLe.doc)
 exportClasses(XiMpLe.node)
+exportMethods("node<-")
 exportMethods(node)
-exportMethods("node<-")
 export(parseXMLTree)
 export(pasteXMLNode)
 export(pasteXMLTag)

Modified: trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe-internal.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe-internal.R	2011-09-11 12:08:17 UTC (rev 3745)
+++ trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe-internal.R	2011-09-11 15:59:43 UTC (rev 3746)
@@ -371,9 +371,9 @@
 		} else {}
 		if(XML.value(this.tag)){
 			children[nxt.child] <- new("XiMpLe.node",
-				name="value",
-				value=this.tag)
-			names(children)[nxt.child] <- "value"
+				name="",
+				value=XML.value(this.tag, get=TRUE))
+			names(children)[nxt.child] <- "!value!"
 			tag.no <- tag.no + 1
 			next
 		} else {
@@ -410,21 +410,13 @@
 		## uncomment to debug:
 		# cat(child.name, ":", tag.no, "-", child.end.tag,"\n")
 			rec.nodes <- XML.nodes(single.tags, end.here=child.name, start=tag.no + 1)
-			# if there's a value element, move the value here
-			if(!is.null(rec.nodes$children[["value"]])){
-				node.value <- rec.nodes$children[["value"]]@value
-				rec.nodes$children[["value"]] <- NULL
-			} else {
-				# this will force the node to remain non-empty.
-				# if value was character() and node had no children,
-				# it would be turned into an empty tag otherwise
-				node.value <- ""
-			}
 			children[nxt.child] <- new("XiMpLe.node",
 				name=child.name,
 				attributes=child.attr,
 				children=rec.nodes$children,
-				value=as.character(node.value))
+				# this value will force the node to remain non-empty if it had no children,
+				# it would be turned into an empty tag otherwise
+				value="")
 			names(children)[nxt.child] <- child.name
 			tag.no <- rec.nodes$tag.no + 1
 			next

Modified: trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe-internal.roxy.all.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe-internal.roxy.all.R	2011-09-11 12:08:17 UTC (rev 3745)
+++ trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe-internal.roxy.all.R	2011-09-11 15:59:43 UTC (rev 3746)
@@ -1,10 +1,13 @@
 # package description files
+# this internal object can be used by the package roxyPackage to
+# automatically create/update DESCRIPTION and CITATION files
 pckg.dscrptn <- data.frame(
 		Package="XiMpLe",
 		Type="Package",
 		Title="A simple XML tree parser and generator",
 		Author="m.eik michalke <meik.michalke at hhu.de>",
-		AuthorR="c(person(given=\"Meik\", family=\"Michalke\", email=\"meik.michalke at hhu.de\"))",
+		AuthorsR="c(person(given=\"Meik\", family=\"Michalke\", email=\"meik.michalke at hhu.de\",
+			role=c(\"aut\", \"cre\")))",
 		Maintainer="m.eik michalke <meik.michalke at hhu.de>",
 		Depends="R (>= 2.9.0),methods",
 		Enhances="rkward",

Modified: trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe-package.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe-package.R	2011-09-11 12:08:17 UTC (rev 3745)
+++ trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe-package.R	2011-09-11 15:59:43 UTC (rev 3746)
@@ -3,8 +3,8 @@
 #' \tabular{ll}{
 #' Package: \tab XiMpLe\cr
 #' Type: \tab Package\cr
-#' Version: \tab 0.02-2\cr
-#' Date: \tab 2011-09-02\cr
+#' Version: \tab 0.03-1\cr
+#' Date: \tab 2011-09-11\cr
 #' Depends: \tab R (>= 2.9.0),methods\cr
 #' Enhances: \tab rkward\cr
 #' Encoding: \tab UTF-8\cr

Modified: trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe.node-class.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe.node-class.R	2011-09-11 12:08:17 UTC (rev 3745)
+++ trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/XiMpLe.node-class.R	2011-09-11 15:59:43 UTC (rev 3746)
@@ -19,12 +19,12 @@
 		obj.name <- object at name
 		obj.attributes <- object at attributes
 		obj.children <- object at children
-#		obj.value <- object at value
+		obj.value <- object at value
 
- 		if(!nchar(obj.name) > 0){
+		if(isTRUE(!nchar(obj.name) > 0) & isTRUE(!nchar(obj.value) > 0)){
 			print(str(object))
- 			stop(simpleError("Invalid object: A node must have a name!"))
- 		} else {}
+			stop(simpleError("Invalid object: A node must at least have a name or a value!"))
+		} else {}
 
 		obj.attributes.names <- names(obj.attributes)
 		# if there are attributes, check that they all have names

Modified: trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/pasteXMLNode.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/pasteXMLNode.R	2011-09-11 12:08:17 UTC (rev 3745)
+++ trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/pasteXMLNode.R	2011-09-11 15:59:43 UTC (rev 3746)
@@ -41,7 +41,7 @@
 	if(length(node.val) > 0){
 		node.empty <- FALSE
 		if(nchar(node.val) > 0){
-			node.chld <- paste(new.indent, node.val, new.node, node.chld, collapse="", sep="")
+			node.chld <- node.val
 		} else {}
 	} else {}
 

Modified: trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/pasteXMLTag.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/pasteXMLTag.R	2011-09-11 12:08:17 UTC (rev 3745)
+++ trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/pasteXMLTag.R	2011-09-11 15:59:43 UTC (rev 3746)
@@ -36,8 +36,11 @@
 	attr.space <- ifelse(nchar(all.attributes) > 0, " ", "")
 	new.cmmt.indent <- ifelse(shine > 1, indent(level + 1, by=indent.by), "")
 
-	# two special cases: comments and CDATA
-	if(identical(tag, "!--")){
+	# three special cases: value pseudotags, comments and CDATA
+	if(isTRUE(nchar(tag) == 0) | length(tag) == 0){
+cat("tag: ", tag, "\nshine: ", shine, "\nlevel: ", level, "\nchild: ", child, "\n")
+		full.tag <- paste(new.indent, child, new.node, sep="")
+	} else if(identical(tag, "!--")){
 		full.tag <- paste(new.indent, "<!-- ", new.attr, new.cmmt.indent, if(!is.null(child)){trim(child)}, " ", new.attr, new.attr.indent, "-->", new.node, sep="")
 	} else if(identical(tag, "![CDATA[")){
 		full.tag <- paste(new.indent, "<![CDATA[ ", new.attr, new.cmmt.indent, if(!is.null(child)){trim(child)}, " ", new.attr, new.attr.indent, "]]>", new.node, sep="")

Modified: trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/pasteXMLTree.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/pasteXMLTree.R	2011-09-11 12:08:17 UTC (rev 3745)
+++ trunk/rkward/rkward/rbackend/rpackages/XiMpLe/R/pasteXMLTree.R	2011-09-11 15:59:43 UTC (rev 3746)
@@ -29,7 +29,7 @@
 
 	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="", collapse=" "), sep="")
+		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="")

Modified: trunk/rkward/rkward/rbackend/rpackages/XiMpLe/inst/CITATION
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/XiMpLe/inst/CITATION	2011-09-11 12:08:17 UTC (rev 3745)
+++ trunk/rkward/rkward/rbackend/rpackages/XiMpLe/inst/CITATION	2011-09-11 15:59:43 UTC (rev 3746)
@@ -1,13 +1,14 @@
 bibentry("Manual",
 		title="XiMpLe: A simple XML tree parser and generator",
-		author=c(person(given="Meik", family="Michalke", email="meik.michalke at hhu.de")),
+		author=c(person(given="Meik", family="Michalke", email="meik.michalke at hhu.de",
+			role=c("aut", "cre"))),
 		year="2011",
-		note="(Version 0.02-2)",
+		note="(Version 0.03-1)",
 		url="http://rkward.sourceforge.net",
 
 		textVersion =
 		paste("Michalke, M. (2011). ",
-				"XiMpLe: A simple XML tree parser and generator (Version 0.02-2). ",
+				"XiMpLe: A simple XML tree parser and generator (Version 0.03-1). ",
 				"Available from http://rkward.sourceforge.net",
 				sep=""),
 

Modified: trunk/rkward/rkward/rbackend/rpackages/XiMpLe/man/XiMpLe-package.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/XiMpLe/man/XiMpLe-package.Rd	2011-09-11 12:08:17 UTC (rev 3745)
+++ trunk/rkward/rkward/rbackend/rpackages/XiMpLe/man/XiMpLe-package.Rd	2011-09-11 15:59:43 UTC (rev 3746)
@@ -2,14 +2,15 @@
 \name{XiMpLe-package}
 \alias{XiMpLe}
 \alias{XiMpLe-package}
+\alias{"XiMpLe-package"}
 \title{A simple XML tree parser and generator.}
 \description{
   A simple XML tree parser and generator.
 }
 \details{
   \tabular{ll}{ Package: \tab XiMpLe\cr Type: \tab
-  Package\cr Version: \tab 0.02-2\cr Date: \tab
-  2011-09-02\cr Depends: \tab R (>= 2.9.0),methods\cr
+  Package\cr Version: \tab 0.03-1\cr Date: \tab
+  2011-09-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 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