Results 1 to 8 of 8

Thread: PHP XML parser

  1. #1
    Join Date
    Aug 2008
    Location
    East England
    Posts
    50

    Default PHP XML parser

    Hello all

    I've been running a local LAMP server for development purposes and have hit a rather embarrassing snag. I can't get the XML parser to run.

    I would be very grateful for step by step instructions on the enabling of the parser module.

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: PHP XML parser

    Which XML parser is this? Show us the PHP function call.

  3. #3
    Join Date
    Aug 2008
    Location
    East England
    Posts
    50

    Default Re: PHP XML parser

    I didn't realise php had more than one xml parser. It's invoked thus: $this->xmlParser = xml_parser_create();

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: PHP XML parser

    Oh, there are XML parsers and XML parsers. There are SAX style parsers and DOM style parsers, and others. Anyway, putting xml_parser_create into the search box at PHP: PHP Manual - Manual shows that these XML parser functions are built-in by default. And a quick CLI PHP program doesn't give any errors when run.

    Code:
    <?php
    $x = xml_parser_create();
    print_r($x);
    ?>
    What's not working for you?

  5. #5
    Join Date
    Aug 2008
    Location
    East England
    Posts
    50

    Default Re: PHP XML parser

    Until now, invoking this function has caused the php parser to exit. However I've kept fiddling and just now I installed xml_reader - with that in place the php parser doesn't terminate, but neither will the xml (an rss feed) parse, it seems.

    I'm using someone else's script, under the GPL. The code seeks to parse the RSS, check the version and go from there. Unfortunately the version variable stays null and from my investigations of a couple of minutes so does everything else. It's not extracting any information.

    I could give you a link to where I got this code, but I'd be happier with a "use this, it's flawless" kind of answer

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: PHP XML parser

    Maybe ask the author of the code?

  7. #7
    Join Date
    Aug 2008
    Location
    East England
    Posts
    50

    Default Re: PHP XML parser

    Indeed, now that the thing isn't throwing a wobbly at every request to create a parser instance, that seems reasonable. Although I'm perplexed at a core function crashing until I added a module.

    Thank you for your efforts.

  8. #8
    ab@novell.com NNTP User

    Default Re: PHP XML parser

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    That's fairly standard with a lot of software. The function literally
    didn't exist until you added the module. This is nice because there are
    potentially hundreds of modules. With most of those not installed your
    server is faster, has fewer potential issues with interoperability,
    fewer potential attack surfaces, etc.

    Good luck.







    Solar Granulation wrote:
    | Indeed, now that the thing isn't throwing a wobbly at every request to
    | create a parser instance, that seems reasonable. Although I'm
    | perplexed at a core function crashing until I added a module.
    |
    | Thank you for your efforts.
    |
    |
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFIlwhW3s42bA80+9kRAkitAJ9TS2GhD4WtMBBiQ7ZZpmU0fuNRhACfeDwN
    NbRsybFrcE0k0lVmSdQhP6k=
    =sC8Y
    -----END PGP SIGNATURE-----

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •