Re: Using PHP to parse specific XML tag content?



Pavel Lepin wrote:
Jerry Stuckle <jstucklex@xxxxxxxxxxxxx> wrote in
<gh9t0a$9lg$1@xxxxxxxxxxxxxxxxxxx>:
_Z_ wrote:
<?php
header() ;
$xsl = "MyForm.xsl" ;
$command = "xsltproc " . $xsl . " " . $_GET[XML_File] ;
$last_line = system( $command ) ;
?>

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.

The XSL extension (using the very same libxslt that xsltproc
is a command-line front-end for) solves that problem
neatly, of course, but that leads us back to some people
being locked into the set of extensions their hosting
provider deemed 'appropriate' for their needs. My advice
would be changing the provider.


That's true. But then the same is true if you use any of the extensions which aren't included in the basic PHP.

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.

Please tell me ONE Windows hosting company which has cygwin installed and running on their system.

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.

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.

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.

That often isn't true. SimpleXML or the DOM functions give you much more control.

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. And even if the programs are installed, it's another language to learn and keep up with. Again, not reasonable for someone who doesn't do it regularly.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



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)
  • Formatting Hard Disk
    ... I am facing many many errors after installing Windows XP. ... Now I am only left with the only option to format my PC. ... C: drive contains Windows XP and D: contains my documents. ... I tried formatting my PC from command ...
    (microsoft.public.windowsxp.general)
  • Formatting Hard Disk
    ... I am facing many many errors after installing Windows XP. ... Now I am only left with the only option to format my PC. ... C: drive contains Windows XP and D: contains my documents. ... I tried formatting my PC from command ...
    (microsoft.public.windowsxp.general)
  • Formatting C:
    ... I am facing many many errors after installing Windows XP. ... Now I am only left with the only option to format my PC. ... C: drive contains Windows XP and D: contains my documents. ... I tried formatting my PC from command ...
    (microsoft.public.windowsxp.general)
  • Re: DOS Command?
    ... but I cannot for the life of me remember the command. ... format is the command. ... Formats the disk in the specified volume to accept Windows files. ... Clean Install Windows ...
    (microsoft.public.windowsxp.general)

Loading