Re: Using PHP to parse specific XML tag content?
- From: Pavel Lepin <p.lepin@xxxxxxxxxxx>
- Date: Fri, 05 Dec 2008 14:48:33 +0200
Jerry Stuckle <jstucklex@xxxxxxxxxxxxx> wrote in
<ghb2t1$vd2$1@xxxxxxxxxxxxxxxxxxx>:
Pavel Lepin wrote:
Jerry Stuckle <jstucklex@xxxxxxxxxxxxx> wrote in
<gh9t0a$9lg$1@xxxxxxxxxxxxxxxxxxx>:
_Z_ wrote:
Of course you have to have xsltproc installed, but I
assume you have it. This way enables you to test your
XML --> HTML transformation in testing environment. For
example: bash# xsltproc MyForm.xsl TestData.xml
Even more basic that that - you have to have permission
to execute commands, which many shared hosts do not
allow.
And you must, of course, be running on a Linux system.
That's not true. At the very least, libxslt and xsltproc
run just fine under Windows using Cygwin, and, unless I'm
much mistaken, the open source *BSD family. I suspect
there wouldn't be any problems running it on any
reasonably sane proprietary UN*X as well. libxml2 and its
evil twin libxslt seem to be among the most widely spread
libs in the world.
This is completely worthless when run from a Windows web
server. Running on a Windows server generally means you're
running IIS. Alternatively, you're running Apache native
under Windows.
Well, that's not exactly true either, I've seen about half a
dozen small Windows-based web-servers in the past few
years, and not a single one of them was running IIS, it was
always either native Apache, or Apache compiled under
Cygwin, BUT...
Please tell me ONE Windows hosting company which has
cygwin installed and running on their system.
....this is a very good point. I seem to have lost the
context of third-party hoster offering Windows servers;
indeed, in that context libxslt/xsltproc is highly unlikely
to be present or even obtainable.
For your suggestion to work,you would have to have either
a VPS or dedicated server - which is way too expensive for
a small site.
I'm paying about $200/year for a VDS. I suppose there are
some organisations that would find this cost prohibitive...
then again, if I were a hired software engineer for such an
organisation, I would gladly pay the fee out of my own
pocket for the simple luxury of having a fully configurable
environment at my disposal. :-)
And even then - your command won't work. You have to
first start the cygwin environment, then execute the
command. You may be able to do it from a system()
command, but I'm not positive.
Um, I might be wrong here, it's been some time since I last
tinkered with Cygwin, but I don't think this is correct.
Unless I'm much mistaken, there's no Cygwin environment per
se, the executable files are simply linked against the .dll
(cygwin1.dll or somesuch) providing a bridge between the
linuxy interfaces and native Windows APIs. Once you have
Cygwin properly set up, you can run xsltproc.exe from
cmd.exe just fine, without running anything else first.
That's likely beside the point in context of the OP's
problem, but I honestly believe that any business case
justifying anything but the most trivial XML processing can
also justify the costs of a decent VDS.
That is the end of the story if you want only toOnly if you have those tools installed, and can stand
display the data from XML file.
the default format produced.
Sorry, either that doesn't make sense or I'm missing your
point completely. There's no 'default format' if we're
talking about XSLT. It's a programming language designed
specifically for document transformation, so the 'default
format' is whatever you choose it to be.
Yes, but you have to learn XSLT or use whatever defaults
are provided by the samples.
Learning XSLT is eminently worthwhile in my experience. :-)
True, SimpleXML and DOM give a lot of control and are
often the most reasonable choice for XML processing. But
there's absolutely no point in not having XSLT in your
toolbox. If you need transformations, it's often the most
cheap, efficient and maintainable approach.
Sure there is. For the points I mentioned above.
I'm not saying XSLT isn't good. But it's something else
which must be installed on the host, which is not possible
in the vast majority of systems out there - because they
are on shared hosts.
Points acknowledged.
And even if the programs are installed, it's another
language to learn and keep up with.
I cannot fully agree with this if we're talking about
professional software engineers. DSLs such as SQL, regexen
and, yes, XSLT exist for extremely good reasons: the
paradigm shift allows to express certain classes of
algorithms far more clearly and concisely than it would be
possible in the hosting general-purpose language. As such,
I perceive 'another language to learn and keep up with' as
a Good Thing. It's no different from 'another API to learn
and keep up with', assuming the API in question allows you
to solve some class of problems with ease.
DOM API might be somewhat easier to get the hang of than
XSLT, but it, too, is something one should learn and
understand before applying it as a solution to practical
problems.
Again, not reasonable for someone who doesn't do it
regularly.
Well, yes, but amateurs running into something that's way
above their heads should either leave it to the
professionals or go pro themselves, shouldn't they?
--
If we want the average quality of computer programs to rise
by 1000%, all we have to do is carefully to select 90% of
the world's programmers, and shoot them. --Richard
Heathfield in <Sfedncgr46kOPmDanZ2dnUVZ8vCdnZ2d@xxxxxx>
.
- Follow-Ups:
- Re: Using PHP to parse specific XML tag content?
- From: Jerry Stuckle
- Re: Using PHP to parse specific XML tag content?
- References:
- Re: Using PHP to parse specific XML tag content?
- From: Jerry Stuckle
- Re: Using PHP to parse specific XML tag content?
- Prev by Date: Re: Looking for tips: RIA the way ?
- Next by Date: Re: Using PHP to parse specific XML tag content?
- Previous by thread: Re: Using PHP to parse specific XML tag content?
- Next by thread: Re: Using PHP to parse specific XML tag content?
- Index(es):
Relevant Pages
|