xmlReaderMoveToFirstAttribute

SYNOPSIS

int xmlReaderMoveToFirstAttribute(xmlReader reader)

Parameters:

  • reader - the xmlReader object

Returns:

  • 1 - success

  • 0 - not found

  • -1 - other error


DESCRIPTION
xmlReaderMoveToFirstAttribute() moves the xmlReader on to the first attribute of the current element, which makes it the target of functions like xmlReaderGetName() and xmlReaderGetContent().


EXAMPLE

<$ret = (xmlReaderMoveToFirstAttribute($reader))>
    <while $ret eq 1>
        <$name = (xmlReaderGetName($reader))>
        <$content = (xmlReaderGetContent($reader))>
        attr '$name' = '$content'
        <$ret = (xmlReaderMoveToNextAttribute($reader))>
    </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 an XML document (see section 3.1 of the XML spec).


SEE ALSO
xmlReaderMoveToAttribute, xmlReaderMoveToAttributeNumber, xmlReaderMoveToElement, xmlReaderMoveToFirstAttribute, xmlReaderMoveToNextAttribute, xmlReaderRead


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