当前位置: 首页>>代码示例>>Java>>正文


Java XMLString类代码示例

本文整理汇总了Java中org.apache.xerces.xni.XMLString的典型用法代码示例。如果您正苦于以下问题:Java XMLString类的具体用法?Java XMLString怎么用?Java XMLString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


XMLString类属于org.apache.xerces.xni包,在下文中一共展示了XMLString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ignorableWhitespace

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
/**
 * Ignorable whitespace. For this method to be called, the document
 * source must have some way of determining that the text containing
 * only whitespace characters should be considered ignorable. For
 * example, the validator can determine if a length of whitespace
 * characters in the document are ignorable based on the element
 * content model.
 *
 * @param text The ignorable whitespace.
 * @param augs     Additional information that may include infoset augmentations
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {

    try {
        // SAX1
        if (fDocumentHandler != null) {
            fDocumentHandler.ignorableWhitespace(text.ch, text.offset, text.length);
        }

        // SAX2
        if (fContentHandler != null) {
            fContentHandler.ignorableWhitespace(text.ch, text.offset, text.length);
        }
    }
    catch (SAXException e) {
        throw new XNIException(e);
    }

}
 
开发者ID:BowlerHatLLC,项目名称:feathers-sdk,代码行数:32,代码来源:AbstractSAXParserMMImpl.java

示例2: isUnchangedByNormalization

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
private int isUnchangedByNormalization(XMLString value) {
	int end = value.offset + value.length;
	for (int i = value.offset; i < end; ++i) {
		int c = value.ch[i];
		// Performance: For XML 1.0 documents take advantage of
		// the fact that the only legal characters below 0x20
		// are 0x09 (TAB), 0x0A (LF) and 0x0D (CR). Since we've
		// already determined the well-formedness of these
		// characters it is sufficient (and safe) to check
		// against 0x20. -- mrglavas
		if (c < 0x20) {
			return i - value.offset;
		}
	}
	return -1;
}
 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:17,代码来源:TmxScanner2.java

示例3: characters

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
public void characters(XMLString text, Augmentations augs)
    throws XNIException {
    if (!fIgnoreChars) {
        try {
            if (!fInCDATA) {
                fStreamWriter.writeCharacters(text.ch, text.offset, text.length);
            }
            else {
                fStreamWriter.writeCData(text.toString());
            }
        }
        catch (XMLStreamException e) {
            throw new XNIException(e);
        }
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:17,代码来源:StAXStreamResultBuilder.java

示例4: characters

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
public void characters(XMLString text, Augmentations augs)
        throws XNIException {
    if (fContentHandler != null) {
        // if the type is union it is possible that we receive
        // a character call with empty data
        if (text.length == 0) {
            return;
        }
        try {
            fContentHandler.characters(text.ch, text.offset, text.length);
        }
        catch (SAXException e) {
            throw new XNIException(e);
        }
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:17,代码来源:ValidatorHandlerImpl.java

示例5: processingInstruction

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
/** Processing instruction. */
public void processingInstruction(String target, XMLString data, Augmentations augs)
    throws XNIException {

    printIndent();
    fOut.print("processingInstruction(");
    fOut.print("target=");
    printQuotedString(target);
    fOut.print(',');
    fOut.print("data=");
    printQuotedString(data.ch, data.offset, data.length);
    if (augs != null) {
        fOut.print(',');
        printAugmentations(augs);
    }
    fOut.println(')');
    fOut.flush();

}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:20,代码来源:DocumentTracer.java

示例6: normalizeWhitespace

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
/**
 * Normalize whitespace in an XMLString converting all whitespace
 * characters to space characters.
 */
