root / webodf / lib / core / dummyxmlmodel.js_ @ a97612ce
History | View | Annotate | Download (647 Bytes)
| 1 | /*global exports require*/ |
|---|---|
| 2 | function createDummyXMLModel() {
|
| 3 | var that = {};
|
| 4 | |
| 5 | function preserveWhitespace(node) {
|
| 6 | return true; |
| 7 | } |
| 8 | |
| 9 | // return an array with child qnames or null for inserting text. |
| 10 | // the dummy implementation allows text everywhere, but no new elements |
| 11 | // "*" means all elements are allowed |
| 12 | // ["#PCDATA", "*"] means any element and text is allowed |
| 13 | function getAllowedChildren(node, position) {
|
| 14 | return [null]; |
| 15 | } |
| 16 | |
| 17 | that.getAllowedChildren = getAllowedChildren; |
| 18 | that.preserveWhitespace = preserveWhitespace; |
| 19 | return that; |
| 20 | } |
| 21 | exports.createDummyXMLModel = createDummyXMLModel; |