<< Chapter < Page Chapter >> Page >

Created using a WYSIWYG XHTML editor

I originally created the document as an XHTML document using a WYSIWYG XHTML editor that behaves muchlike a word processor. (If you don't know what WYSIWYG means, Google it.) Of course, the document has since undergone quite a lot of editing so the finalXHTML version probably doesn't match the XHTML code in Listing 3.

Transform to CNXML

Later on, I used a Java program of my own design to transform the final XHTML document into anotherflavor of XML known as CNXML for publishing on the Connexions website.

That illustrates another characteristic of XML. Because the formats of certain flavors of XML documentsare well defined, it is often practical to transform them from one flavor to another flavor.

That makes it possible for me to create the document using a program that is very similar to a word processorand then transform the output of that program into a fairly cryptic format that satisfies the publishing requirements of the website.

Your browser is rendering the document

When you accessed the document from the Connexions website, it was transformed back into an XHTML document and sent to yourcomputer.

As you can see in Listing 3, viewing raw XHTML isn't very enjoyable. Fortunately, your browser isacting as a rendering engine to render the raw XHTML text into a much more pleasing presentation format.

Back to the book example

A book that is created and maintained as an XML document could be rendered in a variety of different ways. Whichever way it is rendered, however, it wouldprobably be useful to separate and number the chapters. Therefore, the value of the number attribute could be used by the rendering engine to present the chapter number for a specific rendering.

In some renderings, the number might appear on an otherwise blank page that begins a new chapter. In a different rendering, the chapter number might appearin the upper right or left-hand corner of each page.

Tell me again, what is an element?

As I explained earlier, an element usually consists of a start tag (with optional attributes and namespace information) , an end tag , and the content sandwiched in between as shown earlier in Listing 2.

Elements can be nested

Elements can be nested inside other elements as shown in Listing 4.

Listing 4 . Nested elements.
<book><chapter number="1">Content for Chapter 1</chapter><chapter number="2">Content for Chapter 2</chapter></book>

In Listing 4, two chapter elements are nested inside a book element.

Why does XML use elements?

It is probably fair to say that the element constitutes the fundamental unit of information in an XML document. For example, the element defines the type ofinformation, such as chapter in our book example.

Sandwiched in between the start tag and the end tag of an element, we find the raw information (content) that the XML document is designed to convey. For a text document, you are likely to find a lot of content between the tags. Forexample, in Listing 3, there are several lines of text between the paragraph tags identified by the p and the /p enclosed in angle brackets.

Once again, what is content?

Of the four terms mentioned earlier, (tags, elements, content, and attributes) , content is the easy one. Content is sandwiched in between the start tag and the end tag of an element. Usually the content of the elements containsthe information that the XML document is designed to convey. In other words, this is where we put the information for which the document was created. Thetags and attributes are there to create the structure.

For example, if the XML document is being used for the creation and maintenance of material for a newspaper, the content constitutes the news. Ifthe XML document is being used for the creation and maintenance of a Java programming textbook, the content contains the information about Javaprogramming that we want to convey to the student.

Why do we need structure?

One of the primary objectives of XML is to separate content from presentation. If we insert the raw material as content into a structure definedby the tags, elements, and attributes, then that raw material can be presented in a variety of ways.

Miscellaneous

This section contains a variety of miscellaneous materials.

Housekeeping material
  • Module name: XML - Tags, Elements, Content, and Attributes
  • File: FlexXhtml0082.htm
  • Revised: 12/02/14
Disclaimers:

Financial : Although the Connexions site makes it possible for you to download aPDF file for this module at no charge, and also makes it possiblefor you to purchase a pre-printed version of the PDF file, you should be aware that some of the HTML elements in this module maynot translate well into PDF.

I also want you to know that, I receive no financial compensation from the Connexions website even if you purchase the PDF version ofthe module.

In the past, unknown individuals have copied my modules from cnx.org, converted them to Kindle books, and placed them for sale onAmazon.com showing me as the author. I neither receive compensation for those sales nor do I know who does receive compensation. If youpurchase such a book, please be aware that it is a copy of a module that is freely available on cnx.org and that it was made andpublished without my prior knowledge.

Affiliation : I am a professor of Computer Information Technology at Austin Community College in Austin, TX.

-end-

Questions & Answers

do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
Daniel
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
Maciej
characteristics of micro business
Abigail
Do somebody tell me a best nano engineering book for beginners?
s. Reply
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
s.
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
Tarell
what is the actual application of fullerenes nowadays?
Damian
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
Tarell
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
Virgil
is Bucky paper clear?
CYNTHIA
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Harper
Do you know which machine is used to that process?
s.
how to fabricate graphene ink ?
SUYASH Reply
for screen printed electrodes ?
SUYASH
What is lattice structure?
s. Reply
of graphene you mean?
Ebrahim
or in general
Ebrahim
in general
s.
Graphene has a hexagonal structure
tahir
On having this app for quite a bit time, Haven't realised there's a chat room in it.
Cied
what is biological synthesis of nanoparticles
Sanket Reply
what's the easiest and fastest way to the synthesize AgNP?
Damian Reply
China
Cied
types of nano material
abeetha Reply
I start with an easy one. carbon nanotubes woven into a long filament like a string
Porter
many many of nanotubes
Porter
what is the k.e before it land
Yasmin
what is the function of carbon nanotubes?
Cesar
I'm interested in nanotube
Uday
what is nanomaterials​ and their applications of sensors.
Ramkumar Reply
what is nano technology
Sravani Reply
what is system testing?
AMJAD
preparation of nanomaterial
Victor Reply
Yes, Nanotechnology has a very fast field of applications and their is always something new to do with it...
Himanshu Reply
good afternoon madam
AMJAD
what is system testing
AMJAD
what is the application of nanotechnology?
Stotaw
In this morden time nanotechnology used in many field . 1-Electronics-manufacturad IC ,RAM,MRAM,solar panel etc 2-Helth and Medical-Nanomedicine,Drug Dilivery for cancer treatment etc 3- Atomobile -MEMS, Coating on car etc. and may other field for details you can check at Google
Azam
anybody can imagine what will be happen after 100 years from now in nano tech world
Prasenjit
after 100 year this will be not nanotechnology maybe this technology name will be change . maybe aftet 100 year . we work on electron lable practically about its properties and behaviour by the different instruments
Azam
name doesn't matter , whatever it will be change... I'm taking about effect on circumstances of the microscopic world
Prasenjit
how hard could it be to apply nanotechnology against viral infections such HIV or Ebola?
Damian
silver nanoparticles could handle the job?
Damian
not now but maybe in future only AgNP maybe any other nanomaterials
Azam
Hello
Uday
I'm interested in Nanotube
Uday
this technology will not going on for the long time , so I'm thinking about femtotechnology 10^-15
Prasenjit
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Good
Berger describes sociologists as concerned with
Mueller Reply
Got questions? Join the online conversation and get instant answers!
QuizOver.com Reply

Get the best Algebra and trigonometry course in your pocket!





Source:  OpenStax, Introduction to xml. OpenStax CNX. Dec 02, 2014 Download for free at https://legacy.cnx.org/content/col11207/1.18
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Introduction to xml' conversation and receive update notifications?

Ask