Eclipse used for the development of XML
Abstract: This paper outlines the Eclipse platform to support XML (Extensible Markup Language, Extensible Markup Language) development. Eclipse does not directly support XML code editor. However, because Eclipse is a developer tool used to build the platform-independent framework, it can be relatively easy to add new language support.
Has developed a plug-in many XML, the new plug-ins have been able to create. This paper mainly discusses XMLBuddy called plug-ins, because it rich feature set required to develop XML document contains most of the functions. We will also mention other plug-ins, these plug-ins for specific tasks to provide a richer set of user options. This will allow you familiar with the basic editing functions of XML, but to remember: Eclipse is an untold numbers of tools and features you use the dynamic framework sets.
Eclipse XML Editor
Eclipse has been included in a very simple XML editor source code, the editor only XML syntax highlighting. It has inherited org.eclipse.ui.editors categories included in the package, the package for the Eclipse platform provides a standard text editor and file-based document provides procedures. This simple XML Editor play the role of the code examples, you can use it as their own Eclipse XML plug-in basis. Its source code can only be generated through the Eclipse project wizard, you need to use the following described themselves compile it.
To build this basic XML Editor, go to the menu File => New and select Project. Wizard in the project, select Plug-in Development => Plug-in Project.
If you do not see Plug-in Development Options, said Eclipse Platform Runtime Binary no Plug-in development environment. Please eclipse.org download page (please refer to the references in this paper to get behind the link) to download the Eclipse platform Plug-in SDK.
Click Next. Named to the project (such as org.my.eclipse.xmleditor), click Next, followed by a screen Plug-in Project Structure on the default values. Then choose Create a plug-in project using a code generation wizard, then select Plug-in with an editor options. Wizard will automatically generate the XML editor's source code.
But still compile it. Click Next, then in the next screen Simple Plug-in Content, click Finish options; transferred to the Project menu and select Rebuild All to build the project.
Next need to use File => Export menu creation editor.jar document. Please withdraw from the Eclipse, and then copy the entire org.my.eclipse.xmleditor plugin directory. When you run again Eclipse, an XML document can be added to your project, the understanding of XML syntax highlighted how work (see Figure 1). Please remember this sample XML editor did not provide any certification or a syntax checker.
<table Border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td>
</ Td> </ tr> </ table> <table class="no-print" cellspacing="0" cellpadding="0" align="right"> <tr align="right"> <td>
<table Border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="middle">
</ Td> <td valign="top" align="right"> </ td> </ tr> </ table> </ td> </ tr> </ table>
XMLBuddy prepared using XML
The most popular and most senior Eclipse XML Editor plug-in is the development of the XMLBuddy Bocaloco Software (see Reference to obtain link). XMLBuddy is free plug-in, it adds Eclipse XML editing capabilities, including user-configurable syntax coloring, DTD-driven code support, validation and synchronization outline view. XML Buddy Workspace also add XML perspective, to XML documents and add new projects DTD template. You can install as any other Eclipse plug-ins installed as XMLBuddy: Simply plug-compressed files to decompress the Eclipse installation directory \ eclipse \ plugins subdirectories can be. Remember to restart Eclipse. Figure 2 shows the operation XMLBuddy.
XML is the meta tag language. XML element from the initial marking, and marking the end of the data between the two components, it has also highlighted the need grammar good editing features. XMLBuddy (currently at version 0.2) with the following extensions Eclipse XML Editor:
- Formatting. Can choose from all or part of the code of the whole or part of XML documents automatically formatted documents.
- High syntax coloring. By Window => Preferences => XML => Colors menu configuration XML code coloring. Coloring can be used for ordinary XML documents, DTD (internal or external subset) and the JSP document. Figure 3 shows how to change syntax highlighted by default.
- XML code support. According to a document DTD, or other elements can be labeled names, attribute names and attribute values provide paramedic.
- Expanded Unicode support. XMLBuddy According to automatically detect XML 1.0 specification document coding, it accepted
<? Xmlcoded statement (provided if any). Can be for all XML documents or only for certain specified default encoding a file (see the following XML code and verify their characters code). - Outline (Outline) view. Documents outline view window display elements in the structure. Default, the outline and edit dynamic synchronization. This allows you to quickly browse documents logic.
- DTD generation. Can be dynamically generated from the content of documents DTD. XMLBuddy in the local cache of Internet-based DTD, and whether to use DTD documents relating to the number of times they just downloaded a.
<table Border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td>
</ Td> </ tr> </ table> <table class="no-print" cellspacing="0" cellpadding="0" align="right"> <tr align="right"> <td>
<table Border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="middle">
</ Td> <td valign="top" align="right"> </ td> </ tr> </ table> </ td> </ tr> </ table>
XML code and verify their characters coding
Using XML document examination of the major difficulties is that its internal validity (document logical cohesion). The need to implement syntax check to see whether all the markings and definitions are correct and the call was correct. Only after the adoption of grammar check can be confirmed XML document formats and can be good analytical document the logical structure. XML documents verified by the XML parser.
All of the following description of the Eclipse XML plug-in the implementation of XML can verify that the code warnings and errors. Any attempt to open an XML file, XML parser may generate a mistake. Retrieval can be precise error code, or even the wrong text that will lead to wrong. In the XML documents necessary certification, or save your document automatically verified. Verification tasks can be wrong as a group to get rid of. XMLBuddy plug-in system-wide use of XML parser, but please remember the Eclipse platform with one of the best XML parser: Xerces (XML4J). Please refer to reference materials to obtain download information. But is not limited to Xerces parser or system, it can use Run => External Tools => Configure XML parser at the other.
Another important function is to support XMLBuddy different character encoding. Sooner or later this will be used, for example, when the need to use different languages (such as Polish and English) can be prepared by the XML documents when transplanted. This is not a simple task, because the Polish character encoding are the three major ways: first, by the use of the Windows 9x/2000 Windows Latin-2 (CP1250) and the other is the use of the Internet as well as UNIX and UNIX-like systems (such as Linux) using the ISO Latin-2 (ISO8859-2); The third is that the MacOS and MacOS X, the Polish they use different character encoding standards.
Usually, the character encoding XMLBuddy offers two solutions: According to the contents of the documents automatically detect XML document encoding, or be set to the default number. Default coding space in the scope of work, but also to specific resources. To open the XML encoding the first option, choose Window => Preferences => XML => Encoding.
These character encoding for the solution lies in the question: XML, a coding (each table a) can not meet all the conditions. XML documents from around the world may be any number of sources. In many cases, users can not control other people on the document encoding, and may not by coding demarcation work. The same coding preferences at the same time it will be very difficult for (say) Java source files and XML documents. When a group of the first option can not meet the overall needs, XMLBuddy provide documentation for each attribute. Specified projects in the attributes of each document is an onerous task. However, when a document to be dealt with the use of a common code does not (can not automatically detect the coding, and no specified in the document), the attribute is the only solution. To open a specific document coding attributes of the file, click the right mouse button and select Properties => XML => Encoding. Figure 4 shows how to set up the overall character encoding.
<table Border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td>
</ Td> </ tr> </ table> <table class="no-print" cellspacing="0" cellpadding="0" align="right"> <tr align="right"> <td>
<table Border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="middle">
</ Td> <td valign="top" align="right"> </ td> </ tr> </ table> </ td> </ tr> </ table>
DTD vs. XML Schema
XML Schema designated XML Schema definition language, the language provides a description of the XML 1.0 document structure and content to limit their tools, including those who use XML Namespace tool. Model with its own language and XML 1.0 that the use of the name space, remodeling it to a large extent with the XML 1.0 DTD capacity, and to a certain extent, the expansion of these capabilities. Remember DTD there are many limitations:
- The complex needs often difficult to use as models.
- Do not support the name space.
- On the modular and reusable support is very limited.
- Do not support the statement expansion or succession.
- Preparation, maintenance and read large DTD and definitions related model very difficult.
- No embedded structure of the self-documentation (self-documentation) (Only
- Content and attribute the statement attributes or elements can not rely on the context (many XML language used this point, but their DTD must "allow too many things").
- Use only a simple logo attribute mechanism (in other words, not only of the scope).
But XML Schema also have shortcomings:
- XML Schema complex; need only occasional use of XML programmers might find some rare overdo it.
- XML Schema can not request specific root element (Thus, even the most simple certification documents also requested additional information).
- When the description of mixed content, they simply could not binding character data.
- Content and attribute the statement attributes or elements can not rely on the context (which is also the main DTD).
- Can leave the statement specified default values.
- Elements default values can only character data (not included markings).
XMLBuddy the DTD and Schema has been providing enough support, but if you really need excellent XML Schema support, the use of XSD-XML Infoset Browser for Java plug-ins (see reference to obtain link). It is in accordance with the W3C XML Schema standard, as described in the realization of the XML Schema Infoset Model Java reference library. It has any inspection, XML Schema to create or modify code are very useful. XML Infoset Browser provides operating XML Schema Component API, and the operation of a series of XML documents to the XML Schema (DOM can be visited) that the API. XML Infoset basically allow two or more programmers using Java and XML, to provide recognition and the creation of the model based on XML standard methods.
XML Infoset Browser is a necessary complement to IBM XML Schema Quality Checker, as SQC (see Figure 5 and references to obtain link). SQC is a Java program, access to W3C XML language model prepared by the XML Schema as input, and then the diagnosis Schema language incorrect use. SQC read line with the latest standard XML Schema Schema, and try to ascertain their Schema used in the various constraints under effective. SQC when they do not meet the standard elements, it gives diagnostic information, which may include information on how to amend the proposal. For many from Schema documents (these documents through the Inter -
<table Border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td>
</ Td> </ tr> </ table> <table class="no-print" cellspacing="0" cellpadding="0" align="right"> <tr align="right"> <td>
<table Border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="middle">
</ Td> <td valign="top" align="right"> </ td> </ tr> </ table> </ td> </ tr> </ table>
Other Eclipse XML plug-ins
Other useful plug-ins have Transclipse XML and Eclipse Tidy (please refer to reference materials to obtain link). Transclipse is XML conversion plug-ins. It consistent with JAXP by any of the XSL style sheet through XSLT processor handle XML documents, and using Apache Object Format Processor (Formatting Objects Processor, FOP) deal with XSL-FO documents. Transclipse is j2h (Java to HTML, Java to HTML) plug-in a part of j2h will be converted into Java source code with syntax highlighting HTML, XHTML and LaTeX. Eclipse Tidy projects provide formatting and printing XML / HTML documents plugin. Please visit the Eclipse plug-classified registry to obtain more information (see references).
<table Border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td>
</ Td> </ tr> </ table> <table class="no-print" cellspacing="0" cellpadding="0" align="right"> <tr align="right"> <td>
<table Border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="middle">
</ Td> <td valign="top" align="right"> </ td> </ tr> </ table> </ td> </ tr> </ table>
<table Border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="middle">
</ Td> <td valign="top" align="right"> </ td> </ tr> </ table> </ td> </ tr> </ table>
About the author <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td colspan="3"> </ td> </ tr> <tr align = " left "valign =" top "> <td>
</ Td> <td> </ td> <td width="100%">
Pawel Leszek Studio B is the author, he is an independent software consultant and writer, adept at Linux / Win / Mac OS systems architecture and management. He on many operating systems, programming languages and network protocols (particularly Lotus Domino and DB2) experience. Pawel LinuxWorld series or the authors of the articles, and is Polish version of the Linux PC World columnist. Pawel and his wife and a lovely little daughter living in Warsaw. Welcome your questions and comments; pawel.leszek @ ipgate.pl through contact with Pawel.
</ Td> </ tr> </ table>
<table Border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td>
</ Td> </ tr> </ table> <table class="no-print" cellspacing="0" cellpadding="0" align="right"> <tr align="right"> <td>
<table Border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="middle">
</ Td> <td valign="top" align="right"> </ td> </ tr> </ table> </ td> </ tr> </ table>
↑ Back






