hmakeTag {hwriter}R Documentation

HTML/XML tag formatter

Description

Formats an HTML/XML tag, using a low-level syntax.

Usage

hmakeTag(tag, data=NULL, newline=FALSE, ...)

Arguments

tag a character vector containing the name of the HTML/XML tag.
data a character vector containing the body of the tag.
newline a logical. Appends a newline \n character at the end of the tag.
... optional arguments that will be appended in the tag.

Details

This low-level function is used by hwrite to build HTML tags, which is doing all the HTML formatting job. This function is useful to build non-standard or rare HTML tags.

Value

A string containing the output HTML/XML tag.

Author(s)

Gregoire Pau, gpau@ebi.ac.uk, 2008

See Also

hwrite.

Examples

## simple call
hmakeTag('a','Centipede',href='http://en.wikipedia.org/wiki/Centipede')

## vectorized calls
hmakeTag('tag',1:10,color='red')
hmakeTag(colors()[1:10],1:10,semantic='color')

## nested calls
hmakeTag('html',hmakeTag('body','Text'),'xml:lang'='en')

[Package hwriter version 0.91 Index]