Suggestions on the tools for step-by-step C and C programmers
Rick Parrish (Rfmobile@swbell.net) Independent consultant September 2001
This article is for C and C programmers who are not familiar with XML development, an outline of tools that are prepared for XML development. The tool table outlines the conventional XML tools, such as IDE and mode designers, parsers, XSLT tools, SOAP, and XML-RPC libraries, and others can be written in C and / or C or actually written in C and / or C . Library. This article includes suggestions for installing open source libraries on Windows, UNIX, and Linux, as well as a brief word of key XML terms.
It seems to be full of eyes, some new related tools related to the source code form are written in Java. Although Java has a clear advantage in the XML Arena, many C / C programmers are also developed in XML, and now there are now many XML tools available for C and C programmers. We will face an XML library problem such as verification, mode, and API models. Next, we will study the collection of routine XML tools, such as IDE and mode designer. Finally, we will summarize with a list and discuss the libraries that can be used in C and / or C or in C and / or C .
In this article, the debate about using XML will be skipped; I assume that you already have a full reason to wait for this technology. In addition, we will leave XML more detailed instructions to tell the background resources in the reference materials. As long as XML is a standard (not only a file format), it is enough. The data can be exchanged in the form of an XML format, or exchange over a network connection, which is short-lived before the online transaction is over or the network connection is abandoned.
In addition, this article is not a comparative review of the evaluation tool. My purpose is to illustrate the type of tool you may need and point to you to possible candidate tools. You still need to study, test and compare tool features based on project needs to assemble the final toolbox.
Two sets of tools To merge XML into their own software, there should be two tools in your toolbox. The first set is a dialect designer (or more appropriately called "mode designer"). The second set of tools includes a software library that adds parsing and XML generation characteristics to the application.
Designing your own XML dialect XML dialect is just a special set of XML tags, as well as some rules on how to combine these tags. At present, two main ways to specify or define an XML dialect are through document type definition (DTD) or XML mode. I will call both the two.
Your project domain may have a specific mode for you. If not, you can create your own mode using a plain text editor. More fine method is to use the true dialect designer that can check the syntax. (This mode does not work when you try to verify XML data in the future.)
Design Tools Currently, most programmers' text editor - especially text editor found in IDE - has a regular macro and template support, can be used for some features, such as syntax highlighting and automatically completing partial input words or phrases . Therefore, I omitted discussions about any XML editor that only performs syntax highlighting and auto-completion. Microsoft Word or Emacs Macro can implement these features, so the "XML editor" should have more features.
The tools shown in Table 1 are divided into three categories:
IDE (integrated development environment, a Swiss army knife method) mode sensitive XML editor (supplemented in mode or DTD Structure and Property) mode designer (used to write your own mode or DTD) because of Table 1 All tools run applications, so they are suitable for all XML developers - not only those developers using C (different from those listed in other tables in this article).
Table 1. Dialect Design Tools of Various Platics
Product Description supplier license platform Turbo XMLTIBCO / ExtensibilityXML mode / DTD design and commercial IDE Java, Win32KomodoActive StateXML editor and IDE commercial Linux, Win32, XML SpyAltova for other XML editing and schema design business Win32XML NotepadMicrosoftXML IDE editor free Win32Morphon XMllunatech Research Sensitive XML Data Editor Business Javaxed Edinburgh University Mode Sensitive XML Data Editor Non-Commercial WIN32, Linux, Unixeenaibm AlphaWorks Mode Sensitive XML Data Editor Free Trial / Commercial Mac, Unix, Win32Visual Xmlpierlou Mode Sensitive XML data editor non-commercial JavaNetpaddPhillip LenssenMicrosoft of XML Notepad replacement for non-commercial Win32XMetalSoftquadDTD sensitive commercial Win32MerlotChannelpoint visual XML editor XML editor; DTD support plug-ins for non-commercial JavaXML ValidatorElCel Technologies XML validation tool command-line non-commercial Win32XML CanonElCel Technologies by XML Data and DTD merge to generate specifications XML non-commercial WIN32
The remainder of C and C Tools This article provides the basis for adding XML functions to C / C programmers through a software library. In the next part of this article, you will find more command-line utilities, and the software library contains them as testing and / or sample programs. For example, Transformiix can be used as a library, Perl module, or command line tool.
So far, I tried to use the terminology related to XML. However, before you learn more, if you are not familiar with XML basic knowledge, you may also browse the terminology defined in the XML term side. These terms will help you understand the rest of this article and help you pick out their characteristics in your own tools and libraries mentioned in person.
Once you have DTD or mode, you need a parser to read and interpret the XML document. Table 2 outlines the parser library of C / C developers. However, when you start your research table, you need a little background knowledge.
Verify that there are two forms of XML parsers: verification and non-verification. Which one do you need? If you don't use a formal DTD or mode, the verification feature is not important for you. If you already or is planning to use DTD or mode, you may be the first verification parser. (In this case, I recommend you learn how to read and manually write DTD / mode, so you can handle errors when you have a verification problem. Sometimes, errors are in DTD / mode, so you can debug DTD / Mode file and XML data.)
The parser API model is used to combine the software and the XML parser is: document model and event model. The document API model parses XML data to generate an object. The object abstracts the content of the document into a tree structure. The application operates this tree structure object. The event API model uses a callback mechanism to communicate the structure of XML data to the application. Event / callbacks are usually happening when parsing. API Standard: The DOM and SAX General parser API model have been further improved to a specific API standard. W3C has recommended DOM (level 1 and 2, grade 3 is drafting) as a standardized document API model. Although SAX is not a W3C project, it has posted the status of the fact that the actual standard event API model.
W3C Standard When comparing features in the parser and other XML tools, look for W3C recommendations and areiced for support, such as namespace, XPath, XLink, xinclude, and xinfoseet. Keep in mind that XML technology is mature and very fast, and support for the first level specification (such as DOM) may lack important functions introduced in the second level of this specification. If the latest specification form is important for your project, select the tool accordingly.
Read the following table In Table 2, the "Event" column specifies the parser that supports a push or event model API (such as SAX). The "Document" column specifies the parser that supports the pull or document model API (such as a DOM). As with the previous, the table lists the business and non-commercial tools (see Side Bar IPAddressing License for Details About Software License).
Table 2. Analytics of C / C developers
Library Supplier Event Document Features License Expatjames Clark / Expat Group This machine and SAX-with this API and SAX packaging, very fast push model parsers. LGPL (free) libxmlgnomsaxdom is very strong; SAX and DOM package; execute DTD verification LGPL (free) MSXmlMicrosoftSaxDomwin32 Microsoft XML library EulandAxDom execute SAX and DOM level 1 and 2; DTD verification; Added XML mode Apache (Free) XTLVID CREAXDOM with STL-based XML toolbox with SAX and DOM - This machine verifies the XML parser GPL (free) XML4CIBM AlphaWorkssaxDomibm, a NML, XML parser GPL (free) XML4CIBM AlphaWorkssaxDomibm ) Oracle XDK 8iraclesaxDomoracle is sponsored for C XML tool box non-commercial PULL PARSEREXTREME! LAB - Lightweight XML toolbox for C , Indiana University, non-commercial XML Boosterphidani Software-native parser Generate C Source Code Resolution Commercial
Open Source The first three most popular open source XML libraries are Expat, LIBXML, and Xerces. All the three are cross-platform, each acting as the basis for the XSLT library implementation, once it satisfies the basic XML need, it will give you a growing way.
EXPAT is an XML resolution library founded by James CLARK's open source-oriented event. He has transferred the project to a group of SourceForge. There is a SAX package available. Expat parsers can be found in many projects such as open source browser Mozilla, XSLT processor Transformiix and RDF tool Repat. LIBXML provides a double mode API for operations similar to SAX and DOM. It supports verification of DTD and is used in the gnome XSLT processor libxslt. LIBXML has been rewritten, and has been released as libXML (2), perhaps it is also known as libxml2. Users of this library should make sure they have the current version. Xerces is very sturdy, with a large number of libraries that act as the IBM AlphaWorks XML4C library. XERCES is also used in the Apache XSLT processor Xalan. XERCES supports DOM, SAX, and verification of DTD. The latest version reads and explains some "W3C XML Mode Recommendations" (intended to implement intact XML mode support by the end of 2001). Compiling these three most popular libraries and links to your project. Most packages include detailed description of each platform. Here is some sample installation instructions.
Building an open source library on Windows is a simple four steps on Windows.
Download the source Tarball file. Use programs such as WinZip to decompress the content into a directory. Please confirm that the compressed utility keeps the path name of any subdirectory that libXML may need. Locate ./win32/dsw file in the libXML2.DSW file in the folder and open it from MS Developer Studio. Select Build ALL from the top menu in DevStudio. This will build all samples and test programs, as well as the LIBXML DLL that runs them.
You can build Xerces on Windows using the above steps. The only difference is to find the Samples.dsw workspace file in the ./c/samples/projects/win32/vc6 subfolder.
EXPAT has begun to include the DSP project Makefile. Check the lib and xmlwf subfolders.
Building an open source library on UNIX For items running on Linux or UNIX, in most cases, you can set the source code unpack (Untar) to an empty directory, set some options, then enter "make" to build Shared library. Solaris users: Don't forget to use the GNU unpackage utility. In the Bash Shell under SLACKWARE Linux, I use the following code:
TAR -X
XML and Commsxml are the patented XML provided by Microsoft for the Windows Series operating system, which is implemented as a built-up COM object collection, so you can work well in other locale and provide a large number of documents. This library supports the DOM, and there is a local interface for the document. It also supports SAX events.
As an alternative to MSXML, the Xerces library of "Apache XML Project" comes with a COM package, which allows it to act as msxml imitation products in many cases. Vivid Creations offers SAX and DOM API COM packages in its XTL library, which is also an alternative to MSXML.
XML conversion: XSLT and XQuery conversion are the next step from the XML development process from just in the element and attribute level. XML conversion is operated on the XML data to generate an XML output. Conversion can reissue tag structures, add / remove tags, and properties, and filter to enlarge the selected part of XML data. The xQuery document will refer to the conversion process as a query, but the meaning is the same.
XSLT and XQuery are XML dialasses for specifying how this will perform such an operation for random XML data. You can write a script file, modify the XSLT or XQurey instead of XML, replacing some XML data into the DOM, and must manipulate the DOM version to generate the desired result. This more common method will produce better flexibility and will shorten the development time. Now, your web developer (they are not C / C programmers) can write their own XML conversion, which allows C programmers to complete more complex work.
Table 3. C / C conversion / query library
LibxSltgnome Subsequent LibXSLTGNOME Build a Non-commercial Xalanapache to build on the Xerces parser Apache (free) Transformiixmitre Build XSLT processor Non-commercial XSLTColiver GerardinxSLT compiler, generate C code non-commercial SABLOTRONGINGINGER Alliance ×Sl Engine non-commercial
Message delivery: XML-RPC and SOAP tools are for message delivery to make two software agents communicate with each other. This message is transmitted sometimes referred to as a message-oriented middleware. (This is not similar to the message delivery of AOL, MSN or ICQ, knowing? Now there is an XML-based instant messaging protocol that is still in the unfinished phase, called Jabber. I have included a link in the reference material to meet Your curiosity, but once again, it is not something I want to discuss here.)
Message delivery using XML is very popular, so that two alternatives have been generated: XML-RPC and SOAP. The most significant features of these protocols are based on the tool selection of the developer for implementation, the client, server, and the same level device may be large. Although all developers are used to using their favorite language, development toolboxes or software libraries, they can still cooperate.
(Incidentally: Gregor Purdy has written an excellent XML-RPC review (see Resources) with a proposed alternative method (see Resources)).
Table 4 includes some libraries for a message middleware category. This is not a detailed list of resources in this category, and some new tools are developing rapidly, but it is a good start.
Table 4. C / C Message Passage
Library supplier feature license platform 4S4C SOAP service Simon Fell open source SOAP results non-commercial Linux, UNIX, WIN32SOAP client SQL Datac SOAP client toolbox commercial Win32soap component mozilla.org can be available XPCOM components Non commercial business Many XML-RPC for XML-RPC library prepared in C / C First Peerca, united, unix, Win32XML-RPC components Mozilla.org can be available XPCOM Components Non-commercial XML-RPC for C / C Epinionsc language Written XML- RPC library is un commercialumer Linux, UNIX, WIN32
Exclusion Foreign tools should give your XML toolbox a good starting point. If you want to recommend other C / C tools that have already been tried or to publish any other comments, please join the discussion attached here (please use the link in "Reference" or click on the top or bottom of the article page. "Discussion" icon). XML terminology
These XML terms may be used in your understanding of the library that is discussed herein:
Document Model: It is also known as a "pull" model for analyzing and manipulating XML data as a tree object. See the DOM API standard as an example. DOM: "Document Object Model" is a special tree structure programming model of the XML document, and W3C describes it into a standard. The DOM standard is currently divided into three levels. DOM 1.0 refers to the DOM level 1.0 consistency; the DOM level 2 is the latest specification, W3C is recognized as "recommendation"; DOM level 3 is drafting during this article. DTD: Document Type Definition. An XML file defines an XML element and the XML attribute of those elements, and specifies how to nested XML tags and elements can contain rules that can contain any data. Please refer to the XML and DTD introduction of Jane Fung to get more details. Event Model: It is used to parse XML data by using a callback or handler; also known as "push" model. For example, see the SAX API standard. Name Space: Clearly identify XML tags from different DTDs or patterns so they can be mixed in the same XML document. RDF is very dependent on this feature; XML 1.0 tag "XMLNS" can be used to define namespaces in the XML document. RDF: Resource Description Framework for compressed XML dialects associated with XML attribute data and usually residing within elsewhere. Your driver license is similar to describing your RDF XML file. SAX: Simple API for XML is a standard programming interface for XML parser implementation; SAX uses an event-oriented programming model. SAX is the fact that David Megginson, the earliest standard, and is now maintained by the XML-DEV mailing list. SOAP: "Simple Object Access Protocol" is a network protocol similar to XML-RPC (see XML-RPC). By using SOAP, the application can create a remote object, call the method on the object, and retrieve the results. Verification: Regarding DTD and mode, verify that the XML document is correct. Good structure: an XML document, its markings and data complies with XML 1.0 syntax. W3C: World World Wide Web Alliance, it has become an important standard main body of most XML related technologies. W3C will refer to "recommendation" (instead of standard). XML 1.0: W3C's first XML grammar standard; establishing the basic rules of XML data, such as all tags must end with slash (/), such as:, or followed one end tag, such as: Close the tag on your Way Out. XML-RPC: XML Remote Process Call. XML-RPC is a standard XML dialect for cross-network calling methods and services; as you think, XML-RPC uses XML to communicate messages between clients and servers. XML Mode: XML mode is a W3C recommendation, which is similar to DTD for defining the structure of an XML document, but has better flexibility. XML mode uses XML 1.0 syntax to specify mode, which is opposite to the Early SGML syntax for DTD. XQuery: The features are similar to XSLT, but designed more conducive to Query languages that act as XML data - similar to using SQL in relational databases. As a specification, it is not as good as XSLT matures, XQuery may become SQL in the next decade.
XSLT: Extensible Styles Language Conversion, an XML dialect for converting XML content. Apply the XSLT file to some XML input data to generate the desired XML output data. Reference
Add you to the insights or problems of the C / C tool to the discussion of this article. (You can use this link, or click the "Discussion" icon at the top of the page or bottom.) Please visit the W3C XML page, which provides most of the content in the XML specification. Please visit the summary site of XML related software. Use ZVON's general XML tutorial or developerWorks Doug Tidwell's XML entry and other courses in the XML area teaching area to obtain XML basics. Please read the XQuery introduction of Howard Katz. Please read the excellent critique of XML-RPC written by Gregor Purdy carefully. Learn the basics of DTD in Jane Fung's article XML and DTD profile. Please in Michael Kay Technical Overview What type of language is XSLT? Learn about XSLT. Please understand the information of other types of messaging (instant messaging) on Jabber. Have XML developer skills by carefully studying the XML Certification Guidelines of IBM Certified Developer Program.
The XML standard mentioned herein
XML specification 1.0: W3C core XML 1.0 specification. DOM Level 1.0: W3C Document Object Model Level 1 API Recommended. DOM level 2.0: W3C Document Object Model Level 2 API Recommended. SAX / SAX2: Simple API for XML Event Model Facts. Name Space: Handling W3C recommendation for XML namespace. XML mode: everything about W3C XML mode recommended
About the author rick is an old qualified programmer, his career is a stock and overcomes the deadline, and gives the female hospitality to make their blush generous tips. His name has spread throughout each café in the town. He also likes to express a speech at a technical-oriented seminar. His design is newly related, and now he is studying more trendy modeling methods, such as UML. The hot rod of his car is written: "i for xhtml.". You can contact the Rick with RFMobile@swbell.net.