161 * |
161 * |
162 * <p> |
162 * <p> |
163 * Whitespace handling is a tricky business. Consider the following |
163 * Whitespace handling is a tricky business. Consider the following |
164 * schema fragment: |
164 * schema fragment: |
165 * |
165 * |
166 * <xmp> |
166 * <pre>{@code |
167 * <element name="foo"> |
167 * <element name="foo"> |
168 * <choice> |
168 * <choice> |
169 * <element name="bar"><empty/></element> |
169 * <element name="bar"><empty/></element> |
170 * <text/> |
170 * <text/> |
171 * </choice> |
171 * </choice> |
172 * </element> |
172 * </element> |
173 * </xmp> |
173 * }</pre> |
174 * |
174 * |
175 * Assume we hit the following instance: |
175 * Assume we hit the following instance: |
176 * <xmp> |
176 * <pre>{@code |
177 * <foo> <bar/></foo> |
177 * <foo> <bar/></foo> |
178 * </xmp> |
178 * }</pre> |
179 * |
179 * |
180 * Then this first space needs to be ignored (for otherwise, we will |
180 * Then this first space needs to be ignored (for otherwise, we will |
181 * end up treating this space as the match to <text/> and won't |
181 * end up treating this space as the match to <text/> and won't |
182 * be able to process <bar>.) |
182 * be able to process <bar>.) |
183 * |
183 * |
184 * Now assume the following instance: |
184 * Now assume the following instance: |
185 * <xmp> |
185 * <pre>{@code |
186 * <foo/> |
186 * <foo/> |
187 * </xmp> |
187 * }</pre> |
188 * |
188 * |
189 * This time, we need to treat this empty string as a text, for |
189 * This time, we need to treat this empty string as a text, for |
190 * otherwise we won't be able to accept this instance. |
190 * otherwise we won't be able to accept this instance. |
191 * |
191 * |
192 * <p> |
192 * <p> |
479 /** |
479 /** |
480 * Index on the namespaces array, which points to |
480 * Index on the namespaces array, which points to |
481 * the top of the effective bindings. Because of the |
481 * the top of the effective bindings. Because of the |
482 * timing difference between the startPrefixMapping method |
482 * timing difference between the startPrefixMapping method |
483 * and the execution of the corresponding actions, |
483 * and the execution of the corresponding actions, |
484 * this value can be different from <code>namespaces.size()</code>. |
484 * this value can be different from {@code namespaces.size()}. |
485 * <p> |
485 * <p> |
486 * For example, consider the following schema: |
486 * For example, consider the following schema: |
487 * <pre><xmp> |
487 * <pre>{@code |
488 * <oneOrMore> |
488 * <oneOrMore> |
489 * <element name="foo"><empty/></element> |
489 * <element name="foo"><empty/></element> |
490 * </oneOrMore> |
490 * </oneOrMore> |
491 * code fragment X |
491 * code fragment X |
492 * <element name="bob"/> |
492 * <element name="bob"/> |
493 * </xmp></pre> |
493 * }</pre> |
494 * Code fragment X is executed after we see a startElement event, |
494 * Code fragment X is executed after we see a startElement event, |
495 * but at this time the namespaces variable already include new |
495 * but at this time the namespaces variable already include new |
496 * namespace bindings declared on "bob". |
496 * namespace bindings declared on "bob". |
497 */ |
497 */ |
498 private int nsEffectivePtr=0; |
498 private int nsEffectivePtr=0; |