Portlet Factory, Version 6.1.2
XML/JavaScript Converter builder input
The XML/JavaScript converter builder takes the inputs described in this table.
Table 1. XML/JavaScript Converter builder input Input name Description Name Name for this builder call. IBM® WebSphere Portlet Factory Designer displays this name in the builder call list. This name is also used as the base value for the method that converts XML to JSON: the string ConvertToJSON is appended to the builder call name.
Data Reference Reference to a variable or method call that returns the XML data to be converted. Callback Optional name of a JavaScript function to which the data is passed. This function must be defined elsewhere. If specified, the resulting JavaScript starts with the callback name followed by the JSON code in parentheses. Prevent Direct Evaluation If checked, the JavaScript will be tagged as a comment which will prevent it from being directly executed. This function can be used to enhance security for sensitive JSON output. Conversion options
Mark Attributes If checked, XML attributes are prefixed with an @ symbol in the generated JSON to distinguish them from elements. Text Node Property Indicate the property name to be represented in the JSON output for text in elements that have other children. For example, using the default value of #text for this input, <a>b<c>d</c></a>becomes{ "a" : { "#text": "b", "c" : "d" } }Alternatively, use "$" to produce JSON as specified by the "BadgerFish" convention.Output settings
Write Directly If checked, the JavaScript is sent directly to the servlet output stream. Otherwise, the script code is returned to the caller for further processing. You can select this to optimize performance for cases where the generated JSON code should be used without further modification. Content Type Indicate the value that should be used as the Content-Type header. This input is visible only when Write Directly is checked. The default value is application/javascript. Parent topic: XML/JavaScript Converter builder
Library | Support |