Parses the "QName" rule. @param error optional error message. If not null, will be raised if no QName is found @return QName string @throws QueryException query exception
(final QueryError error)
| 4463 | * @throws QueryException query exception |
| 4464 | */ |
| 4465 | private byte[] qName(final QueryError error) throws QueryException { |
| 4466 | token.reset(); |
| 4467 | if(!ncName(true)) { |
| 4468 | if(error != null) throw error(error, currentAsString()); |
| 4469 | } else if(consume(':')) { |
| 4470 | if(XMLToken.isNCStartChar(current())) { |
| 4471 | token.add(':'); |
| 4472 | do { |
| 4473 | token.add(consume()); |
| 4474 | } while(XMLToken.isNCChar(current())); |
| 4475 | } else { |
| 4476 | --pos; |
| 4477 | } |
| 4478 | } |
| 4479 | return token.toArray(); |
| 4480 | } |
| 4481 | |
| 4482 | /** |
| 4483 | * Helper method for parsing NCNames. |
no test coverage detected