RDF/XML: properly serialize predicates with xmlns: prefix

pull/696/head
Tpt 11 months ago committed by Thomas Tanon
parent 3241f47059
commit 4b3f3f3278
  1. 11
      lib/oxrdfxml/src/serializer.rs

@ -258,16 +258,7 @@ impl InnerRdfXmlWriter {
if prop_prefix == "http://www.w3.org/1999/02/22-rdf-syntax-ns#" {
(Cow::Owned(format!("rdf:{prop_value}")), None)
} else if prop_prefix == "http://www.w3.org/2000/xmlns/" {
if prop_value.is_empty() {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
"The http://www.w3.org/2000/xmlns/ predicate IRI is not allowed in XML",
));
}
(
Cow::Borrowed("p:"),
Some(("xmlns:p", triple.predicate.as_str())),
)
(Cow::Owned(format!("xmlns:{prop_value}")), None)
} else if prop_value.is_empty() {
(Cow::Borrowed("p:"), Some(("xmlns:p", prop_prefix)))
} else {

Loading…
Cancel
Save