lucee.Componentcoldbox.system.core.conversion.XMLConverter
A utility tool that can marshall data to XML
Constructor Summary | |
---|---|
init()
|
Method Summary | |
---|---|
string
|
arrayToXML(array data, [boolean useCDATA='false'], string rootName='')
Converts an array into XML with no headers. |
private Util
|
getUtil()
Create and return a util object. |
string
|
objectToXML(any data, [boolean useCDATA='false'], string rootName='')
Converts an object(entity) into XML by inspecting its properties and then calling the appropriate getters on it. |
string
|
queryToXML(query data, [string CDATAColumns=''], [string columnlist='[runtime expression]'], [boolean useCDATA='false'], string rootName='')
Converts a query to XML with no headers. |
private string
|
safeText(string txt, [boolean useCDATA='false'])
Create a safe xml text. |
string
|
structToXML(any data, [boolean useCDATA='false'], string rootName='')
Converts a struct into XML with no headers. |
string
|
toXML(any data, [string columnlist], [boolean useCDATA='false'], [boolean addHeader='true'], string encoding='UTF-8', [string delimiter=','], string rootName='')
Convert any type of data to XML. |
private any
|
translateValue(struct args, any targetValue)
Translate a value into XML. |
private string
|
unicodeWin1252(string value)
Converts MS-Windows superset characters (Windows-1252) into their XML friendly unicode counterparts. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Method Detail |
---|
Converts an array into XML with no headers.
data
- The array to convertuseCDATA
- Use CDATA content for ALL values. False by defaultrootName
- The name of the root element, else it defaults to the internal defaults.Create and return a util object
Converts an object(entity) into XML by inspecting its properties and then calling the appropriate getters on it.
data
- The structure, object, any to convert.useCDATA
- Use CDATA content for ALL valuesrootName
- The name of the root element, else it defaults to the internal defaults.Converts a query to XML with no headers.
data
- The query to convertCDATAColumns
- Which columns to wrap in cdata tagscolumnlist
- Choose which columns to include in the translation, by default it uses all the columns in the queryuseCDATA
- Use CDATA content for ALL valuesrootName
- The name of the root element, else it defaults to the internal defaults.Create a safe xml text
txt
useCDATA
- Use CDATA content for ALL valuesConverts a struct into XML with no headers.
data
- The structure, object, any to convert.useCDATA
- Use CDATA content for ALL valuesrootName
- The name of the root element, else it defaults to the internal defaults.Convert any type of data to XML. This method will auto-discover the type. Valid types are array,query,struct
data
- The data to convert to xmlcolumnlist
- Choose which columns to inspect, by default it uses all the columns in the query, if using a queryuseCDATA
- Use CDATA content for ALL values. The default is falseaddHeader
- Add an xml header to the packet returned.encoding
- The character encoding of the header. UTF-8 is the defaultdelimiter
- The delimiter in the list. Comma by defaultrootName
- The name of the root element, else it defaults to the internal defaults.Translate a value into XML
args
- The original argument collectiontargetValue
- The value to translateConverts MS-Windows superset characters (Windows-1252) into their XML friendly unicode counterparts
value