protected void normalizeWhitespace(XMLString value) {
    int end = value.offset + value.length;
    for (int i = value.offset; i < end; ++i) {
        int c = value.ch[i];
        // Performance: For XML 1.0 documents take advantage of 
        // the fact that the only legal characters below 0x20 
        // are 0x09 (TAB), 0x0A (LF) and 0x0D (CR). Since we've 
        // already determined the well-formedness of these
        // characters it is sufficient (and safe) to check
        // against 0x20. -- mrglavas
        if (c < 0x20) {
            value.ch[i] = ' ';
        }
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:20,代码来源:XMLScanner.java

示例7: internalEntityDecl

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
/** Internal entity declaration. */
public void internalEntityDecl(String name, XMLString text,
                               XMLString nonNormalizedText,
                               Augmentations augs)
    throws XNIException {

    printIndent();
    fOut.print("internalEntityDecl(");
    fOut.print("name=");
    printQuotedString(name);
    fOut.print(',');
    fOut.print("text=");
    printQuotedString(text.ch, text.offset, text.length);
    fOut.print(',');
    fOut.print("nonNormalizedText=");
    printQuotedString(nonNormalizedText.ch, nonNormalizedText.offset,
                      nonNormalizedText.length);
    if (augs != null) {
        fOut.print(',');
        printAugmentations(augs);
    }
    fOut.println(')');
    fOut.flush();

}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:26,代码来源:DocumentTracer.java

示例8: write

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
public void write(XMLString content) throws IOException, RepairableException {
	if (stack.fSize == 0) {
		return;
	}
	QName tq = new QName();
	stack.lastElement(tq);
	record.textAccept = schema.isTextAccept(tq, content);
	if (record.textAccept) {
		record.xmls.append(content);
	} else {
		record.textAccept = false;
		record.xmls.clear();
		record.tuset = false;
		throw new RepairableException(
				MessageFormat.format(Messages.getString("tmxeditor.tmxFileValidator.autofix.errorcode"), tq.rawname, ""));
	}
}
 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:18,代码来源:CorrectWriter.java

示例9: internalEntityDecl

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
/**
 * An internal entity declaration.
 *
 * @param name The name of the entity. Parameter entity names start with
 *             '%', whereas the name of a general entity is just the
 *             entity name.
 * @param text The value of the entity.
 * @param nonNormalizedText The non-normalized value of the entity. This
 *             value contains the same sequence of characters that was in
 *             the internal entity declaration, without any entity
 *             references expanded.
 * @param augs Additional information that may include infoset
 *                      augmentations.
 * @throws XNIException Thrown by handler to signal an error.
 */
public void internalEntityDecl(String name, XMLString text,
                               XMLString nonNormalizedText,
                               Augmentations augs) throws XNIException {

    int entityIndex = getEntityDeclIndex(name);
    if( entityIndex == -1){
        entityIndex = createEntityDecl();
        boolean isPE = name.startsWith("%");
        boolean inExternal = (fReadingExternalDTD || fPEDepth > 0);
        XMLEntityDecl  entityDecl = new XMLEntityDecl();
        entityDecl.setValues(name,null,null, null, null,
                             text.toString(), isPE, inExternal);

        setEntityDecl(entityIndex, entityDecl);
    }

}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:33,代码来源:DTDGrammar.java

示例10: comment

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
/**
 * A comment.
 * 
 * @param text The text in the comment.
 * @param augs   Additional information that may include infoset augmentations
 *
 * @throws XNIException Thrown by application to signal an error.
 */
public void comment(XMLString text, Augmentations augs) throws XNIException {
    // fixes E15.1
    if (fPerformValidation && fElementDepth >= 0 && fDTDGrammar != null) {
        fDTDGrammar.getElementDecl(fCurrentElementIndex, fTempElementDecl);
        if (fTempElementDecl.type == XMLElementDecl.TYPE_EMPTY) {
                fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, 
                                           "MSG_CONTENT_INVALID_SPECIFIED",
                                           new Object[]{ fCurrentElement.rawname,
                                                         "EMPTY",
                                                         "comment"},
                                           XMLErrorReporter.SEVERITY_ERROR);                
        }
    }
    // call handlers
    if (fDocumentHandler != null) {
        fDocumentHandler.comment(text, augs);
    }

}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:28,代码来源:XMLDTDValidator.java

示例11: processingInstruction

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
/**
 * A processing instruction. Processing instructions consist of a
 * target name and, optionally, text data. The data is only meaningful
 * to the application.
 * <p>
 * Typically, a processing instruction's data will contain a series
 * of pseudo-attributes. These pseudo-attributes follow the form of
 * element attributes but are <strong>not</strong> parsed or presented
 * to the application as anything other than text. The application is
 * responsible for parsing the data.
 * 
 * @param target The target.
 * @param data   The data or null if none specified.     
 * @param augs   Additional information that may include infoset augmentations
 *
 * @throws XNIException Thrown by handler to signal an error.
 */
public void processingInstruction(String target, XMLString data, Augmentations augs)
throws XNIException {

    // fixes E15.1
    if (fPerformValidation && fElementDepth >= 0 && fDTDGrammar != null) {
        fDTDGrammar.getElementDecl(fCurrentElementIndex, fTempElementDecl);
        if (fTempElementDecl.type == XMLElementDecl.TYPE_EMPTY) {
                fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, 
                                           "MSG_CONTENT_INVALID_SPECIFIED",
                                           new Object[]{ fCurrentElement.rawname,
                                                         "EMPTY",
                                                         "processing instruction"},
                                           XMLErrorReporter.SEVERITY_ERROR);                
        }
    }
    // call handlers
    if (fDocumentHandler != null) {
        fDocumentHandler.processingInstruction(target, data, augs);
    }
}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:38,代码来源:XMLDTDValidator.java

示例12: comment

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
/** Comment. */
public void comment(XMLString text, Augmentations augs) throws XNIException {
    fSeenAnything = true;
    consumeEarlyTextIfNeeded();
    if (fDocumentHandler != null) {
        fDocumentHandler.comment(text, augs);
    }
}
 
开发者ID:carson0321,项目名称:node-boilerpipe,代码行数:9,代码来源:HTMLTagBalancer.java

示例13: processingInstruction

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
/** Processing instruction. */
public void processingInstruction(String target, XMLString data,
                                  Augmentations augs) throws XNIException {
    fSeenAnything = true;
    consumeEarlyTextIfNeeded();
    if (fDocumentHandler != null) {
        fDocumentHandler.processingInstruction(target, data, augs);
    }
}
 
开发者ID:carson0321,项目名称:node-boilerpipe,代码行数:10,代码来源:HTMLTagBalancer.java

示例14: ignorableWhitespace

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
@Override
public void ignorableWhitespace(XMLString arg0, Augmentations arg1)
        throws XNIException {
  if(DEBUG_UNUSED) {
    Out.println("ignorableWhitespace: " + arg0);
  }
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:8,代码来源:NekoHtmlDocumentHandler.java

示例15: characters

import org.apache.xerces.xni.XMLString; //导入依赖的package包/类
public void characters( XMLString text, Augmentations augs ) throws XNIException {
    if (_activeScriptBlock != null) {
        _activeScriptBlock.append( text.ch, text.offset, text.length );
    } else {
        super.characters( text, augs );
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:ScriptFilter.java


注:本文中的org.apache.xerces.xni.XMLString类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。