Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlOptions


{
  private XmlOptions _xmlOptions;
 
  public ReginfoHandler()
  {   
    _xmlOptions = new XmlOptions();
    _xmlOptions.setUseDefaultNamespace();
    _xmlOptions.setSavePrettyPrint();
  }
View Full Code Here


{
  private XmlOptions _xmlOptions;
 
  public WatcherinfoHandler()
  {   
    _xmlOptions = new XmlOptions();
    _xmlOptions.setUseDefaultNamespace();
    _xmlOptions.setSavePrettyPrint();
  }
View Full Code Here

    HashMap<String, String> suggestedPrefixes = new HashMap<String, String>();
    suggestedPrefixes.put("urn:ietf:params:xml:ns:pidf:data-model", "dm");
    suggestedPrefixes.put("urn:ietf:params:xml:ns:pidf:rpid", "rpid");
    suggestedPrefixes.put("urn:ietf:params:xml:ns:pidf:cipid", "c");
   
    _xmlOptions = new XmlOptions();
    _xmlOptions.setUseDefaultNamespace();
    _xmlOptions.setSaveSuggestedPrefixes(suggestedPrefixes);
   
    /*
    _xmlOptions.setSaveImplicitNamespaces(suggestedPrefixes);
 
View Full Code Here

        return drawing;
    }

    @Override
    protected void commit() throws IOException {
        XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);

        /*
            Saved drawings must have the following namespaces set:
            <xdr:wsDr
                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
                xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing">
        */
        if(isNew) xmlOptions.setSaveSyntheticDocumentElement(new QName(CTDrawing.type.getName().getNamespaceURI(), "wsDr", "xdr"));
        Map<String, String> map = new HashMap<String, String>();
        map.put(NAMESPACE_A, "a");
        map.put(STRelationshipId.type.getName().getNamespaceURI(), "r");
        xmlOptions.setSaveSuggestedPrefixes(map);

        PackagePart part = getPackagePart();
        OutputStream out = part.getOutputStream();
        drawing.save(out, xmlOptions);
        out.close();
View Full Code Here

   *
   * @param out The stream to write to.
   * @throws IOException if an error occurs while writing.
   */
  public void writeTo(OutputStream out) throws IOException {
    XmlOptions options = new XmlOptions(DEFAULT_XML_OPTIONS);

    // Work on the current one
    // Need to do this, as we don't handle
    //  all the possible entries yet
        CTStylesheet styleSheet = doc.getStyleSheet();
View Full Code Here

    return chart;
  }

  @Override
  protected void commit() throws IOException {
    XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);

    /*
       Saved chart space must have the following namespaces set:
       <c:chartSpace
          xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart"
          xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
          xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
     */
    xmlOptions.setSaveSyntheticDocumentElement(new QName(CTChartSpace.type.getName().getNamespaceURI(), "chartSpace", "c"));
    Map<String, String> map = new HashMap<String, String>();
    map.put(XSSFDrawing.NAMESPACE_A, "a");
    map.put(XSSFDrawing.NAMESPACE_C, "c");
    map.put(STRelationshipId.type.getName().getNamespaceURI(), "r");
    xmlOptions.setSaveSuggestedPrefixes(map);

    PackagePart part = getPackagePart();
    OutputStream out = part.getOutputStream();
    chartSpace.save(out, xmlOptions);
    out.close();
View Full Code Here

    public SchemaTypeSystem compileSchemaTypeSystem(Definition definition) throws DeploymentException {
        List schemaList = new ArrayList();
        addImportsFromDefinition(definition, schemaList);
//        System.out.println("Schemas: " + schemaList);
        Collection errors = new ArrayList();
        XmlOptions xmlOptions = new XmlOptions();
        xmlOptions.setErrorListener(errors);
        xmlOptions.setEntityResolver(new JarEntityResolver());
        XmlObject[] schemas = (XmlObject[]) schemaList.toArray(new XmlObject[schemaList.size()]);
        try {
            SchemaTypeSystem schemaTypeSystem = XmlBeans.compileXsd(schemas, basicTypeSystem, xmlOptions);
            if (errors.size() > 0) {
                boolean wasError = false;
View Full Code Here

        }
    }

    static XmlObject parseWithNamespaces(Element element, Map namespaceMap) throws XmlException {
        ArrayList errors = new ArrayList();
        XmlOptions xmlOptions = XmlBeansUtil.createXmlOptions(errors);
        SchemaDocument parsed = SchemaDocument.Factory.parse(element, xmlOptions);
        if (errors.size() != 0) {
            throw new XmlException(errors.toArray().toString());
        }
        XmlCursor cursor = parsed.newCursor();
View Full Code Here

    }

    protected void XsetUp() throws Exception {
        File docDir = new File(BASEDIR, "src/test/data/connector_1_0");
        j2eeDD = new File(docDir, "ra.xml").toURL();
        xmlOptions = new XmlOptions();
        xmlOptions.setLoadLineNumbers();
        errors = new ArrayList();
        xmlOptions.setErrorListener(errors);
    }
View Full Code Here

//        if (!webXmlExists) {
                webXml.getParentFile().mkdirs();
                try {
                    FileWriter outFile = new FileWriter(webXml);

                    XmlOptions opts = new XmlOptions();
                    opts.setSaveAggressiveNamespaces();
                    opts.setSaveSyntheticDocumentElement(WebAppDocument.type.getDocumentElementName());
                    opts.setUseDefaultNamespace();
                    opts.setSavePrettyPrint();

    //                WebAppDocument doc = WebAppDocument.Factory.newInstance();
    //                doc.setWebApp(webApp);

                    outFile.write(shortWebApp.xmlText(opts));
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.XmlOptions

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.