What is the Role of an Element in the DOM

Additionally, it is receiving wide support in the Java community as a viable interface between the DOM and work with XML. Some of the computer and scripting languages you might consider while working with the DOM and XML may include, but are not limited to, the following:


_______________________________________________


· ECMA Script(JavaScript)
· Jscript (Microsoft’s implementation of JavaScript)
· Java
· Visual Basic
· Python
· Perl
· C
· C++

Thinking about objects

An element is made accessible to scripting languages such as JavaScript and object-oriented programming languages such as Java because every element is also an object.

An element doesn’t need to contain any data to be considered a legitimate object. The img element is a good example of a familiar element from HTML that doesn’t contain any data. Rather, it contains properties in the form of attributes such as src, which describes where the object is located. An image’s actual data is contained in a separated file that is referred to via the src attribute. The img element, or objects, always remains the same, but it can contain different properties, and these properties can be changed on the fly through scripts.

Try inputting the following code within an HTML file:

<img src = “ “ />

If you load this HTML file into a browser, you’ll get a broken-image icon. That’s because you’re dealing with an object that has properties that mean nothing to the browser. In fact, its properties refer to a resource that contains no data. It’s still an object, though, and thus, it is also an element. You might want to change the src attribute value to something that makes sense to a browser, such as src =http://www.somedomainhere.com.

This is why the DOM is so important to XML. The DOM consists of object interfaces and their properties, which you can manipulate with script. Objects have become extremely important in the computer world. By manipulating them in script, you can turn static Web page into dynamic Web pages. To better understand how an element can be considered an object, review the following tag:

<p style = “font-family:serif”> this a Paragraph </P>

The p element consists of a number of parts that help describe it as an object. This element consists of data made up of a string (“This is a Paragraph”). String is computer-talk for a series of one or more text characters. This element also consists of an attribute, style, which has the value font-family:serif assigned to it.

Within the DOM, the most commonly used interface is the element interface. The element interface contains properties and methods that make it possible to access an elements attributes. From a technical perspective, an attribute isn’t a child of anything. Therefore, the developers of the DOM built a series of interfaces within the DOM that contain properties and methods that developers can use to access element attributes. There are actually several other interfaces, but they‘re beyond the scope.

Writing Well-Formed Documents

Now that you know all the rules of creating elements and how they fit into the document, we are going to look at ways to ensure that your documents are well formed. We’ll also take a look at how to manage your element content through validation. There’s a difference between these two:

· A well – formed document is a document that follows the core rules of XML.
A valid document is a document that follows the core rules of XML and adheres to a DTD or a Schema assigned to that document.



_______________________________________________

FREE Subscription

Subscribe to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.

Name:
Email:

Note : We never rent, trade, or sell my email lists to
anyone. We assure that your privacy is respected
and protected.

_______________________________________



| Generating XML Document Using Java servlet | How to Design a XML Document Easily | Implementing Object Based Methodology in SGML | Understanding Advanced XML Concepts | Understanding Class Loaders in Java | Understanding The Basic Reasons for Development of XML | Understanding Various Methods of Formatting XML Data | Understanding XML Based Web Protocols | Working With ebXML – An Indepth Overview | XML Database Program – Knowing the Basic Concepts |

FREE Subscription

Stay Current With the Latest Technology Developments Realted to XML. Signup for Our Newsletter and Receive New Articles Through Email.

Name:

Email:

Note : We never rent, trade, or sell our email lists to anyone. We assure that your privacy is respected and protected.

 

 

Add to My Yahoo!

Visit XML Training Material Guide Homepage

 

 

Copyright - © 2004 - 2017 - All Rights Reserved.