Re: Using PHP to parse specific XML tag content?




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 to
display the data from XML file.

Only if you have those tools installed, and can stand
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>
.



Relevant Pages

  • Re: format-number(XPath function) works well in XP but fails in CE
    ... The general warning when using XML on WinCE is that our MSXML parser has had ... XSLT on CE is almost identical to ... Software Design Engineer, Windows CE ... I wanna use XSLT convert these numbers to normal format just ...
    (microsoft.public.windowsce.app.development)
  • Re: Is there any c++ based XSLT processor which conforms to XSLT 2.0
    ... xml and found that their PAM includes only windows. ... XSLT 2.0 is yet not very popular. ...
    (comp.text.xml)
  • Re: nss_ldap using sasl with gssapi. Kerberos credentials cache problem[Scanned]
    ... First get a Windows 200x environment with the RFC2307 extensions added to the Schema. ... Next assign all of your *real* Unix users with AD accounts - make the user names conform to the Posix rules (Windows samAccountName) i.e. 8 characters starting with a letter, ... A further enhancement would be to try to access the directory using this file if readable, and if that fails or if the file is not readable then use the KRB5CCNAME environment variable if set and if that fails use the users credentials cache if that exists. ...
    (Fedora)
  • Re: client -server interaction over XML supporting multiple protocols
    ... > analyzing various models to develop the server. ... The Windows WinInet at just the socket layer is also very ... expected to be different for each platform. ... will the XML size constraints significantly hinder the request ...
    (comp.lang.cpp)
  • Re: Managed vs Unmanaged Bare Bones Performance Test
    ... One of the reasons that things like Virtual PC (which runs Windows on pre-Intel Macintoshes) and Rosetta work so well is that the programs being run spend very little time in the code that needs to be translated. ... If your code only spends 1% or less of its time executing the code you actually wrote, and the rest of its time either waiting on i/o or executing libraries in the operating system, then even if you have a 20X difference in performance, you're only really looking at a 20% cost in the "slower" environment. ... There are a few classes of applications where this sort of difference matters. ... The biggest thing I notice in my applications is start-up time, as the .NET Framework imposes a relatively large burden with respect to application initialization as compared to a straight Windows application. ...
    (microsoft.public.dotnet.framework)