Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlCursor.insertAttributeWithValue()


        // build xop:Include
        XmlCursor c = cursor.newCursor();
        c.removeXmlContents();
        c.toFirstContentToken();
        c.beginElement(XOP_INCLUDE_QNAME);
        c.insertAttributeWithValue(XOP_HREF_QNAME, "cid:" + contentId);
        c.toNextSibling();
        c.removeXml();
        c.dispose();
    }
View Full Code Here


                   
                    do {
                        c.toNextToken();
                    } while ( c.isAnyAttr() );
                   
                    c.insertAttributeWithValue( attrName, value );
                }
                finally
                {
                    c.dispose();
                }
View Full Code Here

        File schema = new File("ovaldi/xml/oval-directives-schema.xsd").getAbsoluteFile();
       
        XmlCursor cursor = directives.newCursor();
        cursor.toNextToken();
        cursor.insertAttributeWithValue(
                new QName(
                    "http://www.w3.org/2001/XMLSchema-instance",
                    "schemaLocation",
                    "xsi"),
                "http://oval.mitre.org/XMLSchema/oval-directives-5 "+schema.toURI());
View Full Code Here

        File schema = new File("ovaldi/xml/oval-variables-schema.xsd").getAbsoluteFile();
       
        XmlCursor cursor = variables.newCursor();
        cursor.toNextToken();
        cursor.insertAttributeWithValue(
                new QName(
                    "http://www.w3.org/2001/XMLSchema-instance",
                    "schemaLocation",
                    "xsi"),
                "http://oval.mitre.org/XMLSchema/oval-variables-5 "+schema.toURI());
View Full Code Here

        File schema = new File("ovaldi/xml/evaluation-ids.xsd").getAbsoluteFile();
       
        XmlCursor cursor = evaluationDefinitionIds.newCursor();
        cursor.toNextToken();
        cursor.insertAttributeWithValue(
                new QName(
                    "http://www.w3.org/2001/XMLSchema-instance",
                    "schemaLocation",
                    "xsi"),
                "http://oval.mitre.org/XMLSchema/ovaldi/evalids "+schema.toURI());
View Full Code Here

    static void preserveSpaces(XmlString xs) {
        String text = xs.getStringValue();
        if (text != null && (text.startsWith(" ") || text.endsWith(" "))) {
            XmlCursor c = xs.newCursor();
            c.toNextToken();
            c.insertAttributeWithValue(new QName("http://www.w3.org/XML/1998/namespace", "space"), "preserve");
            c.dispose();
        }
    }

    /**
 
View Full Code Here

                   
                    do {
                        c.toNextToken();
                    } while ( c.isAnyAttr() );
                   
                    c.insertAttributeWithValue( attrName, value );
                }
                finally
                {
                    c.dispose();
                }
View Full Code Here

            if (curs.currentTokenType().isStart())
            {
                // Can only add attributes inside of a start.
                curs.toNextToken();
            }
            curs.insertAttributeWithValue(qName, strValue);
        }

        curs.dispose();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.