txx_sanitize_tag_name: Sanitize text for use as an XML tag

Description Usage Arguments Details Value

View source: R/txx_sanitize_tag_name.R

Description

This function takes a character string, and returns a 'sanitized' version of it for use as an XML tag (following XML specifications - more details below). This function is called internally, however is useful for converting a list of labels for searching in the resultant XML document for a specific text tag(s).

Usage

1

Arguments

tag_name

A character string

Details

Changes made to the text (in this order):

  1. Trims any white space around the tag,

  2. Changes text to title case,

  3. Replaces all ' ' with '_',

  4. Removes any non-alphanumeric characters (aside from '_'),

  5. Prefixes a '_' if the text starts with a number.

Value

The character string, modified to be suitable for use as an XML tag


michael-ccccc/textured documentation built on Dec. 21, 2021, 5:56 p.m.