Make xi:fallback work for the <xi:include parse="text"> case

parent 65f77e16
......@@ -276,7 +276,8 @@ impl XmlState {
}
fn inside_xinclude_start_element(&self, ctx: &XIncludeContext, name: &str) -> Context {
if name == "xi:fallback" {
// FIXME: we aren't using the xi: namespace
if name == "fallback" {
Context {
element_name: name.to_string(),
kind: ContextKind::XIncludeFallback(ctx.clone()),
......@@ -294,7 +295,8 @@ impl XmlState {
pbag: &PropertyBag,
) -> Context {
if ctx.need_fallback {
if name == "xi:include" {
// FIXME: we aren't using the xi: namespace
if name == "include" {
self.xinclude_start_element(handle, name, pbag)
} else {
self.element_creation_start_element(handle, name, pbag)
......@@ -309,7 +311,7 @@ impl XmlState {
fn xinclude_fallback_characters(&mut self, ctx: &XIncludeContext, text: &str) {
if ctx.need_fallback {
self.characters(text);
self.element_creation_characters(text);
}
}
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:xi="http://www.w3.org/2001/XInclude"
width="320" height="240">
<text x="10" y="100">
<xi:include href="nonexistent.txt" parse="text" encoding="UTF-8">
<xi:fallback>Hello fallback!</xi:fallback>
</xi:include>
</text>
</svg>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment