Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlTokenSource


                    Object dom;
                    if (obj instanceof XmlObjectBase) {
                        XmlObjectBase source = (XmlObjectBase)obj;
                        dom = source.newDomNode(options);
                    } else {
                        XmlTokenSource source = (XmlTokenSource)obj;
                        dom = source.newDomNode(options);
                    }
                   
                    if (dom instanceof Document) {
                        org.w3c.dom.Element e = ((Document)dom).getDocumentElement();
                        StaxUtils.copy(e, output);
                    } else if (dom instanceof DocumentFragment) {
                        DocumentFragment frag = (DocumentFragment) dom;
                        Node node = frag.getFirstChild();
                        while (node != null) {
                            if (node instanceof Element) {
                                StaxUtils.copy((Element)node, output);
                            } else if (node instanceof Comment) {
                                output.writeComment(((Comment)node).getData());
                            } else if (node instanceof Text) {
                                output.writeCharacters(((Text)node).getData());
                            }
                            node = node.getNextSibling();
                        }
                    } else {
                        throw new Fault("Invalid document type returned: " + dom.toString(), LOG);
                    }
                    return;
                }
               
                XMLStreamReader reader;
                if (obj instanceof XmlObjectBase) {
                    XmlObjectBase source = (XmlObjectBase)obj;
                    reader = source.newCursorForce().newXMLStreamReader(options);
                } else {
                    XmlTokenSource source = (XmlTokenSource)obj;
                    reader = source.newCursor().newXMLStreamReader(options);                   
                }
                SchemaType st = part == null ? null
                    : (SchemaType)part.getProperty(SchemaType.class.getName());
                if (st == null) {
                    try {
View Full Code Here


                    Object dom;
                    if (obj instanceof XmlObjectBase) {
                        XmlObjectBase source = (XmlObjectBase)obj;
                        dom = source.newDomNode(options);
                    } else {
                        XmlTokenSource source = (XmlTokenSource)obj;
                        dom = source.newDomNode(options);
                    }
                   
                    if (dom instanceof Document) {
                        org.w3c.dom.Element e = ((Document)dom).getDocumentElement();
                        StaxUtils.copy(e, output);
                    } else if (dom instanceof DocumentFragment) {
                        DocumentFragment frag = (DocumentFragment) dom;
                        Node node = frag.getFirstChild();
                        while (node != null) {
                            if (node instanceof Element) {
                                StaxUtils.copy((Element)node, output);
                            } else if (node instanceof Comment) {
                                output.writeComment(((Comment)node).getData());
                            } else if (node instanceof Text) {
                                output.writeCharacters(((Text)node).getData());
                            }
                            node = node.getNextSibling();
                        }
                    } else {
                        throw new Fault("Invalid document type returned: " + dom.toString(), LOG);
                    }
                    return;
                }
               
                XMLStreamReader reader;
                if (obj instanceof XmlObjectBase) {
                    XmlObjectBase source = (XmlObjectBase)obj;
                    reader = source.newCursorForce().newXMLStreamReader(options);
                } else {
                    XmlTokenSource source = (XmlTokenSource)obj;
                    reader = source.newCursor().newXMLStreamReader(options);                   
                }
                SchemaType st = (SchemaType)part.getProperty(SchemaType.class.getName());
                int i = reader.getEventType();
                if (i == XMLStreamReader.START_DOCUMENT) {
                    i = reader.next();
View Full Code Here

                    Object dom;
                    if (obj instanceof XmlObjectBase) {
                        XmlObjectBase source = (XmlObjectBase)obj;
                        dom = source.newDomNode(options);
                    } else {
                        XmlTokenSource source = (XmlTokenSource)obj;
                        dom = source.newDomNode(options);
                    }
                   
                    if (dom instanceof Document) {
                        org.w3c.dom.Element e = ((Document)dom).getDocumentElement();
                        StaxUtils.copy(e, output);
                    } else if (dom instanceof DocumentFragment) {
                        DocumentFragment frag = (DocumentFragment) dom;
                        Node node = frag.getFirstChild();
                        while (node != null) {
                            if (node instanceof Element) {
                                StaxUtils.copy((Element)node, output);
                            } else if (node instanceof Comment) {
                                output.writeComment(((Comment)node).getData());
                            } else if (node instanceof Text) {
                                output.writeCharacters(((Text)node).getData());
                            }
                            node = node.getNextSibling();
                        }
                    } else {
                        throw new Fault("Invalid document type returned: " + dom.toString(), LOG);
                    }
                    return;
                }
               
                XMLStreamReader reader;
                if (obj instanceof XmlObjectBase) {
                    XmlObjectBase source = (XmlObjectBase)obj;
                    reader = source.newCursorForce().newXMLStreamReader(options);
                } else {
                    XmlTokenSource source = (XmlTokenSource)obj;
                    reader = source.newCursor().newXMLStreamReader(options);                   
                }
                SchemaType st = part == null ? null
                    : (SchemaType)part.getProperty(SchemaType.class.getName());
                if (st == null) {
                    try {
View Full Code Here

                    Object dom;
                    if (obj instanceof XmlObjectBase) {
                        XmlObjectBase source = (XmlObjectBase)obj;
                        dom = source.newDomNode(options);
                    } else {
                        XmlTokenSource source = (XmlTokenSource)obj;
                        dom = source.newDomNode(options);
                    }
                   
                    if (dom instanceof Document) {
                        org.w3c.dom.Element e = ((Document)dom).getDocumentElement();
                        StaxUtils.copy(e, output);
                    } else if (dom instanceof DocumentFragment) {
                        DocumentFragment frag = (DocumentFragment) dom;
                        Node node = frag.getFirstChild();
                        while (node != null) {
                            if (node instanceof Element) {
                                StaxUtils.copy((Element)node, output);
                            } else if (node instanceof Comment) {
                                output.writeComment(((Comment)node).getData());
                            } else if (node instanceof Text) {
                                output.writeCharacters(((Text)node).getData());
                            }
                            node = node.getNextSibling();
                        }
                    } else {
                        throw new Fault("Invalid document type returned: " + dom.toString(), LOG);
                    }
                    return;
                }
               
                XMLStreamReader reader;
                if (obj instanceof XmlObjectBase) {
                    XmlObjectBase source = (XmlObjectBase)obj;
                    reader = source.newCursorForce().newXMLStreamReader(options);
                } else {
                    XmlTokenSource source = (XmlTokenSource)obj;
                    reader = source.newCursor().newXMLStreamReader(options);                   
                }
                SchemaType st = part == null ? null
                    : (SchemaType)part.getProperty(SchemaType.class.getName());
                if (st == null) {
                    try {
View Full Code Here

                XMLStreamReader reader;
                if (obj instanceof XmlObjectBase) {
                    XmlObjectBase source = (XmlObjectBase)obj;
                    reader = source.newCursorForce().newXMLStreamReader(options);
                } else {
                    XmlTokenSource source = (XmlTokenSource)obj;
                    reader = source.newCursor().newXMLStreamReader(options);                   
                }
                SchemaType st = (SchemaType)part.getProperty(SchemaType.class.getName());

                if (!st.isDocumentType()) {
                    if (StringUtils.isEmpty(part.getConcreteName().getNamespaceURI())) {
View Full Code Here

                    Object dom;
                    if (obj instanceof XmlObjectBase) {
                        XmlObjectBase source = (XmlObjectBase)obj;
                        dom = source.newDomNode(options);
                    } else {
                        XmlTokenSource source = (XmlTokenSource)obj;
                        dom = source.newDomNode(options);
                    }
                   
                    if (dom instanceof Document) {
                        org.w3c.dom.Element e = ((Document)dom).getDocumentElement();
                        StaxUtils.copy(e, output);
                    } else if (dom instanceof DocumentFragment) {
                        DocumentFragment frag = (DocumentFragment) dom;
                        Node node = frag.getFirstChild();
                        while (node != null) {
                            if (node instanceof Element) {
                                StaxUtils.copy((Element)node, output);
                            } else if (node instanceof Comment) {
                                output.writeComment(((Comment)node).getData());
                            } else if (node instanceof Text) {
                                output.writeCharacters(((Text)node).getData());
                            }
                            node = node.getNextSibling();
                        }
                    } else {
                        throw new Fault("Invalid document type returned: " + dom.toString(), LOG);
                    }
                    return;
                }
               
                XMLStreamReader reader;
                if (obj instanceof XmlObjectBase) {
                    XmlObjectBase source = (XmlObjectBase)obj;
                    reader = source.newCursorForce().newXMLStreamReader(options);
                } else {
                    XmlTokenSource source = (XmlTokenSource)obj;
                    reader = source.newCursor().newXMLStreamReader(options);                   
                }
                SchemaType st = part == null ? null
                    : (SchemaType)part.getProperty(SchemaType.class.getName());
                if (st == null) {
                    try {
View Full Code Here

                XMLStreamReader reader;
                if (obj instanceof XmlObjectBase) {
                    XmlObjectBase source = (XmlObjectBase)obj;
                    reader = source.newCursorForce().newXMLStreamReader(options);
                } else {
                    XmlTokenSource source = (XmlTokenSource)obj;
                    reader = source.newCursor().newXMLStreamReader(options);                   
                }
                SchemaType st = (SchemaType)part.getProperty(SchemaType.class.getName());

                if (st != null && !st.isDocumentType()) {
                    if (StringUtils.isEmpty(part.getConcreteName().getNamespaceURI())) {
View Full Code Here

                    Object dom;
                    if (obj instanceof XmlObjectBase) {
                        XmlObjectBase source = (XmlObjectBase)obj;
                        dom = source.newDomNode(options);
                    } else {
                        XmlTokenSource source = (XmlTokenSource)obj;
                        dom = source.newDomNode(options);
                    }
                   
                    if (dom instanceof Document) {
                        org.w3c.dom.Element e = ((Document)dom).getDocumentElement();
                        StaxUtils.copy(e, output);
                    } else if (dom instanceof DocumentFragment) {
                        DocumentFragment frag = (DocumentFragment) dom;
                        Node node = frag.getFirstChild();
                        while (node != null) {
                            if (node instanceof Element) {
                                StaxUtils.copy((Element)node, output);
                            } else if (node instanceof Comment) {
                                output.writeComment(((Comment)node).getData());
                            } else if (node instanceof Text) {
                                output.writeCharacters(((Text)node).getData());
                            }
                            node = node.getNextSibling();
                        }
                    } else {
                        throw new Fault("Invalid document type returned: " + dom.toString(), LOG);
                    }
                    return;
                }
               
                XMLStreamReader reader;
                if (obj instanceof XmlObjectBase) {
                    XmlObjectBase source = (XmlObjectBase)obj;
                    reader = source.newCursorForce().newXMLStreamReader(options);
                } else {
                    XmlTokenSource source = (XmlTokenSource)obj;
                    reader = source.newCursor().newXMLStreamReader(options);                   
                }
                SchemaType st = part == null ? null
                    : (SchemaType)part.getProperty(SchemaType.class.getName());
                if (st == null) {
                    try {
View Full Code Here

                    Object dom;
                    if (obj instanceof XmlObjectBase) {
                        XmlObjectBase source = (XmlObjectBase)obj;
                        dom = source.newDomNode(options);
                    } else {
                        XmlTokenSource source = (XmlTokenSource)obj;
                        dom = source.newDomNode(options);
                    }
                   
                    if (dom instanceof Document) {
                        org.w3c.dom.Element e = ((Document)dom).getDocumentElement();
                        StaxUtils.copy(e, output);
                    } else if (dom instanceof DocumentFragment) {
                        DocumentFragment frag = (DocumentFragment) dom;
                        Node node = frag.getFirstChild();
                        while (node != null) {
                            if (node instanceof Element) {
                                StaxUtils.copy((Element)node, output);
                            } else if (node instanceof Comment) {
                                output.writeComment(((Comment)node).getData());
                            } else if (node instanceof Text) {
                                output.writeCharacters(((Text)node).getData());
                            }
                            node = node.getNextSibling();
                        }
                    } else {
                        throw new Fault("Invalid document type returned: " + dom.toString(), LOG);
                    }
                    return;
                }
               
                XMLStreamReader reader;
                if (obj instanceof XmlObjectBase) {
                    XmlObjectBase source = (XmlObjectBase)obj;
                    reader = source.newCursorForce().newXMLStreamReader(options);
                } else {
                    XmlTokenSource source = (XmlTokenSource)obj;
                    reader = source.newCursor().newXMLStreamReader(options);                   
                }
                SchemaType st = (SchemaType)part.getProperty(SchemaType.class.getName());

                if (st != null && !st.isDocumentType()) {
                    if (StringUtils.isEmpty(part.getConcreteName().getNamespaceURI())) {
View Full Code Here

                    Object dom;
                    if (obj instanceof XmlObjectBase) {
                        XmlObjectBase source = (XmlObjectBase)obj;
                        dom = source.newDomNode(options);
                    } else {
                        XmlTokenSource source = (XmlTokenSource)obj;
                        dom = source.newDomNode(options);
                    }
                   
                    if (dom instanceof Document) {
                        org.w3c.dom.Element e = ((Document)dom).getDocumentElement();
                        StaxUtils.copy(e, output);
                    } else if (dom instanceof DocumentFragment) {
                        DocumentFragment frag = (DocumentFragment) dom;
                        Node node = frag.getFirstChild();
                        while (node != null) {
                            if (node instanceof Element) {
                                StaxUtils.copy((Element)node, output);
                            } else if (node instanceof Comment) {
                                output.writeComment(((Comment)node).getData());
                            } else if (node instanceof Text) {
                                output.writeCharacters(((Text)node).getData());
                            }
                            node = node.getNextSibling();
                        }
                    } else {
                        throw new Fault("Invalid document type returned: " + dom.toString(), LOG);
                    }
                    return;
                }
               
                XMLStreamReader reader;
                if (obj instanceof XmlObjectBase) {
                    XmlObjectBase source = (XmlObjectBase)obj;
                    reader = source.newCursorForce().newXMLStreamReader(options);
                } else {
                    XmlTokenSource source = (XmlTokenSource)obj;
                    reader = source.newCursor().newXMLStreamReader(options);                   
                }
                SchemaType st = part == null ? null
                    : (SchemaType)part.getProperty(SchemaType.class.getName());
                if (st == null) {
                    try {
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.XmlTokenSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.