Configuring the XML output for an XML Stream rule
The XML tab of an XML Stream rule contains the XML output. Specify how the system generates the stream XML content.
- In the navigation pane of Dev Studio, click Records.
- Expand the Integration-Mapping category, and then click XML Stream.
- Click an XML Stream rule to open it.
- Click the XML tab.
- Optional: In the XML schema section, in the Schema
URL field, enter the URL of an XML Schema document to use as input for
building the XML tree structure on the Mapping tab. This field is used only when the Auto-generated XML option is selected. For SOAP services that reference this rule, the Schema URL value is added to the generated WSDL document as an external document import.
This field supports the Global Resource Settings syntax (=PageName.PropertyName). The default property name for this field is pySchemaLocation.
- In the XML generation section, choose from the following
options:
- To generate the stream XML (as visible in the XML SOURCE
field) from the tree structure on the Mapping tab, select
Auto-generated XML.
You cannot edit the generated value. Clear this check box to type XML source code into the XML SOURCE field by typing or with a text editor such as NotePad or an XML editor. This text is processed by stream processing before use; you can use JSP tags.
- To encode the generated XML using the encoding rules of Section 5 of the SOAP 1.1
protocol, select Use SOAP 1.1 encoding.
If selected, attributes are added to element tags for explicitly declaring the type of the element. This option is used only when the Auto-generated XML check box is selected.
- To add an
xsi:type
attribute to the root element, select Add type attribute to root node.This attribute is used to resolve substituted XML content at the service endpoint. This option is used only when the Auto-generated XML option is selected.
- To enable the system to omit extra spaces from auto-generated and non–auto-generated XML, select Omit extra spaces.
- To generate the stream XML (as visible in the XML SOURCE
field) from the tree structure on the Mapping tab, select
Auto-generated XML.
- In the Generate for field, select
JSP.This field only appears when the rule contains directives rather than JSP tags. The value that appears is HTML. The HTML option applies only to legacy configurations. HTML is not supported for new or updated configurations, whether or not the XML is auto-generated or non–auto-generated.
As a best practice, use JSP tags rather than directives. In most cases, you can convert XML Stream rules that use directives to use JSP tags automatically, using the button. See Converting from directives to JavaServer Page tags.
If this rule is circumstance-qualified or time-qualified, make this Generate for value match the Generate for value of the base rule. The base rule and the qualified rules must all use JSP tags or all use directives.
- In the XML SOURCE field, enter XML source text.This field is read-only unless the Auto-generated XML check box is cleared.
Use of JSP tags in XML stream rules offers superior performance and other advantages over directives. Although both directives and JSP tags are supported, JSP tags are recommended for new development. Conversion of existing XML stream rules that use directives to functionally equivalent rules that use JSP tags is straightforward.
Recall that the default forms of the <pega:reference > JSP tag (and the reference directive) cause the system to place a space character before and after the output text value of the property. When no added spaces are desired, use the
LITERAL
keyword in the reference directive:{ .pyLabel LITERAL }
or equivalently the
text
mode for the reference JSP tag:<pega:reference name=".pyLabel" mode="text" />
- Click Save.
Previous topic Defining pages and classes for an XML Stream rule Next topic Manually editing XML for XML Stream rules