* xmlStreamPop: * @stream: the stream context * * push one level from the stream. * * Returns: -1 in case of error, 0 otherwise. */
| 2185 | * Returns: -1 in case of error, 0 otherwise. |
| 2186 | */ |
| 2187 | int |
| 2188 | xmlStreamPop(xmlStreamCtxtPtr stream) { |
| 2189 | int i, lev; |
| 2190 | |
| 2191 | if (stream == NULL) |
| 2192 | return(-1); |
| 2193 | while (stream != NULL) { |
| 2194 | /* |
| 2195 | * Reset block-level. |
| 2196 | */ |
| 2197 | if (stream->blockLevel == stream->level) |
| 2198 | stream->blockLevel = -1; |
| 2199 | |
| 2200 | /* |
| 2201 | * stream->level can be zero when XML_FINAL_IS_ANY_NODE is set |
| 2202 | * (see the thread at |
| 2203 | * http://mail.gnome.org/archives/xslt/2008-July/msg00027.html) |
| 2204 | */ |
| 2205 | if (stream->level) |
| 2206 | stream->level--; |
| 2207 | /* |
| 2208 | * Check evolution of existing states |
| 2209 | */ |
| 2210 | for (i = stream->nbState -1; i >= 0; i--) { |
| 2211 | /* discard obsoleted states */ |
| 2212 | lev = stream->states[(2 * i) + 1]; |
| 2213 | if (lev > stream->level) |
| 2214 | stream->nbState--; |
| 2215 | if (lev <= stream->level) |
| 2216 | break; |
| 2217 | } |
| 2218 | stream = stream->next; |
| 2219 | } |
| 2220 | return(0); |
| 2221 | } |
| 2222 | |
| 2223 | /** |
| 2224 | * xmlStreamWantsAnyNode: |
no outgoing calls