xmlReaderMoveToAttributeNumber

 

SYNOPSIS

int xmlReaderMoveToAttributeNumber(xmlReader reader,
                                       int number)

Parameters:

  • reader - the xmlReader object

  • reader - the index of the attribute you want to move to (starting at 0)

Returns:

  • 1 - success

  • 0 - attribute not found

  • -1 - other error


DESCRIPTION
xmlReaderMoveToAttributeNumber() moves the reader to an attribute of the current element, based on its ordering.

It uses a 0-based numbering system - 0 is the first attribute, 1 is the second, and so on.


EXAMPLE

<$attrNum = (xmlReaderGetAttributeCount($reader))>
    <while $loop lt $attrNum>
        <$val = (xmlReaderGetAttributeNumber($reader, $loop))>
        Attr $loop is [$val]
    </while>


CAVEATS
The ordering of the attributes as provided by this function might NOT be the same as the ordering of the attributes in the XML document. This is legal, as the ordering of attributes is not significant in a XML document (see section 3.1 of the XML spec).


SEE ALSO
xmlReaderMoveToAttribute, xmlReaderMoveToElement, xmlReaderMoveToFirstAttribute, xmlReaderMoveToNextAttribute, xmlReaderRead


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