"include-content-type", "indent", "media-type", "method", "normalization-form",
"omit-xml-declaration", "standalone", "undeclare-prefixes", "version"}, false);
Serialization serial = new Serialization(runtime, node);
String value = node.getAttributeValue(new QName("port"));
serial.setPort(value);
value = node.getAttributeValue(new QName("byte-order-mark"));
if (value != null) {
checkBoolean(node, "byte-order-mark", value);
serial.setByteOrderMark("true".equals(value));
}
value = node.getAttributeValue(new QName("cdata-section-elements"));
if (value != null) {
throw new UnsupportedOperationException("cdata-section-elements not yet supported");
}
value = node.getAttributeValue(new QName("doctype-public"));
serial.setDoctypePublic(value);
value = node.getAttributeValue(new QName("doctype-system"));
serial.setDoctypeSystem(value);
value = node.getAttributeValue(new QName("encoding"));
serial.setEncoding(value);
value = node.getAttributeValue(new QName("escape-uri-attributes"));
if (value != null) {
checkBoolean(node, "escape-uri-attributes", value);
serial.setEscapeURIAttributes("true".equals(value));
}
value = node.getAttributeValue(new QName("include-content-type"));
if (value != null) {
checkBoolean(node, "include-content-type", value);
serial.setIncludeContentType("true".equals(value));
}
value = node.getAttributeValue(new QName("indent"));
if (value != null) {
checkBoolean(node, "indent", value);
serial.setIndent("true".equals(value));
}
value = node.getAttributeValue(new QName("media-type"));
serial.setMediaType(value);
value = node.getAttributeValue(new QName("method"));
if (value != null) {
QName name = new QName(value, node);
if ("".equals(name.getPrefix())) {
String method = name.getLocalName();
if ("html".equals(method) || "xhtml".equals(method) || "text".equals(method) || "xml".equals(method)) {
serial.setMethod(name);
} else {
runtime.error(null, node,
"Only the xml, xhtml, html, and text serialization methods are supported.",
XProcConstants.stepError(1));
}
} else {
runtime.error(null, node,
"Only the xml, xhtml, html, and text serialization methods are supported.",
XProcConstants.stepError(1));
}
}
value = node.getAttributeValue(new QName("normalization-form"));
serial.setNormalizationForm(value);
value = node.getAttributeValue(new QName("omit-xml-declaration"));
if (value != null) {
checkBoolean(node, "omit-xml-declaration", value);
serial.setOmitXMLDeclaration("true".equals(value));
}
value = node.getAttributeValue(new QName("standalone"));
serial.setStandalone(value);
value = node.getAttributeValue(new QName("undeclare-prefixes"));
if (value != null) {
checkBoolean(node, "undeclare-prefixes", value);
serial.setUndeclarePrefixes("true".equals(value));
}
value = node.getAttributeValue(new QName("version"));
serial.setVersion(value);
for (XdmNode snode : new AxisNodes(runtime, node, Axis.CHILD, AxisNodes.PIPELINE)) {
throw XProcException.staticError(44, node, "p:serialization must be empty.");
}