xmlReaderIsEmptyElement

 

SYNOPSIS

int xmlReaderIsEmptyElement(xmlReader reader)

Parameters:

  • reader - the xmlReader object

Returns:

  • Whether the current element is an empty (<p/>) element


DESCRIPTION
xmlReaderIsEmptyElement() returns 1 if the current element is empty, 0 if not and -1 in case of error. These are sometimes called "standalone" or "self closing" elements.

More precisely, this is for testing whether elements will have an end element. E.g. <a/> will be considered empty while <a></a> will not.


EXAMPLE

<$isEmpty = (xmlReaderIsEmptyElement($reader))>


CAVEATS
Invoke xmlReaderIsEmptyElement when you're on the XML_READER_TYPE_ELEMENT to tell whether it's an opening element of a balanced pair or an empty element. If the reader is on XML_READER_TYPE_END_ELEMENT, then xmlReaderIsEmptyElement will always return 0, as you're on the closing element of a non-empty pair.


SEE ALSO
xmlReaderGetColumn, xmlReaderGetDepth, xmlReaderGetLine, xmlReaderGetType


Copyright © Thunderstone Software     Last updated: Sep 25 2019
Copyright © 2019 Thunderstone Software LLC. All rights reserved.