xmlReaderGetAllContent

SYNOPSIS

string xmlReaderGetAllContent(xmlReader reader)

Parameters:

  • reader - the xmlReader object

Returns:

  • text value for the current element and its sub-elements


DESCRIPTION
xmlReaderGetAllContent() gives the entire contents of this element and its sub-elements. This is in contrast to xmlReaderGetContent(), which only returns the text of the element, not its children.

xmlReaderGetAllContent can be handy for HTML-like XML data:

<div>
        This div has <b>a lot</b> of <i>emphasis</i> in its text.
    </div>

Calling xmlReaderGetAllContent() when the reader is on <div> will give you

This div has a lot of emphasis in its text.

where as xmlReaderGetContent() would return

This div has of in its text.


EXAMPLE

<$content = (xmlReaderGetAllContent($reader))>


CAVEATS
If you are on the opening of an element, the parser must read ahead, up to the closing of that element, in order to make sure it sees all the text nodes. In other words, if you're working with a 2GB XML file, you probably don't want to call xmlReaderGetAllContent() on the root node.


SEE ALSO
xmlReaderGetName, xmlReaderGetContent, xmlReaderGetAttribute


Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.