[rkward-cvs] SF.net SVN: rkward:[4411] trunk/rkward/packages/XiMpLe
m-eik at users.sourceforge.net
m-eik at users.sourceforge.net
Mon Nov 5 22:02:19 UTC 2012
Revision: 4411
http://rkward.svn.sourceforge.net/rkward/?rev=4411&view=rev
Author: m-eik
Date: 2012-11-05 22:02:18 +0000 (Mon, 05 Nov 2012)
Log Message:
-----------
XiMpLe: another fixed bug, now only one known issue is still open (using "node()<-" on text values)
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/node.R
trunk/rkward/packages/XiMpLe/R/pasteXML-methods.R
trunk/rkward/packages/XiMpLe/debian/changelog.rkward
trunk/rkward/packages/XiMpLe/debian/control
trunk/rkward/packages/XiMpLe/debian/copyright
trunk/rkward/packages/XiMpLe/debian/rules
trunk/rkward/packages/XiMpLe/inst/NEWS.Rd
trunk/rkward/packages/XiMpLe/inst/doc/XiMpLe_vignette.Rnw
trunk/rkward/packages/XiMpLe/man/XMLTree.Rd
trunk/rkward/packages/XiMpLe/man/XiMpLe-package.Rd
trunk/rkward/packages/XiMpLe/man/node.Rd
Modified: trunk/rkward/packages/XiMpLe/ChangeLog
===================================================================
--- trunk/rkward/packages/XiMpLe/ChangeLog 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/ChangeLog 2012-11-05 22:02:18 UTC (rev 4411)
@@ -1,14 +1,16 @@
ChangeLog for package XiMpLe
-changes in version 0.03-16 (2012-10-30)
+changes in version 0.03-16 (2012-11-05)
added:
- added examples to all functions
- added a vignette
fixed:
- fixed dropping of last tag/text value if XML was incomplete, e.g., just
an excerpt of a full tree
- - fixed handling of empty tags without space, e.g. "<br/>" instead of "<br
- />"
+ - fixed handling of empty tags completely without space, e.g. "<br/>"
+ instead of "<br />"
+ - parsing error for DOCTYPE nodes mixed up elements and previously ignored
+ the "decl" value
changes in version 0.03-15 (2012-10-26)
fixed:
Modified: trunk/rkward/packages/XiMpLe/DESCRIPTION
===================================================================
--- trunk/rkward/packages/XiMpLe/DESCRIPTION 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/DESCRIPTION 2012-11-05 22:02:18 UTC (rev 4411)
@@ -20,7 +20,7 @@
Authors at R: c(person(given="Meik", family="Michalke",
email="meik.michalke at hhu.de", role=c("aut", "cre")))
Version: 0.03-16
-Date: 2012-10-30
+Date: 2012-11-05
Collate:
'XiMpLe-internal.R'
'XiMpLe.node-class.R'
Modified: trunk/rkward/packages/XiMpLe/NAMESPACE
===================================================================
--- trunk/rkward/packages/XiMpLe/NAMESPACE 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/NAMESPACE 2012-11-05 22:02:18 UTC (rev 4411)
@@ -1,13 +1,13 @@
+export(XMLNode)
+export(XMLTree)
+export(parseXMLTree)
+export(pasteXMLNode)
+export(pasteXMLTag)
+export(pasteXMLTree)
exportClasses(XiMpLe.doc)
exportClasses(XiMpLe.node)
+exportMethods("node<-")
exportMethods(node)
-exportMethods("node<-")
exportMethods(pasteXML)
exportMethods(show)
-export(parseXMLTree)
-export(pasteXMLNode)
-export(pasteXMLTag)
-export(pasteXMLTree)
-export(XMLNode)
-export(XMLTree)
import(methods)
Modified: trunk/rkward/packages/XiMpLe/R/XMLTree.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/XMLTree.R 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/R/XMLTree.R 2012-11-05 22:02:18 UTC (rev 4411)
@@ -6,7 +6,8 @@
#' \code{\link[XiMpLe:XiMpLe.node-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.
-#' @param dtd A named list, doctype definition of the XML tree. Valid elements are \code{doctype}, \code{id} and \code{refer}.
+#' @param dtd A named list, doctype definition of the XML tree. Valid elements are \code{doctype} (root element), \code{decl}
+#' ("PUBLIC" or "SYSTEM"), \code{id} (the identifier) and \code{refer} (URI to .dtd).
#' Currently just pasted, no checking is done.
#' @param .children Alternative way of specifying children, if you have them already as a list.
#' @return An object of class \code{\link[XiMpLe:XiMpLe.doc-class]{XiMpLe.doc}}
@@ -23,7 +24,7 @@
#' sample.XML.body))
#' sample.XML.tree <- XMLTree(sample.XML.html,
#' xml=list(version="1.0", encoding="UTF-8"),
-#' dtd=list(doctype="html PUBLIC",
+#' dtd=list(doctype="html", decl="PUBLIC",
#' id="-//W3C//DTD XHTML 1.0 Transitional//EN",
#' refer="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"))
Modified: trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/R/XiMpLe-internal.R 2012-11-05 22:02:18 UTC (rev 4411)
@@ -211,12 +211,12 @@
parseXMLAttr <- function(tag){
if(XML.doctype(tag)){
stripped.tag <- gsub("<!((?i)DOCTYPE)[[:space:]]+([^[:space:]]+)[[:space:]]*([^\"[:space:]]*)[[:space:]]*.*>",
- "doctype=\"\\2\", id=\"\\3\"", tag)
+ "doctype=\"\\2\", decl=\"\\3\"", tag)
stripped.tag2 <- eval(parse(text=paste("c(",gsub("[^\"]*[\"]?([^\"]*)[\"]?[^\"]*", "\"\\1\",", tag),"NULL)")))
is.dtd <- grepl("\\.dtd", stripped.tag2)
doct.decl <- ifelse(sum(!is.dtd) > 0, paste(stripped.tag2[!is.dtd][1], sep=""), paste("", sep=""))
doct.ref <- ifelse(sum(is.dtd) > 0, paste(stripped.tag2[is.dtd][1], sep=""), paste("", sep=""))
- parsed.list <- eval(parse(text=paste("list(", stripped.tag, ", decl=\"", doct.decl,"\"", ", refer=\"", doct.ref,"\")", sep="")))
+ parsed.list <- eval(parse(text=paste("list(", stripped.tag, ", id=\"", doct.decl,"\"", ", refer=\"", doct.ref,"\")", sep="")))
} else if(XML.endTag(tag) | XML.comment(tag) |XML.cdata(tag)){
# end tags, comments and CDATA don't have attributes
parsed.list <- ""
Modified: trunk/rkward/packages/XiMpLe/R/XiMpLe-package.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/XiMpLe-package.R 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/R/XiMpLe-package.R 2012-11-05 22:02:18 UTC (rev 4411)
@@ -4,7 +4,7 @@
#' Package: \tab XiMpLe\cr
#' Type: \tab Package\cr
#' Version: \tab 0.03-16\cr
-#' Date: \tab 2012-10-30\cr
+#' Date: \tab 2012-11-05\cr
#' Depends: \tab R (>= 2.9.0),methods\cr
#' Enhances: \tab rkward\cr
#' Encoding: \tab UTF-8\cr
Modified: trunk/rkward/packages/XiMpLe/R/node.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/node.R 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/R/node.R 2012-11-05 22:02:18 UTC (rev 4411)
@@ -2,6 +2,29 @@
#'
#' This method can be used to get parts of a parsed XML tree object, or to fill it with new values.
#'
+#' @include XiMpLe.doc-class.R
+#' @include XiMpLe.node-class.R
+#' @include XiMpLe-internal.R
+#' @import methods
+#' @examples
+#' \dontrun{
+#' node(my.xml.tree, node=list("html","body"), what="attributes")
+#' node(my.xml.tree, node=list("html","head","title"), what="value") <- "foobar"
+#' }
+#' @docType methods
+#' @rdname node
+#' @export
+setGeneric("node", function(obj, node=list(), what=NULL, cond.attr=NULL, cond.value=NULL, element=NULL){standardGeneric("node")})
+
+# define class union to make life easier
+setClassUnion("XiMpLe.XML", members=c("XiMpLe.node", "XiMpLe.doc"))
+
+#' @rdname node
+#' @aliases
+#' node,-methods
+#' node,XiMpLe.doc-method
+#' node,XiMpLe.node-method
+#' node,XiMpLe.XML-method
#' @param obj An object of class \code{\link[XiMpLe:XiMpLe.doc-class]{XiMpLe.doc}} or
#' \code{\link[XiMpLe:XiMpLe.node-class]{XiMpLe.node}}.
#' @param node A list of node names (or their numeric values), where each element is
@@ -17,29 +40,6 @@
#' against the value between a pair of tags.
#' @param element A character string naming one list element of the node slot. If \code{NULL}, all
#' 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,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")
-#' node(my.xml.tree, node=list("html","head","title"), what="value") <- "foobar"
-#' }
-#' @export
-setGeneric("node", function(obj, node=list(), what=NULL, cond.attr=NULL, cond.value=NULL, element=NULL){standardGeneric("node")})
-
-# define class union to make life easier
-setClassUnion("XiMpLe.XML", members=c("XiMpLe.node", "XiMpLe.doc"))
-
setMethod("node",
signature(obj="XiMpLe.XML"),
function(obj, node=list(), what=NULL, cond.attr=NULL, cond.value=NULL, element=NULL){
@@ -161,6 +161,12 @@
#' @export
setGeneric("node<-", function(obj, node=list(), what=NULL, cond.attr=NULL, cond.value=NULL, element=NULL, value){standardGeneric("node<-")})
+#' @rdname node
+#' @aliases
+#' node<-,-methods
+#' node<-,XiMpLe.doc-method
+#' node<-,XiMpLe.node-method
+#' node<-,XiMpLe.XML-method
setMethod("node<-",
signature(obj="XiMpLe.XML"),
function(obj, node=list(), what=NULL, cond.attr=NULL, cond.value=NULL, element=NULL, value){
Modified: trunk/rkward/packages/XiMpLe/R/pasteXML-methods.R
===================================================================
--- trunk/rkward/packages/XiMpLe/R/pasteXML-methods.R 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/R/pasteXML-methods.R 2012-11-05 22:02:18 UTC (rev 4411)
@@ -106,7 +106,7 @@
if(any(nchar(unlist(tree.doctype)) > 0)) {
new.node <- ifelse(shine > 0, "\n", "")
- doc.doctype <- paste("<!DOCTYPE ", tree.doctype[["doctype"]], sep="")
+ doc.doctype <- paste("<!DOCTYPE", tree.doctype[["doctype"]], tree.doctype[["decl"]], sep=" ")
for (elmt in c("id", "refer")){
if(length(tree.doctype[[elmt]]) > 0) {
if(nchar(tree.doctype[[elmt]]) > 0){
Modified: trunk/rkward/packages/XiMpLe/debian/changelog.rkward
===================================================================
--- trunk/rkward/packages/XiMpLe/debian/changelog.rkward 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/debian/changelog.rkward 2012-11-05 22:02:18 UTC (rev 4411)
@@ -1,3 +1,9 @@
+r-other-rkward-ximple (0.03-16-1) unstable; urgency=low
+
+ * new upstream release
+
+ -- m.eik michalke <meik.michalke at hhu.de> Mon, 05 Nov 2012 22:55:58 +0000
+
r-other-rkward-ximple (0.03-15-1) unstable; urgency=low
* new upstream release
Modified: trunk/rkward/packages/XiMpLe/debian/control
===================================================================
--- trunk/rkward/packages/XiMpLe/debian/control 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/debian/control 2012-11-05 22:02:18 UTC (rev 4411)
@@ -1,4 +1,4 @@
-Source: r-other-reaktanz-ximple
+Source: r-other-rkward-ximple
Section: math
Priority: optional
Maintainer: m.eik michalke <meik.michalke at hhu.de>
@@ -6,7 +6,7 @@
Standards-Version: 3.9.3.1
Homepage: http://reaktanz.de/?c=hacking&s=XiMpLe
-Package: r-other-reaktanz-ximple
+Package: r-other-rkward-ximple
Architecture: all
Section: math
Depends: r-base (>= 2.15.0)
Modified: trunk/rkward/packages/XiMpLe/debian/copyright
===================================================================
--- trunk/rkward/packages/XiMpLe/debian/copyright 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/debian/copyright 2012-11-05 22:02:18 UTC (rev 4411)
@@ -3,7 +3,7 @@
This Debian package was put together m.eik michalke <meik.michalke at hhu.de>.
The package was renamed from its upstream name 'XiMpLe' to
-'r-other-reaktanz-ximple' in harmony with the R packaging policy to indicate
+'r-other-rkward-ximple' in harmony with the R packaging policy to indicate
that the package is external to the CRAN or BioC repositories.
XiMpLe Copyright (C) 2012 Meik Michalke, released under the
Modified: trunk/rkward/packages/XiMpLe/debian/rules
===================================================================
--- trunk/rkward/packages/XiMpLe/debian/rules 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/debian/rules 2012-11-05 22:02:18 UTC (rev 4411)
@@ -1,9 +1,9 @@
#!/usr/bin/make -f
# -*- makefile -*-
-# debian/rules file for the Debian/GNU Linux r-other-reaktanz-ximple package
+# debian/rules file for the Debian/GNU Linux r-other-rkward-ximple package
# Copyright 2012 by m.eik michalke <meik.michalke at hhu.de>
-debRreposname := other-reaktanz
+debRreposname := other-rkward
include /usr/share/R/debian/r-cran.mk
Modified: trunk/rkward/packages/XiMpLe/inst/NEWS.Rd
===================================================================
--- trunk/rkward/packages/XiMpLe/inst/NEWS.Rd 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/inst/NEWS.Rd 2012-11-05 22:02:18 UTC (rev 4411)
@@ -1,12 +1,23 @@
\name{NEWS}
\title{News for Package 'XiMpLe'}
\encoding{UTF-8}
-\section{Changes in XiMpLe version 0.03-16 (2012-10-30)}{
+\section{Changes in XiMpLe version 0.03-16 (2012-11-05)}{
\subsection{added}{
\itemize{
\item added examples to all functions
+ \item added a vignette
}
}
+ \subsection{fixed}{
+ \itemize{
+ \item fixed dropping of last tag/text value if XML was incomplete, e.g., just
+ an excerpt of a full tree
+ \item fixed handling of empty tags completely without space, e.g. "<br/>"
+ instead of "<br />"
+ \item parsing error for DOCTYPE nodes mixed up elements and previously ignored
+ the \code{"decl"} value
+ }
+ }
}
\section{Changes in XiMpLe version 0.03-15 (2012-10-26)}{
\subsection{fixed}{
Modified: trunk/rkward/packages/XiMpLe/inst/doc/XiMpLe_vignette.Rnw
===================================================================
--- trunk/rkward/packages/XiMpLe/inst/doc/XiMpLe_vignette.Rnw 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/inst/doc/XiMpLe_vignette.Rnw 2012-11-05 22:02:18 UTC (rev 4411)
@@ -20,8 +20,10 @@
Before I even begin, I would like to stress that \X{} can \textit{not} replace the \texttt{XML} package, and it is not supposed to. It has only a hand full of functions, therefore it can only do so much. Probably the most noteworthy missing feature in this package is any real DTD support. If you need that, you can stop reading here. Another problem is speed -- \X{} is written in pure R, and it's painfully slow with large XML trees. You won't notice this if you're only dealing with portions of some kilobytes, but if you need to parse really huge documents, it can take ages to finish.
-Historically, this package was written for exactly one purpose: I wanted to be able to read and write the XML documents of \texttt{RKWard}\footnote{\url{http://rkward.sourceforge.net}}, because I was about to write an R package for scripting plugins for this R GUI. I actually had started another project soon before, using the \texttt{XML} package as a dependency, but soon got complaints from Windows users. As it turned out, that package was not available for Windows, because somehow it couldn't be build automatically. I realised that I only needed a small subset of its features anyway, so I figured it might be the easiest way to quickly implement those features myself. Instead of hiding them in the internals of what eventually became the \texttt{rkwarddev} package, I then started working on this package first. And well, ''quicly'' was rather optimistic... but since I'm happily using \X{} in other packages as well (like \texttt{roxyPackage}), I'm satisfied it was worth it.
+Historically, this package was written for exactly one purpose: I wanted to be able to read and write the XML documents of \texttt{RKWard}\footnote{\url{http://rkward.sourceforge.net}}, because I was about to write an R package for scripting plugins for this R GUI. I actually had started another project shortly before, using the \texttt{XML} package as a dependency, but soon got complaints from Windows users. As it turned out, that package was not available for Windows, because somehow it couldn't be built automatically. When I realised that I only needed a small subset of its features anyway, I figured it might be easiest to quickly implement those features myself.
+Instead of hiding them in the internals of what eventually became the \texttt{rkwarddev}\footnote{\url{http://rkward.sourceforge.net/R/pckg/rkwarddev}} package, I then started working on this package first. And well, ``quickly'' was rather optimistic... but since I'm happily using \X{} in other packages as well (like \texttt{roxyPackage}\footnote{\url{http://reaktanz.de/?c=hacking\&s=roxyPackage}}), I'm satisfied it was worth it.
+
So now you know. If you need a full-featured package to parse or generate XML in R, try the \texttt{XML} package. Otherwise, keep on reading.
\section{And now the continuation}
@@ -38,7 +40,7 @@
That about covers it. XML nodes can of course be nested to construct complex trees, but that's all. Let's look at some examples.
\section{Naming conventions}
-Let's quickly explain what we'll be talking about here. If you're parsing an XML document, it will contain an \textbf{XML tree}. This tree is made up of \textbf{XML nodes}. A node is indicated by pointed brackets, \textit{must} have a \textbf{name}, \textit{can} have \textbf{attributes}, and is either \textbf{empty} or not. Nodes can be nested, where nodes inside a node are its \textbf{child nodes}.
+Let's quickly explain what we'll be talking about here. If you're parsing an XML document, it will contain an \textbf{XML tree}. This tree is made up of \textbf{XML nodes}. A node is indicated by arrow brackets, \textit{must} have a \textbf{name}, \textit{can} have \textbf{attributes}, and is either \textbf{empty} or not. Nodes can be nested, where nodes inside a node are its \textbf{child nodes}.
\begin{Schunk}
\begin{Sinput}
@@ -65,7 +67,7 @@
\end{Soutput}
\end{Schunk}
-As you see, you will see XML code in the console. But what this function returns is actually an R object of class \texttt{XiMpLe.node}, so what you see is an interpretation of that object, done by the \texttt{show()} method for objects of this type (see section \ref{Writing XML files} on page \pageref{Writing XML files}).
+As you see, you will be shown XML code on the console. But what this function returns is actually an R object of class \texttt{XiMpLe.node}, so what you see is an \textit{interpretation} of that object, made by the \texttt{show()} method for objects of this type (see section \ref{Writing XML files} on page \pageref{Writing XML files} on how to export XML to files).
The second node in the example above has an attribute. Attributes can be specified with the \texttt{attrs} argument, which expects a named list:
@@ -78,7 +80,7 @@
\end{Soutput}
\end{Schunk}
-So, by default, as long as our node doesn't have any children, it's assumed to be an empty node. To force it into a non-empty node (i.\,e., opening and closing tag) even without content, we'd have to provide an empty character string as its child. Child nodes can be provided in two ways -- either one by one via the ''$\dots$'' argument, or as one list via the \texttt{.children} argument:
+So, by default, as long as our node doesn't have any children, it's assumed to be an empty node. To force it into a non-empty node (i.\,e., opening and closing tag) even without content, we'd have to provide an empty character string as its child. Child nodes can be provided in two ways -- either one by one via the ``$\dots$'' argument, or as one list via the \texttt{.children} argument:
\begin{Schunk}
\begin{Sinput}
@@ -111,7 +113,7 @@
\end{Soutput}
\end{Schunk}
-But how about the comments? Well, \X{} does detect some special node names, one being ''!--'' to indicate a comment:
+But how about the comments? Well, \X{} does detect some special node names, one being ``!-\,-'' to indicate a comment:
\begin{Schunk}
\begin{Sinput}
@@ -133,7 +135,7 @@
+ sample.XML.body)
> sample.XML.tree <- XMLTree(sample.XML.html,
+ xml=list(version="1.0", encoding="UTF-8"),
-+ dtd=list(doctype="html PUBLIC",
++ dtd=list(doctype="html", decl="PUBLIC",
+ id="-//W3C//DTD XHTML 1.0 Transitional//EN",
+ refer="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"))
> sample.XML.tree
@@ -159,7 +161,7 @@
\section{Writing XML files}
\label{Writing XML files}
-We've learned earlier that \texttt{XiMpLe} objects do not contain the actual XML code. If you would like to write the XML code to a file, you need to call \texttt{pasteXML()}, which will translate the R objects into a character string:
+We've learned earlier that \texttt{XiMpLe} objects do not contain the actual XML code. If you would like to write the XML code to a file, you should use \texttt{pasteXML()}, which will translate the R objects into a character string:
\begin{Schunk}
\begin{Sinput}
@@ -191,7 +193,7 @@
\end{Sinput}
\end{Schunk}
-\texttt{parseXMLTree()} can also digest XML directly if it comes in single character strings or vectors. You only need to tell it that you're not providing a file name this time:
+\texttt{parseXMLTree()} can also digest XML directly if it comes in single character strings or vectors. You only need to tell it that you're not providing a file name this time, using the \texttt{object} argument:
\begin{Schunk}
\begin{Sinput}
@@ -209,7 +211,7 @@
Reading and writing XML files is neat, but what if you need to aquire only certain parts of, say, a parsed XML file? For example, what if we only needed the URL of the \texttt{href} attribute in our XHTML example?
-That's a job for \texttt{node()}. This method can be used to extract parts from XML trees. The branch you'd like to get can be defined by a list of node names, and \texttt{node()} will follow down this hierarchy and then return what nodes are to be found below that. You can also specify that you don't want the whole node(s), but only the attributes:
+That's a job for \texttt{node()}. This method can be used to extract parts from XML trees, once they are \X{} objects. The branch you'd like to get can be defined by a list of node names, and \texttt{node()} will follow down this hierarchy and then return what nodes are to be found below that. You can also specify that you don't want the whole node(s), but only the attributes:
\begin{Schunk}
\begin{Sinput}
Modified: trunk/rkward/packages/XiMpLe/man/XMLTree.Rd
===================================================================
--- trunk/rkward/packages/XiMpLe/man/XMLTree.Rd 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/man/XMLTree.Rd 2012-11-05 22:02:18 UTC (rev 4411)
@@ -16,9 +16,10 @@
Currently just pasted, no checking is done.}
\item{dtd}{A named list, doctype definition of the XML
- tree. Valid elements are \code{doctype}, \code{id} and
- \code{refer}. Currently just pasted, no checking is
- done.}
+ tree. Valid elements are \code{doctype} (root element),
+ \code{decl} ("PUBLIC" or "SYSTEM"), \code{id} (the
+ identifier) and \code{refer} (URI to .dtd). Currently
+ just pasted, no checking is done.}
\item{.children}{Alternative way of specifying children,
if you have them already as a list.}
@@ -39,7 +40,7 @@
sample.XML.body))
sample.XML.tree <- XMLTree(sample.XML.html,
xml=list(version="1.0", encoding="UTF-8"),
- dtd=list(doctype="html PUBLIC",
+ dtd=list(doctype="html", decl="PUBLIC",
id="-//W3C//DTD XHTML 1.0 Transitional//EN",
refer="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"))
}
Modified: trunk/rkward/packages/XiMpLe/man/XiMpLe-package.Rd
===================================================================
--- trunk/rkward/packages/XiMpLe/man/XiMpLe-package.Rd 2012-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/man/XiMpLe-package.Rd 2012-11-05 22:02:18 UTC (rev 4411)
@@ -9,7 +9,7 @@
\details{
\tabular{ll}{ Package: \tab XiMpLe\cr Type: \tab
Package\cr Version: \tab 0.03-16\cr Date: \tab
- 2012-10-30\cr Depends: \tab R (>= 2.9.0),methods\cr
+ 2012-11-05\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-11-05 16:06:48 UTC (rev 4410)
+++ trunk/rkward/packages/XiMpLe/man/node.Rd 2012-11-05 22:02:18 UTC (rev 4411)
@@ -1,6 +1,9 @@
+\docType{methods}
\name{node}
\alias{node}
\alias{node<-}
+\alias{node<-,-methods}
+\alias{node,-methods}
\alias{node<-,XiMpLe.doc-method}
\alias{node,XiMpLe.doc-method}
\alias{node<-,XiMpLe.node-method}
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