XmlThemeBuilder: fix checkElement
This commit is contained in:
parent
61318bff8a
commit
9524c9d74d
@ -81,7 +81,7 @@ public class XmlThemeBuilder extends DefaultHandler {
|
|||||||
private static final int RENDER_THEME_VERSION_VTM = 1;
|
private static final int RENDER_THEME_VERSION_VTM = 1;
|
||||||
|
|
||||||
private enum Element {
|
private enum Element {
|
||||||
RENDER_THEME, RENDERING_INSTRUCTION, RULE, STYLE, ATLAS, RENDERING_STYLE
|
RENDER_THEME, RENDERING_INSTRUCTION, RULE, STYLE, ATLAS, RENDERING_STYLE, TAG_TRANSFORM
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String ELEMENT_NAME_RENDER_THEME = "rendertheme";
|
private static final String ELEMENT_NAME_RENDER_THEME = "rendertheme";
|
||||||
@ -375,7 +375,7 @@ public class XmlThemeBuilder extends DefaultHandler {
|
|||||||
getStringAttribute(attributes, "defaultlang"), getStringAttribute(attributes, "defaultvalue"));
|
getStringAttribute(attributes, "defaultlang"), getStringAttribute(attributes, "defaultvalue"));
|
||||||
|
|
||||||
} else if ("tag-transform".equals(localName)) {
|
} else if ("tag-transform".equals(localName)) {
|
||||||
checkState(qName, Element.RENDERING_STYLE);
|
checkState(qName, Element.TAG_TRANSFORM);
|
||||||
tagTransform(localName, attributes);
|
tagTransform(localName, attributes);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -870,14 +870,23 @@ public class XmlThemeBuilder extends DefaultHandler {
|
|||||||
|
|
||||||
case ATLAS:
|
case ATLAS:
|
||||||
parentElement = mElementStack.peek();
|
parentElement = mElementStack.peek();
|
||||||
// FIXME
|
if (parentElement != Element.RENDER_THEME) {
|
||||||
if (parentElement != Element.RENDER_THEME
|
|
||||||
&& parentElement != Element.ATLAS) {
|
|
||||||
throw new SAXException(UNEXPECTED_ELEMENT + elementName);
|
throw new SAXException(UNEXPECTED_ELEMENT + elementName);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case RENDERING_STYLE:
|
case RENDERING_STYLE:
|
||||||
|
parentElement = mElementStack.peek();
|
||||||
|
if (parentElement != Element.RENDER_THEME) {
|
||||||
|
throw new SAXException(UNEXPECTED_ELEMENT + elementName);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
|
case TAG_TRANSFORM:
|
||||||
|
parentElement = mElementStack.peek();
|
||||||
|
if (parentElement != Element.RENDER_THEME) {
|
||||||
|
throw new SAXException(UNEXPECTED_ELEMENT + elementName);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user