xmlbeans

Error when using XmlBeans generated classes

柔情痞子 提交于 2019-12-21 07:56:49
问题 I've generated classes with XMLBeans from an xsd file and packed them in a jar file. then I've added that jar to the project classpath in eclipse and everything compiles and runs fine. I built a stand alone jar file from my project with Maven and again the build is successful, but when i try running it i get this error: Exception in thread "main" java.lang.ExceptionInInitializerError at com.oblicore.oblisync.resolutions.TestsDocument$Factory.parse(TestsDo cument.java:126) at com.oblicore

Convert xml to java bean

家住魔仙堡 提交于 2019-12-18 12:32:11
问题 How can I covert a an xml file to a simple java bean? Its a simple xml file without any xsd, which was generated from a java bean, which I don't have access to. I tried using xmlbeans to first generate the xmd from xml and then to generate classes from the xsd. I got a bunch of classes. I am looking for a single java bean class. 回答1: JAXB JAXB (JSR-222) provides an easy way to convert objects to XML. There are many open source implementations of this standard including: Metro JAXB (the

Can't change row text in .docx file once row is added to table

走远了吗. 提交于 2019-12-12 20:19:44
问题 I have the problem with the following code: XWPFTable table = <get table somehow>; CTRow firstRow = table.getRow(0).getCtRow(); for (int i = 0; i < data.getRowCount(); i++) { CTRow ctRow = (CTRow) firstRow.copy(); XWPFTableRow row = new XWPFTableRow(ctRow, table); XWPFRun[] cellRuns = row.getTableCells() .stream() .map(c -> c.getParagraphs().get(0)) .map(p -> p.getRuns().isEmpty() ? p.createRun() : p.getRuns().get(0)) .toArray(XWPFRun[]::new); for (int j = 0; j < cellRuns.length; j++) {

XMLBeans: Get annotation of a nested element

ε祈祈猫儿з 提交于 2019-12-12 03:38:58
问题 I'm trying to get the annotation of an element that is declared within a xs:complexType in my XSD. Such an element is of type SchemaPreperty. However, unlike with SchemaGlobalElement and SchemaType, there is no SchemaProperty.getAnnotation() that I can use. This is the XSD. I need to access the documentation of element number . <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="test" type="my-test-type" /> <xs:complexType name="my-test-type"> <xs:sequence> <xs:element

How to map two similar XML Element using XMLBeam?

送分小仙女□ 提交于 2019-12-12 03:38:30
问题 This is the format of the XML so it is difficult for me to grab the 2nd instance: <sec2_Ind> <SectC_EntyType> <TextField3>1</TextField3> </SectC_EntyType> <nameInfo> <subName> <fName>Name 1</fName> </subName> </nameInfo> <SectC_EntyType> <TextField3>2</TextField3> </SectC_EntyType> <nameInfo> <subName> <fName>Name 2</fName> </subName> </nameInfo> <sec2_Ind> From above, I am only able to get the 1st instance details (Name 1) as the elements does not have unique identifier except for

how to generate java class from xsd by using xmlbeans in gradle

北战南征 提交于 2019-12-12 02:34:01
问题 I am new to gradle. In my project, i have xsd files and i would like to generate java classes from that xsd (using xmlbeans only). How to do that in gradle. I am using axis2 1.6.1, gradle, xmlbean 2.3.0` (JAXB is not an option in my current project). 回答1: As far as I know, you can use the "xmlbeansPlugin" for this. Can't say now, whether it's possible to change the xmlbean's version to the older one. All you need is to apply the plugin to your build script: apply from: 'https://raw.github.com

Can I validade a XML file against XSD fragment in Java

会有一股神秘感。 提交于 2019-12-12 01:58:49
问题 Can I validate a XML file against a xsd fragment? For example, I have a XML like: <tag1> <xx>...</xx> </tag1> And a XSD like: <xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="envTeste"> <xsd:complexType> <xsd:sequence> <xsd:element name="tag" minOccurs="1" maxOccurs="1"> <xsd:simpleType> <xsd:restriction base="xsd:int"> <xsd:totalDigits value="1" /> </xsd:restriction> </xsd:simpleType> </xsd:element>

XMLBeans - how to control generated class files? windows vs linux issues

孤街浪徒 提交于 2019-12-11 11:00:07
问题 I'm a newbie at this stuff, but I'm trying to port a Windows app over to Linux and encountered issues with the xmlbeans. We have a handful of xsd files generating class files. On Windows, I'll get Driver.class(2k) and Driver2.class(10k) . On Linux, the same build through Maven I'll get Driver.class(10k) and Driver2.class(2k) . So there appears to be an ordering issue which causes the Linux build application using these classes to not compile. The java code using Driver/Driver errors out with

org.apache.axiom.om.util.AXIOMUtil cannot be resolved

谁都会走 提交于 2019-12-11 07:31:22
问题 I'm trying to generate some stubs for a WSDL (using xmlbeans) and keep running into some issues. I'm using the following page: http://axis.apache.org/axis2/java/core/docs/userguide-creatingclients-xmlbeans.html The only part of these steps that I'm skipping is the "client.java" part because I already have another project ready I want to plug the resulting jars into. A quick run down of my steps are as follows: My WSDL is a crmonline instance, so I run something like this: C:\Work\aaa2

xmlbeans could not locate schema resource when repacking xml beans jar into my own jar

匆匆过客 提交于 2019-12-11 06:35:44
问题 I am writing an application that needs to be contained in a jar. The program needs to validate and grab data from an excel spreadsheet. Therefore I am using the Apache POI libraries which are dependent on xmlbeans jar. My problem is that when I include the xmlbeans jar in my jar using ant <jar ... <zipfileset src="${xmlbeans.jar}" includes="**/*" /> Build and then run the jar, I get the following error: Caused by: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled schema: Could