repeated definition of certain element

  • Hi,

    What happens if the same element is defined multiple times and possibly with different attribute settings? For example, if I have the following xml structure
    a.xml:
    <include url="b.xml>
    <display fps="30">

    b.xml:
    <display fps="60">

    which display element will be effective? the one in a.xml or b.xml?

    Thanks,

  • Hi,

    it works that way:

    1. at first - all <include> elements will be resolved,
      that means the included file will be loaded and inserted in the original xml structure where the <include> element was,

      e.g.
      a.xml:

      Code
      <include url="b.xml>
       <display fps="30">

      and
      b.xml:

      Code
      <display fps="60">

      will finally become:

      Code
      <display fps="60">
      <display fps="30">
    2. then all elements will be parsed from top to down,

      that means during parsing first:
      display.fps=60

      will be set, but then with the next line:
      display.fps=30

      will be set and the first setting be overwritten,
      so after parsing the value for display.fps will be 30.


    Best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!