Jonas said:
Which is the difference between XML and XHTML?
As Joseph Kesselman likes to say, XML is almost pure syntax.
Simplifying a bit, XML specifies how to write documents
representing hierarchies, but does not ascribe any specific
semantics to the resulting trees. That is left to the XML
applications--that is, to document formats using XML as a
basis (such as XHTML, RSS, DocBook or XML-RPC).
For example:
<foo>
<bar quux="xyzzy">
Made by Fred
</bar>
</foo>
....is a well-formed XML document describing a tree that
could be visualised as follows:
element foo
|
`-element bar
|
`-attribute quux
| |
| `-attribute value xyzzy
|
`-text Made by Fred
However, XML itself does not specify what all those elements
and attributes are supposed to mean: that is left to the
people who opt to use XML as a basic syntax for their
documents. Continuing with the example, a group of
developers might specify an XML-FOOBAR document format for
describing various foobars in their foobar-processing
software, agreeing that the root element of an XML-FOOBAR
document should always be named 'foo' and should always
contain one and only one element child named 'bar', that
could have an optional quux attribute for describing the
foobar's quuxicity, with allowed attribute values
being 'xyzzy' and 'yzzyx'. The 'bar' element may only have
text nodes as its children that should be treated as
human-readable notes about the foobar being described.
In this case, the document above becomes a valid XML-FOOBAR
document, describing a foobar with xyzzy quuxicity,
seemingly made by someone called Fred.
Now, XHTML is precisely that--an XML application using XML
basic syntax to describe hypertext documents. The XHTML
standard specifies the meanings of the various elements and
attributes, their possible combinations, as well as gives
guidelines to authors of XHTML UA's as to how to convey
those meanings and combinations of meanings to the
end-user.
To give a somewhat strained linguistic analogy, XML is a
language, while XHTML is a set of rules for writing sonnets
in said language.
Does XHTML could be converted to another format as PDF?
Anything could be, I suppose. You might want to read about
XSL-FO. Apache FOP is reportedly a good enough
implementation distributed under Open Source,
GNU-incompatible license.
I hope further explanations on why this question doesn't
make much sense as formulated are unnecessary.