1 /* |
1 /* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
90 if (state == CHARACTERS) { |
90 if (state == CHARACTERS) { |
91 throw new XMLStreamReaderException( |
91 throw new XMLStreamReaderException( |
92 "xmlreader.unexpectedCharacterContent", reader.getText()); |
92 "xmlreader.unexpectedCharacterContent", reader.getText()); |
93 } |
93 } |
94 return state; |
94 return state; |
|
95 } |
|
96 |
|
97 public static void toNextTag(XMLStreamReader reader, QName name) { |
|
98 // skip any whitespace |
|
99 if (reader.getEventType() != XMLStreamConstants.START_ELEMENT && |
|
100 reader.getEventType() != XMLStreamConstants.END_ELEMENT) { |
|
101 XMLStreamReaderUtil.nextElementContent(reader); |
|
102 } |
|
103 if(reader.getEventType() == XMLStreamConstants.END_ELEMENT && name.equals(reader.getName())) { |
|
104 XMLStreamReaderUtil.nextElementContent(reader); |
|
105 } |
95 } |
106 } |
96 |
107 |
97 /** |
108 /** |
98 * Moves next and read spaces from the reader as long as to the next element. |
109 * Moves next and read spaces from the reader as long as to the next element. |
99 * Comments are ignored |
110 * Comments are ignored |