2

I'm trying to print the value (content) of the variable $this->XMLNominaCFDI

$XMLCFDI->normalizeDocument();

$this->XMLNominaCFDI = $XMLCFDI->saveXML();

I've been looking for here on SO but this answers didn't help me

Debug a DOMDocument Object in PHP

printing out html content from domelement using nodeValue

when I use var_dump it shows this string(2202) " "

How could I display the content of see the xml tree till this moment?

I hope you can help me, thanks.

PSD: I'm using PHP 5.2.17

Ashe
  • 187
  • 1
  • 13
  • @RobertWade `print_r` show nothing – Ashe Nov 24 '17 at 18:54
  • Use your browser's *view source code* function if you are outputting the result to a browser, as a browser will interpret the result as XML. Or use [`htmlentities()`](http://php.net/manual/en/function.htmlentities.php) to translate the XML to an in-browser-readable format. – Decent Dabbler Nov 24 '17 at 19:26
  • @DecentDabbler Im generating the xml first to pass it as a parameter to a function but before send it I want to see how it looks like but it is not working, I tried `htmlentities()` as you said but nothing – Ashe Nov 24 '17 at 19:55
  • 1
    Are you viewing the output in a browser? If so, have you tried: `$this->XMLNominaCFDI = $XMLCFDI->saveXML(); var_dump( htmlentities( $this->XMLNominaCFDI ) );`? – Decent Dabbler Nov 24 '17 at 20:03
  • Oh yes now it is working I was trying this way `echo htmlentities($this->XMLNominaCFDI)` but now as you said it is working very well, this is what i wanted, thank you! – Ashe Nov 24 '17 at 20:12

0 Answers0