Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> obiekty i parsowanie xml
marrrecki
post 26.11.2007, 09:30:30
Post #1





Grupa: Zarejestrowani
Postów: 110
Pomógł: 0
Dołączył: 19.07.2006
Skąd: Lublin

Ostrzeżenie: (0%)
-----


  1. <?php
  2. function _readXML(){
  3. $this->parser = xml_parser_create();
  4. $this->_xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false);
  5. $this->_xml_set_element_handler($this->parser, "_readXMLStart", "_readXMLFinish");
  6. if ($f = fopen($this->actionDirNameXML . $this->actionFileNameXML, "r")) {
  7. while ($dane = fread($f, 4096)) {
  8. if (!$this->_xml_parse($this->parser, $dane, feof($f))) {}
  9. }
  10. }
  11. $this->_xml_parser_free($this->parser);
  12. }
  13. ?>



Mam taką funkcję. W klasie wstawiłem oczywiście wszystkie potrzebne dane (var...), są stworzone funkcje _readXMLStart i _readXMLFinish ale parser krzyczy mi tak:

  1. Warning: xml_parse() [function.xml-parse]: Unable to call handler _readXMLStart()



Czy ma ktoś jakiś pomysł o co chodzi?

Ten post edytował marrrecki 26.11.2007, 09:31:21
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
splatch
post 26.11.2007, 09:51:38
Post #2





Grupa: Zarejestrowani
Postów: 487
Pomógł: 7
Dołączył: 7.01.2004
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


Może tak?

  1. <?php
  2. $this->_xml_set_element_handler($this->parser, array($this, '_readXMLStart'), array($this, '_readXMLFinish'));
  3. ?>


--------------------
Łukasz Dywicki
Independent Java and open source software consultant.
Blog - Java, OSGi, integracja oprogramowania..
Go to the top of the page
+Quote Post
marrrecki
post 26.11.2007, 10:48:44
Post #3





Grupa: Zarejestrowani
Postów: 110
Pomógł: 0
Dołączył: 19.07.2006
Skąd: Lublin

Ostrzeżenie: (0%)
-----


dzięki ci wielkie.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 25.07.2025 - 09:53