Skip to main content

         This documentation site is for previous versions. Visit our new documentation site for current releases.      

Configuring the XML output for an XML Stream rule

Updated on April 6, 2022

The XML tab of an XML Stream rule contains the XML output. Specify how the system generates the stream XML content.

  1. In the navigation pane of Dev Studio, click Records.
  2. Expand the Integration-Mapping category, and then click XML Stream.
  3. Click an XML Stream rule to open it.
  4. Click the XML tab.
  5. 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.

  6. 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, selectUse 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.

    • Omit extra spaces.
  7. In the Generate for field, select JSP or HTML.
    This field only appears when the rule contains directives rather than JSP tags. The value that appears is HTML.

    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.

    Note: Do not save the rule form when the source contains both JSP tags and directives.
  8. In the Convert to JSP field,
    This button appears only after you save the form when the Generate for value is HTML and this rule is created by a Save As operation. See Converting from directives to JavaServer Page tags.
  9. 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" />

    If the output XML document is to conform to a DTD definition that uses the CDATA convention, always use the LITERAL keyword in the reference directive or the literal mode for the JSP tag. This causes the output value to contain any < and > characters in the property rather than converting these characters to the XML entities < and >.

    Use the <% and %> delimiters to surround an inline Java scriptlet within the XML source code.

  10. Click Save.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us