fm:remove

Use fm:remove to remove XML nodes (elements, text, other) from a DOM using XPath.

This is simple but dangerous as entire legs of data can be obliterated in one foul swoop.

SYNTAX

EXAMPLES

  1. Remove a whole leg

<fm:remove match="/*/PON15B"/>

  1. Remove specific elements under the root node

<fm:remove match="/*/FAC_NAME | /*/FAC_TYPE | /*/FIELD_NAME"/>

  1. Remove all chemicals where SELECT_FLAG is true [relative XPath]

<fm:remove match="./CHEMICAL_LIST/CHEMICAL[SELECT_FLAG='true']"/>

EXERCISES

Please use your XX_EMPLOYEEMODULE (where XX are your initials) file for the following exercises.

Exercise 1

Write a remove statement in the module’s entry-theme to remove the COMPANY_INFO from the Theme DOM.

NB: To see the change in effect, you will need to view the data in the Theme DOM.

Exercise 2

Write a remove statement in the module’s entry-theme to remove the last EMPLOYEE entry from the ROOT DOM.

NB: To see the change in effect, you will need to view the data in the Theme DOM.

Exercise 3

Rewrite the previous remove statement so that it removes the last EMPLOYEE’s elements, but leaves the EMPLOYEE element.

NB: To see the change in effect, you will need to view the data in the Theme DOM.

Exercise 4

Rewrite the previous remove statement so that it removes the whole EMPLOYEE_LIST.