This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: RE: DOM and XML parser
- From: "ashu t" <aashut at rediffmail dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: 16 Aug 2002 07:33:25 -0000
- Subject: Re: RE: [xsl] DOM and XML parser
- Reply-to: xsl-list at lists dot mulberrytech dot com
Thanks Martin
I have the book professional XSL.
it has nowhere written which edition it is but it has written
first indian reprint : june 2001
ISBN 81-7366-307-6
writers are
Kurt Cagle,Michael Corning,Jason Diamond,Teun Duynstee,Oli Gauti
Gunmundsson,Michael Mason,Jonathan Pinnock,Paul Spencer,Jeff
Tang,Andrew Watt with Jirka Jirat,Paul Tchistopolskii,Jeni
Tennison.
I guess it is the second edition as it has no where your name in
writers list.
So what you have written that means XSLT processor works on a tree
of input document. But It is not necessary to be a DOM .
One thing i want to ask who makes the tree XML parser or XSLT
processor.
one thing is that the Introduction part of the book has written
"The XSL specification soon branced into two :XSL
Transformmations(XSLT) and XSL Formatting Objects (XSL-FO),each
with a specific role to play in the overall transformation
process.
A third ,related specification is XPATH ,which is a language for
identifying parts of (and locations in)an XML document."
Now what i want to ask is that the "Language is XSL or it is
something else composed of THREE DIFFERENT LANGUAGES ". what
should one call that he/she is using XSL or XSLT or .......?
And I am not getting any idea of any style sheet which can be
formed only by XSLT or by XPATH.
Whenever you write any template match you are using XPATH and
while writing what to do with that is when you use XSLT ?
So how can you separate those two when it is impossible to use
them in isolation.yes XSL-FO is definitely something different and
i have no doubt about that.
At the end i must say that may be whatever i have written is
absolutely weird but I wish if you can explain me these things and
clear any doubt whatsoever.
aashut
On Wed, 14 Aug 2002 Didier PH Martin wrote :
Hi,
Ashu said:
So what i understood is that when after converting html into
well
formed xml(xhtml) i call the function (i am using php as it
support only sablotron processor)
xslt_process($ch , htmlfile.html ,stylesheet.xsl);
then expat makes a dom like structure of xhtml on which the
stylesheet applied.
Didier replies:
Yes XLST engines create a tree of elements, attributes and data
at least
at the conceptual level. In reality, for efficiency purposes,
they may
create more efficient structures. Do not forget that the DOM is
simply a
set of interfaces but not the structure itself. Having said
that, it is
OK to think of the structure produced by the parsing mechanism as
a
tree. The XSLT engine uses that in-memory tree to match the
templates
and create the output.
As a rule of thumb and from a practical standpoint, uses XSLT
when you
want to produce a text document as output. If however, for
efficiency
reasons or any other one you find that XSLT processing is not
what you
want because:
a) the produced structure is taking too much room
b) you do not like XSLT (or do not want to learn it)
c) The processor is too slow
d) any other reason :-)
then you use sax. This basically implies that you create your own
XML
document interpreter implemented in the language of your
choice.
Think of XSLT as an XML document type interpreter. XSLT is a
domain
language used to perform transformation on XML documents with
the main
characteristics that its syntax is based XML document's
structural
rules. However, you are not limited to this sole language to
process XML
document. In other words you can implement you own XML document
interpreter with another language like C, C++, Python, PERL,
Java,
etc... for which an XML parser is available. Having the capacity
to
create your own interpretation rules then you are not obliged to
create
a complete in-memory structure but instead your interpreter can
process
only the entities (elements, attributes, etc..) that you want to
be
processed. Also, since you can implement your own interpreter
more
efficiently, then you can:
a) reduce the memory footprint
b) increase the processing speed.
c) create new processing paradigms
d) create your own interpretation language (for instance
something like
Omnimark or DSSSL)
So I do not know if the book you refer to is the first or the
second
edition (I wrote some chapters in the first edition but not
chapter 6
:-) but as an author of this book I felt responsible to help
you.
Cheers
Didier PH Martin
XSL-List info and archive:
http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list