Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Ensure that the source and target schemas are loaded and all their elements are listed under their respective nodes.
  2. Click the target element for which you want to add a comment.
  3. Click the Node tab displayed in the Mapping Graph Area. All tabs of the Node tab are displayed.
  4. Click the Properties tab. The Properties pane is displayed (refer to Figure 548).
  5. Click the Comments property field and enter the comment for the selected target element (see Figure 550).

    Figure 550: Enter Comment

  6. Click Save Properties. This adds the comment and displays it next to the target element. If you shift focus to another node, or click any of the Mapping Rules, Textual Rules, Global Variables, Properties, XSL or Debugger tabs, without saving the comments, an alert message is displayed (refer to Figure 522).
  7. Click No to save the comments and shift focus to the other object. If you click Yes, then the defined comments are cleared and the focus is shifted to the other object.

    Info

    Once a comment is added to a target element, the letter (CM) is displayed next to the target element. This signifies that a comment has been created for the target element. Refer to Table of Suffixesfor details on suffixes displayed next to a target element.

    Anchor
    SR
    SR
    Setting Sorting Rules
    You can set sorting rules for a target element. It is used to sort value of elements in the generated output. While generating the output XML, the value of elements can be sorted either in ascending or descending order. For example, records of the employee can be sorted based on their salaries. Figure 551 shows input XML before sorting.

     

    Code Block
    languagexml
    <?xml version="1.0" encoding="UTF-8"?> 
    -<employees>
    -<employee attribute="14" attribute1="15">
      <TESTCASENO>TESTCASENO1</TESTCASENO> 
      <DESCRIPTION>DESCRIPTION1</DESCRIPTION> 
      <NAME>John</NAME> 
      <ADDRESS>Address1</ADDRESS> 
      <EMAILID>EMAILID1</EMAILID> 
      <PHONENO>PHONENO1</PHONENO> 
      <DOB>DOB1</DOB> 
      <DEPT>DEPT1</DEPT> 
      <SALARY>10000</SALARY> 
      <DOJ>DOJ1</DOJ> 
      <DESIGNATION>DESIGNATION1</DESIGNATION> 
      <AGE>34</AGE> 
      </employee>
    -<employee
    attribute="14" attribute1="15">
      <TESTCASENO>TESTCASENO2</TESTCASENO> 
      <DESCRIPTION>DESCRIPTION2</DESCRIPTION> 
      <NAME>David</NAME> 
      <ADDRESS>ADDRESS2</ADDRESS> 
      <EMAILID>EMAILID2</EMAILID> 
      <PHONENO>PHONENO2</PHONENO> 
      <DOB>DOB2</DOB> 
      <DEPT>DEPT2</DEPT> 
      <SALARY>8000</SALARY> 
      <DOJ>DOJ2</DOJ> 
      <DESIGNATION>DESIGNATION2</DESIGNATION> 
      <AGE>45</AGE> 
      </employee>
    -<employee attribute="14" attribute1="15">
      <TESTCASENO>TESTCASEN3</TESTCASENO> 
      <DESCRIPTION>DESCRIPTION3</DESCRIPTION> 
      <NAME>Ricky</NAME> 
      <ADDRESS>ADDRESS3</ADDRESS> 
      <EMAILID>EMAILID3</EMAILID> 
      <PHONENO>PHONENO3</PHONENO> 
      <DOB>DOB3</DOB> 
      <DEPT>DEPT3</DEPT> 
      <SALARY>15000</SALARY> 
      <DOJ>DOJ3</DOJ> 
      <DESIGNATION>DESIGNATION3</DESIGNATION> 
      <AGE>36</AGE> 
      </employee>
      </employees>
    Code Block
     

    Figure 551: Sample Input XML   


    Figure 552 shows the Output XML after sorting.

    Code Block
     code
    language
    xml
    <?xml version="1.0" encoding="UTF-8"?> 
    -<employees xmlns:java="http://xml.apache.org/xslt/java" xmlns:str="http://exslt.org/strings">
    -<employee attribute=""attribute1="">
      <TESTCASENO>TESTCASEN3</TESTCASENO> 
      <DESCRIPTION>DESCRIPTION3</DESCRIPTION> 
      <NAME>Ricky</NAME> 
      <ADDRESS>ADDRESS3</ADDRESS> 
      <EMAILID>EMAILID3</EMAILID> 
      <PHONENO>PHONENO3</PHONENO> 
      <DOB>DOB3</DOB> 
      <DEPT>DEPT3</DEPT> 
      <SALARY>15000</SALARY> 
      <DOJ>DOJ3</DOJ> 
      <DESIGNATION>DESIGNATION3</DESIGNATION> 
      <AGE>36</AGE> 
      </employee>
    -<employee attribute="" attribute1="">
      <TESTCASENO>TESTCASENO1</TESTCASENO> 
      <DESCRIPTION>DESCRIPTION1</DESCRIPTION> 
      <NAME>John</NAME> 
      <ADDRESS>Address1</ADDRESS> 
      <EMAILID>EMAILID1</EMAILID> 
      <PHONENO>PHONENO1</PHONENO> 
      <DOB>DOB1</DOB> 
      <DEPT>DEPT1</DEPT> 
      <SALARY>10000</SALARY> 
      <DOJ>DOJ1</DOJ> 
      <DESIGNATION>DESIGNATION1</DESIGNATION> 
      <AGE>34</AGE> 
      </employee>
    -<employee attribute="" attribute1="">
      <TESTCASENO>TESTCASENO2</TESTCASENO> 
      <DESCRIPTION>DESCRIPTION2</DESCRIPTION> 
      <NAME>David</NAME> 
      <ADDRESS>ADDRESS2</ADDRESS> 
      <EMAILID>EMAILID2</EMAILID> 
      <PHONENO>PHONENO2</PHONENO> 
      <DOB>DOB2</DOB> 
      <DEPT>DEPT2</DEPT> 
      <SALARY>8000</SALARY> 
      <DOJ>DOJ2</DOJ> 
      <DESIGNATION>DESIGNATION2</DESIGNATION> 
      <AGE>45</AGE> 
      </employee>
      </employees>
    Code Block
     
    Figure 552: Output XML

     

    Info

    The Sorting rules can be set only for record where For Each Mapping or Apply Template is used. The <xsl:apply-templates> element applies a template to the current element or to the child nodes of the current element, when the parent elements of source and target schemas are mapped.

     
    Steps to set Sorting Rules

...