XML editor: Difference between revisions

Content deleted Content added
BattyBot (talk | contribs)
m Removed non-content empty section(s), performed general fixes
 
(22 intermediate revisions by 17 users not shown)
Line 1:
{{unreferencedmore citations needed|date=SeptemberJune 20122023}}
An '''XML editor''' is a [[markup language]] editor with added functionality to facilitate the [[editing]] of [[XML]]. This can be done using a [[plain text]] [[text editor|editor]], with all the code visible, but XML editors have added facilities like [[word completion|tag completion]] and menus and buttons for tasks that are common in XML editing, based on data supplied with [[document type definition]] (DTD) or the XML tree.
 
There are also [[List of XML editors|graphical XML editors]] that hide the code in the background and present the content to the user in a more user-friendly format, approximating the [[Rendering (computer graphics)|rendered]] version or editing forms. This is helpful for situations where people who are not fluent in XML code need to enter information in XML based documents such as time sheets and expenditure reports. And even if the user is familiar with XML, use of such editors, which take care of syntax details, is often faster and more convenient.
 
==Functionality beyond syntax highlighting==
 
An XML editor goes beyond the syntax highlighting offered by many plaintext editors and generic source code editors, verifying the XML source based on an [[XML schema]] or XML DTD, and some can do it as the document is being edited in real time.<ref>{{Cite book |last=Goldberg |first=Kevin Howard |url=https://books.google.com/books?id=485Ol3iv2tAC |title=XML: Visual QuickStart Guide |date=2008-01-01 |publisher=Peachpit |isbn=978-0321559678 |edition=2nd |publication-date=2008-01-01 |page=110 |language= |chapter=8}}</ref>
Other features of an editor designed specifically for editing XML might include element word completion and automatic appending of a closing tag whenever an opening tag is entered.
These features can help to prevent typographically originating errors in the XML code.
Some XML editors provide for the ability to run an [[XSLT]] transform, or series of transforms, over a document. Some of the larger XML packages even offer XSLT debugging features and [[XSL-FO]] processors for generation of [[PDF]] files from documents.
 
<?xml version="1.0" encoding="utf-8"?>
==Textual editors==
<TrackedItemsList>
 
<FlowRecipeID Value="TestPP.BND"/>
Text XML editors generally provide features dealing with working with element tags. [[Syntax highlighting]] is a basic standard of any XML editor; that is, they color element text differently from regular text. Element and attribute completion based on a DTD or schema is also available from many text XML editors. Displaying [[line number]]s is also a common and useful feature, as is providing the ability to reformat a document to conform to a particular style of [[Indent style|indenture]].
<MaterialID Value="54321"/>
 
</TrackedItemsList>
Here is an example of edition in a text editor with syntax coloring:
 
[[Image:Xml_text_editor.png|an example of syntax coloring]]
 
The advantage of text editors is that they present exactly the information that is stored in the XML file. They provide a more granular way to control the formatting of the file (such as indentations), to do low-level operations (such as a find/replace on element names) and to edit XML files without any schema or configuration file.
 
==Graphical editors==
Line 35 ⟶ 31:
==WYSIWYG editors==
 
WYSIWYG editors let people edit files directly with the tags represented by some form of graphical viewing rather than bare XML code. Often, WYSIWYG editors attempt to emulate the end result of some transform or [[CSS]] stylesheet application. This emulation may or may not be possible, depending on the transformation from XML into the end result.
 
Naive use of a WYSIWYG editor can lead to the creation of documents that do not have the intrinsic semantics of the particular XML language. This comes about if the user is focused on trying to achieve a certain visual presentation with the editor, rather than using the WYSIWYG to make editing the document easier. For instance, someone creating a [[web page]] could use an H2 element (meaning: second level title) instead of H1 (meaning: first level title) because it looks smaller on their current WYSIWYG editor. Such an author is making a choice based on the apparent visual representation, but a visitor to the author's web page can offer a very different rendering in their [[Web browser|browser]].
Line 41 ⟶ 37:
However, as long as the underlying meaning of the document is understood by the author, and the author does not make decisions based on the exact look in the WYSIWYG editor, such an editor can be of value to the writer. It is generally much easier to read a document that is being rendered in some fashion than it is to read the raw XML code. Also, editing can be much more intuitive, as the WYSIWYG editor can use tools similar to many word processing applications. Some WYSIWYG editors even allow the user to use a DTD or Schema and define their own user interface for editing.
 
Usually WYSIWYG editors support CSS but not XSLT, because XSLT transformations can be very complex, and guessing what the user meant when changing the end result can be impossible. The WYSIWYG editors that do support XSLT, such as [[Syntext Serna]], will therefore apply changes directly to the original XML, while updating the view by running the XSLT for every change.
 
[[File:Xml editor table.png|editing an XML file in a WYSIWYG editor]]
 
In the above example, a stylesheet is used to color table cells in a particular way. For instance, even rows do not have the same background color as odd rows, in order to make reading easier.
 
==Application domains==
Line 56 ⟶ 52:
* [[Editing]]
* [[Source code editor]]
* [[Machine-Readable Documents]]
 
; Edited formats
Line 61 ⟶ 58:
* [[Darwin Information Typing Architecture]] (DITA)
* [[DocBook]]
* [[Strategy Markup Language]]
 
==External linksReferences==
{{Reflist}}
* {{dmoz|Computers/Data_Formats/Markup_Languages/XML/Tools/Editors/|XML Editors}}
* [http://www.xml.com/pub/pt/3 List of editors from xml.com]
* [codebeautify.org/xmlviewer Online XML Editor]
 
[[Category:Technical communication tools]]