Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dtdValidElement

Determines whether an XML tag is valid within another.


Description

This tests whether name is a legitimate tag to use as a direct sub-element of the within tag according to the definition of the within element in the specified DTD.

Usage

dtdValidElement(name, within, dtd, pos=NULL)

Arguments

name

The name of the tag which is to be inserted inside the within tag.

within

The name of the parent tag the definition of which we are checking to determine if it contains name.

dtd

The DTD in which the elements name and within are defined.

pos

An optional position at which we might add the name element inside within. If this is specified, we have a stricter test that accounds for sequences in which elements must appear in order. These are comma-separated entries in the element definition.

Details

This applies to direct sub-elements or children of the within tag and not tags nested within children of that tag, i.e. descendants.

Value

Returns a logical value. TRUE indicates that a name element can be used inside a within element. FALSE indicates that it cannot.

Author(s)

Duncan Temple Lang

References

See Also

Examples

dtdFile <- system.file("exampleData", "foo.dtd", package="XML")
 foo.dtd <- parseDTD(dtdFile)

  # The following are true.
 dtdValidElement("variable","variables", dtd = foo.dtd)
 dtdValidElement("record","dataset", dtd = foo.dtd)

  # This is false.
 dtdValidElement("variable","dataset", dtd = foo.dtd)

XML

Tools for Parsing and Generating XML Within R and S-Plus

v3.99-0.10
BSD_3_clause + file LICENSE
Authors
CRAN Team [ctb, cre] (de facto maintainer since 2013), Duncan Temple Lang [aut] (<https://orcid.org/0000-0003-0159-1546>), Tomas Kalibera [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.