Java Code Examples for com.ctc.wstx.api.ReaderConfig#willSupportNamespaces()

The following examples show how to use com.ctc.wstx.api.ReaderConfig#willSupportNamespaces() . 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: DTDElement.java    From woodstox with Apache License 2.0 5 votes vote down vote up
/**
 * Method called to create an actual element definition, matching
 * an ELEMENT directive in a DTD subset.
 */
public static DTDElement createDefined(ReaderConfig cfg, Location loc, PrefixedName name,
                                       StructValidator val, int allowedContent)
{
    if (allowedContent == XMLValidator.CONTENT_ALLOW_UNDEFINED) { // sanity check
        ExceptionUtil.throwInternal("trying to use XMLValidator.CONTENT_ALLOW_UNDEFINED via createDefined()");
    }
    return new DTDElement(loc, name, val, allowedContent,
                          cfg.willSupportNamespaces(), cfg.isXml11());
}
 
Example 2
Source File: WstxDOMWrappingReader.java    From woodstox with Apache License 2.0 5 votes vote down vote up
protected WstxDOMWrappingReader(DOMSource src, ReaderConfig cfg)
    throws XMLStreamException
{
    super(src, cfg.willSupportNamespaces(), cfg.willCoalesceText());
    mConfig = cfg;
    // [WSTX-162]: allow enabling/disabling name/ns intern()ing
    if (cfg.hasInternNamesBeenEnabled()) {
        setInternNames(true);
    }
    if (cfg.hasInternNsURIsBeenEnabled()) {
        setInternNsURIs(true);
    }
}
 
Example 3
Source File: DTDElement.java    From woodstox with Apache License 2.0 4 votes vote down vote up
/**
 * Method called to create a "placeholder" element definition, needed to
 * contain attribute definitions.
 */
public static DTDElement createPlaceholder(ReaderConfig cfg, Location loc, PrefixedName name)
{
    return new DTDElement(loc, name, null, XMLValidator.CONTENT_ALLOW_UNDEFINED,
                          cfg.willSupportNamespaces(), cfg.isXml11());
}