Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Namespace
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Name conflicts== Element names are defined by the developer. This often results in a conflict when trying to mix XML documents from different XML applications. This XML carries [[HTML table]] information: <syntaxhighlight lang="xml"> <table> <tr> <td>Apples</td> <td>Oranges</td> </tr> </table> </syntaxhighlight> This XML carries information about a [[table (furniture)|table]] (i.e. a piece of furniture): <syntaxhighlight lang="xml"> <table> <name>Mahogany Coffee Table</name> <width>80</width> <length>120</length> </table> </syntaxhighlight> If these XML fragments were added together, there would be a name conflict. Both contain a {{tag|table}} element, but the elements have different content and meaning. An XML parser will not know how to handle these differences. ===Solution via prefix=== Name conflicts in XML can easily be avoided using a name prefix. The following XML distinguishes between information about the HTML table and furniture by prefixing "h" and "f" at the beginning of the elements. <syntaxhighlight lang="xml"> <h:table> <h:tr> <h:td>Apples</h:td> <h:td>Oranges</h:td> </h:tr> </h:table> <f:table> <f:name>Mahogany Coffee Table</f:name> <f:width>80</f:width> <f:length>120</f:length> </f:table> </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)