Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
1.5 KiB

  1. XML Parsing:
  2. To be fast, xml parsing in MARS should use IXMLParser instead of
  3. the full IXMLDomDocument. The IXMLDomDocument prepares a full structure
  4. which can be walked through while the IXMLParser just calls back functions
  5. like CreateNode and BeginChildren, allowing the client to create his own
  6. structure or ignore the calls as it choses.
  7. We've provided a helper class, CMarsXMLFactory, to handle the IXMLParser
  8. callbacks. CMarsXMLFactory communicates with you, the client, through
  9. a CXMLElement class; you should derive your application-specific class from
  10. CXMLElement. The CXMLElement way is a structured way that makes it a little
  11. simpler to handle the parsing than using the callbacks. If you feel that it
  12. is too restrictive, however, you should feel free to make your own callback
  13. IXMLNodeFactory class.
  14. CMarsXMLFactory as well as the base class CXMLElement are declared/defined
  15. in parser.h/parser.cpp. ALso provided is the CXMLGenericElement class, which
  16. basically recreates the DOM all over again - you pass it allowed children and
  17. attributes, and it will handle AddChild, SetAttribute, etc, for nodes of the
  18. given name. This class should only be used when you're using it on simple types
  19. like <name> or <width> or something; I suggest you do not use it on any tag type
  20. with a large amount of semantic content; implement those yourself!
  21. An example using the CMarsXMLFactory is some code used to load the mars panel
  22. scheme from an xml file. That code is in marsload.h/marsload.cpp.