2

I want to know what is difference between this 2 ELEMENT tag :

<!ELEMENT bank (account*, customer*, depositor*)>

and

<!ELEMENT bank (account | customer | depositor )*>

thanks.

amir amir
  • 3,375
  • 7
  • 26
  • 29

2 Answers2

1

In a nutshell, the first ELEMENT declaration is saying the child elements have to be in a specific order. The second ELEMENT declaration is saying the child elements can be in any order.

The following means: a bank element containing zero or more account elements, followed by zero or more customer elements, followed by zero or more depositor elements. (In that specific order.)

<!ELEMENT bank (account*, customer*, depositor*)>

The following means: a bank element containing zero or more account or customer or depositor elements (in any order).

<!ELEMENT bank (account | customer | depositor )*>

The ',' means "followed by" and the '|' means "or". The '*' means zero or more. Also, a '+' means one or more (at least one).

Daniel Haley
  • 51,389
  • 6
  • 69
  • 95
-1

It denotes a regular expression. Though I'm not very good at that, I think the second tag accepts sub-element of either account or customer or depositor.

Niranjan
  • 813
  • 2
  • 12
  • 33