All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.thymeleaf.templateparser.xmlsax.XmlValidatingSAXTemplateParser Maven / Gradle / Ivy

Go to download

Modern server-side Java template engine for both web and standalone environments

There is a newer version: 3.1.3.RELEASE
Show newest version
package org.thymeleaf.templateparser.xmlsax;

import java.util.List;

import org.thymeleaf.dom.Document;
import org.thymeleaf.dom.Node;

/**
 * 

* Parses XML documents, using a standard SAX parser. *

* *

* This implementation populates tree nodes with detailed location * information (document name and line number). *

* * @since 2.0.0 * * @author Guven Demir * @author Daniel Fernández * */ public final class XmlValidatingSAXTemplateParser extends AbstractValidatingSAXTemplateParser { // We simply add enough information for a non-validating parser to consider it alright // (a document root element declaration). private static final String FRAGMENT_WRAP_START = "\n"; private static final String FRAGMENT_WRAP_END = ""; public XmlValidatingSAXTemplateParser(final int poolSize) { super(poolSize); } @Override protected final String wrapFragment(final String fragment) { return FRAGMENT_WRAP_START + fragment + FRAGMENT_WRAP_END; } @Override protected final List unwrapFragment(final Document document) { return document.getFirstElementChild().getChildren(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy