Java Code Examples for org.apache.xerces.util.XMLChar#isSpace()
The following examples show how to use
org.apache.xerces.util.XMLChar#isSpace() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TmxScanner.java From tmxeditor8 with GNU General Public License v2.0 | 6 votes |
private void scanCharReference() throws IOException { fStringBuffer2.clear(); boolean hex = entityScanner.peekChar() == 'x'; int ch = scanCharReferenceValue(fStringBuffer2, null); if (ch != -1) { int c = Integer.valueOf(fStringBuffer3.toString(), hex ? 16 : 10); if (c < 0x20 && !XMLChar.isSpace(c)) { return; } if (hex) {// appendCharacter("&x"); } else { appendCharacter("&"); } appendCharacter(fStringBuffer3.toString()); appendCharacter(";"); } else { appendCharacter("&#"); appendCharacter(fStringBuffer3.toString()); } }
Example 2
Source File: AsyncXMLReader.java From jlibs with Apache License 2.0 | 5 votes |
private boolean isWhitespace(Chars data){ char chars[] = data.array(); int end = data.offset()+data.length(); for(int i=data.offset(); i<end; i++){ if(!XMLChar.isSpace(chars[i])) return false; } return true; }
Example 3
Source File: TmxSchema.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
public boolean isTextAccept(QName qname, XMLString content) { boolean spaces = true; for (int i = content.offset; i < content.offset + content.length; i++) { spaces = spaces && XMLChar.isSpace(content.ch[i]); } if (spaces) { return true; } return acceptText.containsSymbol(qname.rawname); }
Example 4
Source File: TmxEntityScanner2.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
boolean skipSpaces() throws IOException, TmxEndEntityException { if (entity.position == entity.count) { load(0); } int c = entity.ch[entity.position]; if (XMLChar.isSpace(c)) { do { boolean finish = false; if (c == '\n' || c == '\r') { entity.lineNumber++; entity.columnNumber = 1; if (entity.position == entity.count - 1) { entity.ch[0] = (char) c; finish = load(1); if (!finish) { entity.position = 0; entity.startPosition = 0; } } if (c == '\r') { if (entity.ch[++entity.position] != '\n'){ entity.position--; } } } else { entity.columnNumber++; } if (!finish) entity.position++; if (entity.position == entity.count) { load(0); } } while (XMLChar.isSpace(c = entity.ch[entity.position])); return true; } return false; }
Example 5
Source File: TmxScanner2.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
private void scanCharReference() throws IOException, TmxEndEntityException { fStringBuffer2.clear(); boolean hex = entityScanner.peekChar() == 'x'; int ch = scanCharReferenceValue(fStringBuffer2, null); if (ch != -1) { int c = Integer.valueOf(fStringBuffer3.toString(), hex ? 16 : 10); if (c < 0x20 && !XMLChar.isSpace(c)) { return; } } }
Example 6
Source File: TmxEntityScanner.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
boolean skipSpaces() throws IOException { if (entity.position == entity.count) { load(0); } int c = entity.ch[entity.position]; if (XMLChar.isSpace(c)) { do { boolean finish = false; if (c == '\n' || c == '\r') { entity.lineNumber++; entity.columnNumber = 1; if (entity.position == entity.count - 1) { entity.ch[0] = (char) c; finish = load(1); if (!finish) { entity.position = 0; entity.startPosition = 0; } } if (c == '\r') { if (entity.ch[++entity.position] != '\n'){ entity.position--; } } } else { entity.columnNumber++; } if (!finish) entity.position++; if (entity.position == entity.count) { load(0); } } while (XMLChar.isSpace(c = entity.ch[entity.position])); return true; } return false; }
Example 7
Source File: TmxEntityScanner2.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
boolean skipDeclSpaces() throws IOException, TmxEndEntityException { // load more characters, if needed if (entity.position == entity.count) { load(0); } // skip spaces int c = entity.ch[entity.position]; if (XMLChar.isSpace(c)) { do { boolean entityChanged = false; // handle newlines if (c == '\n' || c == '\r') { entity.lineNumber++; entity.columnNumber = 1; if (entity.position == entity.count - 1) { entity.ch[0] = (char) c; entityChanged = load(1); if (!entityChanged) { // the load change the position to be 1, // need to restore it when entity not changed entity.position = 0; entity.startPosition = 0; } } if (c == '\r') { // REVISIT: Does this need to be updated to fix the // #x0D ^#x0A newline normalization problem? -Ac if (entity.ch[++entity.position] != '\n') { entity.position--; } } /*** * NEWLINE NORMALIZATION *** else { if (fCurrentEntity.ch[fCurrentEntity.position + 1] == '\r' && * external) { fCurrentEntity.position++; } } / ***/ } else { entity.columnNumber++; } // load more characters, if needed if (!entityChanged) entity.position++; if (entity.position == entity.count) { load(0); } } while (XMLChar.isSpace(c = entity.ch[entity.position])); return true; } return false; }
Example 8
Source File: TmxEntityScanner.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
public boolean skipDeclSpaces() throws IOException { // load more characters, if needed if (entity.position == entity.count) { load(0); } // skip spaces int c = entity.ch[entity.position]; if (XMLChar.isSpace(c)) { do { boolean entityChanged = false; // handle newlines if (c == '\n' || c == '\r') { entity.lineNumber++; entity.columnNumber = 1; if (entity.position == entity.count - 1) { entity.ch[0] = (char) c; entityChanged = load(1); if (!entityChanged) { // the load change the position to be 1, // need to restore it when entity not changed entity.position = 0; entity.startPosition = 0; } } if (c == '\r') { // REVISIT: Does this need to be updated to fix the // #x0D ^#x0A newline normalization problem? -Ac if (entity.ch[++entity.position] != '\n') { entity.position--; } } /*** * NEWLINE NORMALIZATION *** else { if (fCurrentEntity.ch[fCurrentEntity.position + 1] == '\r' && * external) { fCurrentEntity.position++; } } / ***/ } else { entity.columnNumber++; } // load more characters, if needed if (!entityChanged) entity.position++; if (entity.position == entity.count) { load(0); } } while (XMLChar.isSpace(c = entity.ch[entity.position])); return true; } return false; }