Example 7     <<      >>       intro       contents     

An element can have none, one or several attributes. Permited characters are the same as for element names. The name of attribute is separated from its value by =. The attribute value must be given inside apostrophes '...' or double-quotes "..." . If an apostrophe or double-quote is used in the attribute value the opposite delimiter must be used.

  Well-formed documents   HOME     

Document with well formed attributes:

               <elements-with-attributes>
                    <el _ok = "yes" />
                    <one attr = "a value"/>
                    <several first="1" second = '2' third= "333"/>
                    <apos_quote case1="John's" case2='He said: "Hello, world!"  '/>
               </elements-with-attributes>
               
            

  Documents with errors   HOME     

Document with erroneous attributes:

               <errors>
                    <wrong_char a*b = "23432"/>
                    <mismatched_separator value = "12'/>
                    <wrong_separator_type  value="aa"aa"/>
                    <wrong_separator_type  value='bb'bb'/>
                    <wrong_start XML-ID = "xml234"/>
               </errors>