XmlMessage

자유 양식 XML 컨텐츠에서 자국어 지원 가능 메시지(자국어 지원 참조)를 작성합니다.

작성된 메시지는 XmlMessage 요소에 있는 리터럴 XML 컨텐츠가 됩니다. 단, 다음과 같은 예외가 하나 있습니다. 모든 replace 요소의 컨텐츠는 이 요소에 포함된 표현식으로 설정됩니다.

replace 요소는 단순 토큰 대체 메커니즘으로 사용됩니다. 보다 복잡한 토큰 형식화가 필요하거나 규칙을 변경하지 않고 메시지 텍스트를 변경하는 기능이 필요한 경우 ResourceMessage를 대신 사용하십시오.

참고: Cúram V6 이전에는 XmlMessage가 임베드된 XML 문자 주변의 공백을 잘라냅니다. Cúram V6부터는 XmlMessage가 더 이상 공백을 잘라내지 않으며 XML 문자의 소스 형식을 유지합니다(XML 주석 제거).

Cúram V6 이전에 있던 XmlMessage의 잘라내기 동작이 필요한 경우 개발 환경에서 애플리케이션 환경 변수 curam.creole.XmlFormat.enableWhitespaceTrimmingtrue 값으로 설정해야 합니다.

프로덕션 환경에서 curam.creole.XmlFormat.enableWhitespaceTrimming 환경 변수의 값이 동적으로 변경되면 시스템에서 XmlMessage 표현식을 사용하는 규칙 속성에 종속된 파생 데이터가 저장된 모든 속성 값 인스턴스를 다시 계산하도록 확인하는 단계를 수행합니다.

<?xml version="1.0" encoding="UTF-8"?>
<RuleSet name="Example_XmlMessage"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation=
"http://www.curamsoftware.com/CreoleRulesSchema.xsd">
  <Class name="XmlMessageExampleRuleClass">

    <Attribute name="emptyMessage">
      <type>
        <javaclass name="curam.creole.value.Message"/>
      </type>
      <derivation>
        <!-- XML이 전혀 포함되지 않음 -->
        <XmlMessage/>
      </derivation>
    </Attribute>

    <Attribute name="simpleHtmlMessage">
      <type>
        <javaclass name="curam.creole.value.Message"/>
      </type>
      <derivation>
        <!-- XmlMessage를 사용하여 XML 요소가
             올바르게 시작되어 종료되었는지
             확인할 수 있습니다(예: <b> 및 </b>). -->
        <XmlMessage>The following text will appear in bold in a
          browser: <b>Some in bold text.</b>
        </XmlMessage>
      </derivation>
    </Attribute>

    <Attribute name="tokenReplacementHtmlMessage">
      <type>
        <javaclass name="curam.creole.value.Message"/>
      </type>
      <derivation>
        <XmlMessage><p/>This calculated number will appear in
          italics and formatted according to locale preferences:<i>
            <replace>
              <arithmetic operation="+">
                <Number value="1.23"/>
                <Number value="3.45"/>
              </arithmetic>
            </replace>
          </i>
          <p/>And here's a resource message: <replace>
            <ResourceMessage key="simpleGreeting"
              resourceBundle="curam.creole.example.Messages"/>
          </replace>
        </XmlMessage>
      </derivation>
    </Attribute>

  </Class>

</RuleSet>