On Apr 4, 7:05 pm, "Bondo" <ostes...@hotmail.com> wrote:
> On Apr 4, 2:19 pm, p.le...@ctncorp.com wrote:
> > Replace XHTML with HTML, and that would be the solution
> > I would be naturally gravitating towards, thanks to
> > *my* biases and practices. YMMV.
>
> 1) Can XSLT output to a file or in some other way so that
> I can grab the HTML data?
Normally, you use your XSLT API to create a Processor
instance, feed it a DOMDocument source tree and get a
DOMDocument or DOMDocumentFragment tree as a result.
Serializiation is usually up to you (that is, up to the DOM
API you're using). Of course, that's just one of the
possible scenarios, it is entirely possible to use a
standalone XSLT processor, for example, either feeding it
XML document files and getting transformation results as
files as well, or using pipes for I/O.
> 2) If I have 80 photos, 8 on each page, do I generate an
> XML file 10 times in order to generate the (X)HTML 10
> files, or can XSLT do it in one go?
XSLT1 processors may only generate one result tree per
transformation. There are ways to work around this (for
example, if you're using a DOM+XSLT API, you may try a
transformation that would return all the results glued
together, then use DOM to yank the appropriate fragments
out of it and serialize them separately).
XSLT2 processors should support multiple result trees, but:
- you'll have to either ask someone else about it or look
it up yourself in the docs/specs;
- the only readily available seemingly-fully-compliant
XSLT2 processor that I'm aware of is Saxon8, and I'm not
certain how hard it would be to use it as a
transformation engine under .NET framework. Again, ask
someone else or, well, GIYF.
> Finally, I'm not sure why you shy away from XHTML (IE
> issues, you say). I've made several sites in XHTML 1.0
> Strict, and IE and other major browsers display the pages
> just fine.
Again, GIYF. In short, XHTML is unsupported by MSIE. To
make it work you have to serve it as invalid HTML with
text/html MIME type. Being invalid it triggers quirks mode.
Once you're in quirks mode, you're in what C++ crowd calls
Undefined Behavior Land. You don't want to be in UBL, just
trust me on this one.
I don't even mention the fact that serving XHTML as
text/html places certain constraints on its serialization,
which mean you cannot process it as pure XML anymore.
I don't even mention the fact that to get any use out of
it, you have to serve it as application/xhtml+xml to
Gecko-baseds, which requires a small bit of Apache mojo to
pull of and strikes me as slightly silly.
All in all, using XHTML for public websites is ugly,
inelegant, useless and prone to causing Developer Brain
Explosion Syndrome at worst possible moments. The only
place where XHTML has its uses ATM is as an internal
representation of something you intend to actually serve
as HTML. There are advantages in it being XML, and
transforming XHTML 1.0 Strict to HTML 4.01 Strict is pretty
much effortless, the main difference between the two being
that one is an XML application, and the other is an SGML
application.
--
Pavel Lepin