XmlHelper.javaXML_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" — the standard XML header used when generating XML export files. Encoding is hardcoded as UTF-8 — a code-level decision, not configuration.
replaceQuotes(String xml) — quote normalizationReplaces single quotes (') with double quotes (") in XML strings. Javadoc: "This is useful for writing xml string constants e.g. in test cases." In Java string literals, single quotes for attributes avoid escaping, but valid XML requires double quotes. This method allows test code like: XmlHelper.replaceQuotes("<node name='test'/>") → "<node name=\"test\"/>".
fromString(String str) — string → dom4j ElementParses an XML string into a dom4j Element. Uses DocumentHelper.parseText(). Returns the root element (document.getRootElement()). On parse error, logs and returns null (doesn't throw — caller must null-check). For empty/blank strings, returns null.
toString(Element el, boolean prettyFormat) — dom4j Element → formatted XML stringSerializes a dom4j Element back to a string. Uses dom4j's XMLWriter with OutputFormat. When prettyFormat=true: enables newlines and 2-space indentation. Important: writer.close() is called to flush the buffer.
toString(org.w3c.dom.Document, boolean prettyFormat) — W3C DOM Document → stringWorks with a different XML type — org.w3c.dom.Document (used by SVG/Batik). Uses javax.xml.transform.Transformer (XSLT processor). With prettyFormat=true: adds INDENT=yes and Xalan-specific indent-amount=2. All errors are wrapped in InternalErrorException (unlike the dom4j method which logs and returns null) — because W3C DOM transformation errors are considered critical internal errors.
SvgXmlHelper or inline it into BatikImageRenderer.
868d6abb7 2025 → 2026 (copyright year update) 63081666f Source file headers: 2024→2025 b6092df09 Copyright 2023 → 2024 ab45d51fa Copyright 2001-2022 → 2001-2023 5f7ef41b8 Copyright 2021 → 2022 cd27dd997 package xstream → xmlstream ceb63e8a1 Source code header: (C) 2001-2021 7c79f1922 Copyright of source header → 2020 32f634b88 Optimize imports 000ca723d Remove pointless boolean expressions (business) dd5ca38ac CopyRight of all java file-header updated or created a5bbdca6a Change logger to slf4j f979e8a42 MGC-UPDATE: Update auf Version 3.0.0-SNAPSHOT 9ebb88522 Initial commit
a5bbdca6a switched the logger from a proprietary implementation to SLF4J — part of a project-wide logging standardization. 000ca723d removed pointless boolean expressions (e.g., == true or redundant null checks) during a code cleanup pass. f979e8a42 was a major version bump from 2.x to 3.0.0-SNAPSHOT.