Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions common/src/main/java/org/fao/geonet/utils/Xml.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public final class Xml {
+ "]";
public static final String XML_VERSION_HEADER = "<\\?xml version=['\"]1.0['\"] encoding=['\"].*['\"]\\?>\\s*";

// cf. https://github.com/geonetwork/core-geonetwork/pull/8994
// switching from tiny (1) to tinyc (2) saxon tree model
// default being tiny, but tinyc is faster
public static final int SAXON_TREE_MODEL = Integer.parseInt(System.getProperty("SAXON_TREE_MODEL", "2"));

public static SAXBuilder getSAXBuilder(boolean validate) {
SAXBuilder builder = getSAXBuilderWithPathXMLResolver(validate, null);
Resolver resolver = ResolverWrapper.getInstance();
Expand Down Expand Up @@ -423,6 +428,7 @@ public static void transformWithXmlParam(Element xml, Source xslt, Result result
transFact.setAttribute(FeatureKeys.LINE_NUMBERING, true);
transFact.setAttribute(FeatureKeys.PRE_EVALUATE_DOC_FUNCTION, true);
transFact.setAttribute(FeatureKeys.RECOVERY_POLICY, Configuration.RECOVER_SILENTLY);
transFact.setAttribute(FeatureKeys.TREE_MODEL, SAXON_TREE_MODEL);
// Add the following to get timing info on xslt transformations
//transFact.setAttribute(FeatureKeys.TIMING,true);
} catch (IllegalArgumentException e) {
Expand Down Expand Up @@ -472,6 +478,7 @@ protected static Path resolvePath(Source s) throws URISyntaxException {
transFact.setAttribute(FeatureKeys.LINE_NUMBERING, true);
transFact.setAttribute(FeatureKeys.PRE_EVALUATE_DOC_FUNCTION, false);
transFact.setAttribute(FeatureKeys.RECOVERY_POLICY, Configuration.RECOVER_SILENTLY);
transFact.setAttribute(FeatureKeys.TREE_MODEL, SAXON_TREE_MODEL);

// Add the following to get timing info on xslt transformations
//transFact.setAttribute(FeatureKeys.TIMING,true);
Expand Down
Loading