Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlString


        String xml1 = "<A xmlns='http://openuri.org/sgs'>\ta\ta\t</A>";
        String xml2 = "<B xmlns='http://openuri.org/sgs'>\tb\tb\t</B>";
        String xml3 = "<C xmlns='http://openuri.org/sgs'>\tc\tc\t</C>";

        ADocument d1 = ADocument.Factory.parse(xml1);
        XmlString a = d1.xgetA();
        assertTrue(a.schemaType().equals(XmlString.type));
        assertEquals("\ta\ta\t", a.stringValue());

        ADocument d2 = ADocument.Factory.parse(xml2);
        XmlString b = d2.xgetA();
        assertTrue(d2.schemaType().equals(BDocument.type));
        assertTrue(b.schemaType().equals(XmlNormalizedString.type));
        assertEquals(" b b ", b.stringValue());

        ADocument d3 = ADocument.Factory.parse(xml3);
        XmlString c = d3.xgetA();
        assertTrue(d3.schemaType().equals(CDocument.type));
        assertTrue(c.schemaType().equals(XmlToken.type));
        assertEquals("c c", c.stringValue());
    }
View Full Code Here


        Calendar cal = Calendar.getInstance();
        cal.setTime(task.getCreationDate());
        taskMetadataElement.setCreationDate(cal);

        for (String userOwner : task.getUserOwners()) {
            XmlString XmlStrUserOwner = taskMetadataElement.addNewUserOwner();
            XmlStrUserOwner.setStringValue(userOwner);
        }
        for (String roleOwner : task.getRoleOwners()) {
            XmlString XmlStrRoleOwner = taskMetadataElement.addNewRoleOwner();
            XmlStrRoleOwner.setStringValue(roleOwner);
        }

       
        for (String action : ACTIONS)
            createACL(action, task, roles, taskMetadataElement);
View Full Code Here

        RootDocument doc1 = RootDocument.Factory.parse(xml1);
        RootDocument.Root root = doc1.getRoot();
        assertTrue(doc1.validate());

        XmlString a = root.xgetAArray(0);
        assertTrue(a.schemaType().equals(XmlString.type));
        assertEquals("\ta\ta\t", a.stringValue());

        XmlString b = root.xgetAArray(1);
        assertTrue(b.schemaType().equals(XmlNormalizedString.type));
        assertEquals(" b b ", b.stringValue());

        XmlString c = root.xgetAArray(2);
        assertTrue(c.schemaType().equals(XmlToken.type));
        assertEquals("c c", c.stringValue());

        root.insertA(2, "d d");
        assertEquals("d d", root.getAArray(2));
        assertEquals(4, root.sizeOfAArray());
        root.removeA(2);
View Full Code Here

        String xml1 = "<A xmlns='http://openuri.org/sgs'>\ta\ta\t</A>";
        String xml2 = "<B xmlns='http://openuri.org/sgs'>\tb\tb\t</B>";
        String xml3 = "<C xmlns='http://openuri.org/sgs'>\tc\tc\t</C>";

        ADocument d1 = ADocument.Factory.parse(xml1);
        XmlString a = d1.xgetA();
        assertTrue(a.schemaType().equals(XmlString.type));
        assertEquals("\ta\ta\t", a.stringValue());

        ADocument d2 = ADocument.Factory.parse(xml2);
        XmlString b = d2.xgetA();
        assertTrue(d2.schemaType().equals(BDocument.type));
        assertTrue(b.schemaType().equals(XmlNormalizedString.type));
        assertEquals(" b b ", b.stringValue());

        ADocument d3 = ADocument.Factory.parse(xml3);
        XmlString c = d3.xgetA();
        assertTrue(d3.schemaType().equals(CDocument.type));
        assertTrue(c.schemaType().equals(XmlToken.type));
        assertEquals("c c", c.stringValue());
    }
View Full Code Here

      prop.add( XmlObject.Factory.parse( "<" + SushiPropertyQNames.IKA.getLocalPart(  ) + " xmlns=\""
                                         + SushiPropertyQNames.IKA.getNamespaceURI(  ) + "\">" + stringValue
                                         + "</" + SushiPropertyQNames.IKA.getLocalPart(  ) + ">" ) );
      assertEquals( 2,
                    prop.size(  ) );
      XmlString xString = (XmlString) prop.get( 1 );
      assertEquals( stringValue,
                    xString.getStringValue(  ) );
   }
View Full Code Here

      final String     stringValue = "somethang";
      prop.set( 0,
                XmlObject.Factory.parse( "<" + SushiPropertyQNames.IKA.getLocalPart(  ) + " xmlns=\""
                                         + SushiPropertyQNames.IKA.getNamespaceURI(  ) + "\">" + stringValue
                                         + "</" + SushiPropertyQNames.IKA.getLocalPart(  ) + ">" ) );
      XmlString xString = (XmlString) prop.get( 0 );
      assertEquals( stringValue,
                    xString.getStringValue(  ) );
   }
View Full Code Here

   /**
    * DOCUMENT_ME
    */
   public void testSet(  )
   {
      XmlString xString1 = XmlString.Factory.newInstance(  );
      xString1.setStringValue( "one" );
      XmlString xString2 = XmlString.Factory.newInstance(  );
      xString2.setStringValue( "two" );
      XmlCursor xmlCursor = xString1.newCursor(  );
      xmlCursor.toPrevToken(  );
      XmlObject object = xmlCursor.getObject(  );
      xString1 = (XmlString) object.set( xString2 );
      System.out.println( xString1 );
View Full Code Here

    }

    public void insertProperty( Object[] propElems ) throws CallbackFailedException
    {
        // Comment prop has cardinality of 0..1, so passed array will always have exactly one element
        XmlString xString = (XmlString) propElems[0];
        m_fileSystem.setComment( xString.getStringValue() );
    }
View Full Code Here

                commentDocXBean.setComment( comment );
                prop.add( commentDocXBean );
            }
            else
            {
                XmlString xString = (XmlString) prop.get( 0 );
                xString.setStringValue( comment );
            }
        }
        return prop;
    }
View Full Code Here

        }
        ParamModel newParamModel = intParamSpec.addNewParamModel();
        setParamModel(newParamModel, paramModel);
        PatchParamValues paramValues = intParamSpec.addNewPatchParamValues();
        for (String string : values) {
            XmlString paramValue = paramValues.addNewPatchParamValue();
            paramValue.setStringValue(string);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.XmlString

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.