home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / exml.lha / exml / main / xml_start_tag_abs.e < prev    next >
Text File  |  1999-04-13  |  2KB  |  90 lines

  1. indexing
  2.     description:"Objects representig a XML-start tag"
  3.     status:        "See notice at end of class."
  4.     author:        "Andreas Leitner"
  5.  
  6. deferred class
  7.     XML_START_TAG_ABS
  8. inherit
  9.     XML_TAG
  10.         rename
  11.             make_from_c as make_from_c_xml_tag
  12.         redefine
  13.             out
  14.         end
  15. feature {NONE} -- Initialisation
  16.     make_from_c (name_ptr, attribute_specifications_ptr: POINTER) is
  17.         require
  18.             name_ptr_not_void: name_ptr /= Void
  19.             attribute_specifications_ptr_not_void: attribute_specifications_ptr /= Void
  20.         do
  21.             !! attributes.make
  22.             make_from_c_xml_tag (name_ptr)
  23.             make_attribute_specifications_from_c (attribute_specifications_ptr)
  24.         ensure
  25.             attributes_not_void: attributes /= Void
  26.         end
  27.  
  28. feature
  29.  
  30.     attributes: XML_ATTRIBUTE_TABLE
  31.         -- table of all attributes
  32.  
  33.     out: STRING is
  34.         local
  35.             cs: DS_LINEAR_CURSOR [XML_ATTRIBUTE]
  36.         do
  37.             !! Result.make (0)
  38.             Result.append ("<")
  39.             Result.append (name)
  40.  
  41.             from
  42.                 cs := attributes.new_cursor
  43.                 cs.start
  44.             until
  45.                 cs.off
  46.             loop
  47.                 Result.append (cs.item.out)
  48.                 cs.forth
  49.             end
  50.  
  51.             Result.append (">")
  52.         end
  53.  
  54.     element (a_parent: XML_ELEMENT): XML_ELEMENT is
  55.             -- create a XML_ELEMENT with `a_parent' as
  56.             -- parent element from this tag
  57.         local
  58.             cs: DS_LINEAR_CURSOR [XML_ATTRIBUTE]
  59.         do
  60.             !! Result.make (a_parent, name)
  61.             Result.set_attributes (clone (attributes))
  62.         end
  63.  
  64. feature {NONE} -- Implementation
  65.     make_attribute_specifications_from_c (attr_spec_ptr: POINTER) is
  66.             -- attribute_specifications_ptr is a zero terminated array of pointers.
  67.             -- it points to pairs of name and value (each again zero terminated).
  68.         require
  69.             attr_spec_ptr_not_null: attr_spec_ptr /= default_pointer
  70.             attributes_not_void: attributes /= Void
  71.         deferred
  72.         end
  73.  
  74. invariant
  75.     attributes_not_void: attributes /= Void
  76. end -- class XML_START_TAG_ABS
  77. --|-------------------------------------------------------------------------
  78. --| eXML, Eiffel XML Parser Toolkit
  79. --| Copyright (C) 1999  Andreas Leitner
  80. --| See the file forum.txt included in this package for licensing info.
  81. --|
  82. --| Comments, Questions, Additions to this library? please contact:
  83. --|
  84. --| Andreas Leitner
  85. --| Arndtgasse 1/3/5
  86. --| 8010 Graz
  87. --| Austria
  88. --| email: andreas.leitner@teleweb.at
  89. --| web: http://exml.dhs.org
  90. --|-------------------------------------------------------------------------