Commit 8ce7042a authored by m.eik michalke's avatar m.eik michalke
Browse files

fixed long lines, run tests and checks, released fixed version

parent aa350f1a
r-other-rkward-ximple (0.03-22-1) unstable; urgency=low
* new upstream release
-- m.eik michalke <meik.michalke@hhu.de> Tue, 02 Dec 2014 21:11:31 +0100
r-other-rkward-ximple (0.03-21-1) unstable; urgency=low
* new upstream release
......
Source: r-other-reaktanz-ximple
Source: r-other-rkward-ximple
Section: math
Priority: optional
Maintainer: m.eik michalke <meik.michalke@hhu.de>
Build-Depends-Indep: debhelper (>> 7.0.0), r-base-dev (>= 3.0.0), cdbs
Build-Depends-Indep: debhelper (>> 7.0.0), r-base-dev (>= 3.1.0), cdbs
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-core (>= 3.0.0)
Depends: r-base-core (>= 3.1.0)
Description: GNU R package: 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.
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.sf.net.
Homepage: http://reaktanz.de/?c=hacking&s=XiMpLe
Suggests: r-cran-testthat
Conflicts: r-cran-ximple
The R library XiMpLe was originally written and is maintained by Meik Michalke <meik.michalke@hhu.de>.
The R library XiMpLe was originally written and is maintained by Meik Michalke <meik.michalke@hhu.de>.
This Debian package was put together m.eik michalke <meik.michalke@hhu.de>.
This Debian package was put together by m.eik michalke <meik.michalke@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) 2014 Meik Michalke, released under the
......
#!/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 2014 by m.eik michalke <meik.michalke@hhu.de>
debRreposname := other-reaktanz
debRreposname := other-rkward
include /usr/share/R/debian/r-cran.mk
......@@ -144,7 +144,8 @@ XMLScanDeep(obj, find = NULL, search = "attributes")
\item{name}{Character, name of nodes to scan for.}
\item{as.list}{Logical, if \code{TRUE} allways returns a list (or NULL), otherwise if exactly one result is found,
\item{as.list}{Logical, if \code{TRUE} allways returns a list (or NULL),
otherwise if exactly one result is found,
it will be returned as as single \code{XiMpLe.node}.}
\item{find}{Character, name of element to scan for.}
......@@ -173,16 +174,21 @@ These are convenience methods to get or set slots from XML objects without using
Another special method can scan a node/document tree object for appearances of nodes with a particular name:
\itemize{
\item{\code{XMLScan(obj, name, as.list=FALSE)}: }{get/set the XML nodes by name (recursively searches slot \code{name} of both classes
\code{XiMpLe.node} and \code{XiMpLe.doc}). If \code{as.list=TRUE} allways returns a list (or NULL), otherwise if exactly one result is found,
\item{\code{XMLScan(obj, name,
as.list=FALSE)}: }{get/set the XML nodes by name (recursively searches slot \code{name} of both classes
\code{XiMpLe.node} and \code{XiMpLe.doc}). If \code{as.list=TRUE} allways returns a list (or NULL),
otherwise if exactly one result is found,
it will be returned as as single \code{XiMpLe.node}.}
}
Finally, there is a method to scan for certain values in XiMpLe objects and just list them. For instance, it can be used to
Finally,
there is a method to scan for certain values in XiMpLe objects and just list them. For instance,
it can be used to
list all instances of a certain attribute type in a document tree:
\itemize{
\item{\code{XMLScanDeep(obj, find, search="attributes")}: }{returns all found instances of \code{find} in all slots defined by \code{search}.}
\item{\code{XMLScanDeep(obj, find,
search="attributes")}: }{returns all found instances of \code{find} in all slots defined by \code{search}.}
}
}
\examples{
......
......@@ -13,7 +13,8 @@ is.XiMpLe.node(x)
\item{name}{Character string, the tag name.}
\item{...}{Optional children for the tag. Must be either objects of class XiMpLe.node or character strings,
which are treated as simple text values. If this is empty, the tag will be treated as an empty tag. To
which are treated as simple text values. If this is empty,
the tag will be treated as an empty tag. To
force a closing tag, supply an empty string, i.e. \code{""}.}
\item{attrs}{An optional named list of attributes.}
......@@ -22,7 +23,8 @@ force a closing tag, supply an empty string, i.e. \code{""}.}
\item{namespaceDefinitions}{Currently ignored.}
\item{.children}{Alternative way of specifying children, if you have them already as a list.}
\item{.children}{Alternative way of specifying children,
if you have them already as a list.}
\item{x}{An arbitrary \code{R} object.}
}
......@@ -33,7 +35,8 @@ An object of class \code{\link[XiMpLe:XiMpLe.node-class]{XiMpLe.node}}.
Can be used to create XML nodes.
}
\details{
To generate a CDATA node, set \code{name="![CDATA["}, to create a comment, set \code{name="!--"}.
To generate a CDATA node, set \code{name="![CDATA["}, to create a comment,
set \code{name="!--"}.
}
\examples{
sample.XML.node <- XMLNode("a",
......
......@@ -13,13 +13,17 @@ is.XiMpLe.doc(x)
\code{\link[XiMpLe:XiMpLe.node-class]{XiMpLe.node}} or character strings,
which are treated as simple text values.}
\item{xml}{A named list, XML declaration of the XML tree. Currently just pasted, no checking is done.}
\item{xml}{A named list, XML declaration of the XML tree. Currently just pasted,
no checking is done.}
\item{dtd}{A named list, doctype definition of the XML tree. Valid elements are \code{doctype} (root element), \code{decl}
\item{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.}
\item{.children}{Alternative way of specifying children, if you have them already as a list.}
\item{.children}{Alternative way of specifying children,
if you have them already as a list.}
\item{x}{An arbitrary \code{R} object.}
}
......
......@@ -23,7 +23,8 @@ 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, to make plugin
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.sf.net.
}
\author{
......
......@@ -32,10 +32,14 @@ node(obj, node = list(), what = NULL, cond.attr = NULL,
\item{node}{A list of node names (or their numeric values), where each element is
the child of its previous element. duplicate matches will be returned as a list.}
\item{what}{A character string, must be a valid slot name of class \code{\link[XiMpLe:XiMpLe.node-class]{XiMpLe.node}}, like
\code{"attributes"} or \code{"value"}. If not \code{NULL}, only that part of a node will be returned.
\item{what}{A character string,
must be a valid slot name of class \code{\link[XiMpLe:XiMpLe.node-class]{XiMpLe.node}},
like
\code{"attributes"} or \code{"value"}. If not \code{NULL},
only that part of a node will be returned.
There's also two special properties for this option: \code{what="@path"} will not return the
node or it's contents, but a character string with the "path" to it in the object; \code{what="obj@path"}
node or it's contents,
but a character string with the "path" to it in the object; \code{what="obj@path"}
is the same but won't have \code{obj} substituted with the object's name.}
\item{cond.attr}{A named character string, to further filter the returned results.
......@@ -44,13 +48,15 @@ If not \code{NULL}, only nodes with fully matching attributes will be considered
\item{cond.value}{A character string, similar to \code{cond.attr}, but is matched
against the value between a pair of tags.}
\item{element}{A character string naming one list element of the node slot. If \code{NULL}, all
\item{element}{A character string naming one list element of the node slot. If \code{NULL},
all
elements will be returned.}
\item{value}{The value to set.}
}
\description{
This method can be used to get parts of a parsed XML tree object, or to fill it with new values.
This method can be used to get parts of a parsed XML tree object,
or to fill it with new values.
}
\examples{
\dontrun{
......
......@@ -12,16 +12,19 @@ parseXMLTree(file, drop = NULL, object = FALSE)
\code{"declarations"} and \code{"doctype"}, defining element classes to be dropped
from the resulting object.}
\item{object}{Logical, if \code{TRUE}, \code{file} will not be treated as a path name but as a
\item{object}{Logical, if \code{TRUE},
\code{file} will not be treated as a path name but as a
character vector to be parsed as XML directly.}
}
\value{
An object of class \code{\link[XiMpLe:XiMpLe.doc-class]{XiMpLe.doc}} with four slots:
\describe{
\item{\code{file}:}{Full path to the parsed file, or \code{"object"} if \code{object=TRUE}.}
\item{\code{file}:}{Full path to the parsed file,
or \code{"object"} if \code{object=TRUE}.}
\item{\code{xml}:}{XML declaration, if found.}
\item{\code{dtd}:}{Doctype definition, if found.}
\item{\code{children}:}{A list of objects of class \code{XiMpLe.node}, with the elements
\item{\code{children}:}{A list of objects of class \code{XiMpLe.node},
with the elements
\code{"name"} (the node name), \code{"attributes"} (list of attributes, if found),
\code{"children"} (list of \code{XiMpLe.node} object, if found) and \code{"value"}
(text value between a pair of start/end tags, if found).}
......
......@@ -20,11 +20,13 @@ pasteXML(obj, ...)
\arguments{
\item{obj}{An object of class \code{XiMpLe.node} or \code{XiMpLe.doc}.}
\item{...}{Additional options for the generic method, see options for a specific method, respectively.}
\item{...}{Additional options for the generic method, see options for a specific method,
respectively.}
\item{level}{Indentation level.}
\item{shine}{Integer, controlling if the output should be formatted for better readability. Possible values:
\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.}
......@@ -33,7 +35,8 @@ pasteXML(obj, ...)
\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
\item{tidy}{Logical,
if \code{TRUE} the special characters "<" and ">" will be replaced with the entities
"&lt;" and "gt;" in attributes and text values.}
}
\description{
......
......@@ -12,19 +12,23 @@ pasteXMLTag(tag, attr = NULL, child = NULL, empty = TRUE, level = 1,
\item{attr}{A list of attributes for the tag.}
\item{child}{If \code{empty=FALSE}, a character string to be pasted as a child node between start and end tag.}
\item{child}{If \code{empty=FALSE},
a character string to be pasted as a child node between start and end tag.}
\item{empty}{Logical, <true /> or <false></false>}
\item{level}{Indentation level.}
\item{allow.empty}{Logical, if \code{FALSE}, tags without attributes will not be returned.}
\item{allow.empty}{Logical, if \code{FALSE},
tags without attributes will not be returned.}
\item{rename}{An optional named list if the attributes in XML need to be renamed from their list names in \code{attr}.
This list must in turn have a list element named after \code{tag}, containing named character elements, where the
This list must in turn have a list element named after \code{tag},
containing named character elements, where the
names represent the element names in \code{attr} and their values the names the XML attribute should get.}
\item{shine}{Integer, controlling if the output should be formatted for better readability. Possible values:
\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.}
......@@ -33,8 +37,10 @@ names represent the element names in \code{attr} and their values the names the
\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
"&lt;", "&gt;" and "&amp;" in attribute values. For comment or CDATA tags, if the text includes newline characters
\item{tidy}{Logical, if \code{TRUE} the special characters "<",
">" and "&" will be replaced with the entities
"&lt;", "&gt;" and "&amp;" in attribute values. For comment or CDATA tags,
if the text includes newline characters
they will also be indented.}
}
\value{
......@@ -48,7 +54,8 @@ with this one function.
\note{
However, you will probably not want to use this function at all, as it is much more
comfortable to create XML nodes or even nested trees with \code{\link[XiMpLe:XMLNode]{XMLNode}} and
\code{\link[XiMpLe:XMLTree]{XMLTree}}, and then feed the result to \code{\link[XiMpLe:pasteXML]{pasteXML}}.
\code{\link[XiMpLe:XMLTree]{XMLTree}},
and then feed the result to \code{\link[XiMpLe:pasteXML]{pasteXML}}.
}
\examples{
sample.XML.tag <- pasteXMLTag("a",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment