xmlbeans

How to get rid of generics warnings in code generated from xmlbeans-maven-plugin?

六眼飞鱼酱① 提交于 2019-12-11 03:39:28
问题 I have some code generated from xsd files by xmlbeans-maven-plugin. Unfortunately generated code uses raw collection types, like: java.util.List targetList = new java.util.ArrayList(); get_store().find_all_element_users(CURRENCY$0, targetList); Currency[] result = new Currency[targetList.size()]; targetList.toArray(result); which causes lots of warnings. Is there a way to force the plugin to generate generic types or generate @SupressWarnings annotations? I use maven v 2.0.9, xmlbeans-maven

java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.setSaveAggressiveNamespaces()Lorg/apache/xmlbeans/XmlOptions;

本秂侑毒 提交于 2019-12-11 03:27:52
问题 I am trying to write a program which write the data in Excel. But i keep getting an error which is shown below: Exception in thread "main" java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.setSaveAggressiveNamespaces()Lorg/apache/xmlbeans/XmlOptions; at org.apache.poi.POIXMLDocumentPart.<clinit>(POIXMLDocumentPart.java:56) at wriExcel.main(wriExcel.java:19) On finding the solutions, I could only find that I should use XMLBeans 2.0 or higher. But, I am using xmlbeans 2.3.0 . Is there

XmlBeans XmlDateTime format without timezone info

时间秒杀一切 提交于 2019-12-10 22:44:18
问题 I'm getting an Xml representation of an XmlObject using the xmlText() method. The XmlDateTime objects are coming out with timezone offsets at the end of the string which is valid according to XML Schema: dateTime. Is there any way to force the XmlObject to convert to xml with the Zulu formatting? Getting this: 2002-10-10T12:00:00-05:00 and need this instead: 2002-10-10T17:00:00Z 回答1: I was asking about the instantiation of the XmlDateTime object because I ran into a similar issue a while ago.

How to add a node to XML with XMLBeans XmlObject

孤街浪徒 提交于 2019-12-10 21:09:50
问题 My goal is to take an XML string and parse it with XMLBeans XmlObject and add a few child nodes. Here's an example document (xmlString), <?xml version="1.0"?> <rootNode> <person> <emailAddress>joefoo@example.com</emailAddress> </person> </rootNode> Here's the way I'd like the XML document to be after adding some nodes, <?xml version="1.0"?> <rootNode> <person> <emailAddress>joefoo@example.com</emailAddress> <phoneNumbers> <home>555-555-5555</home> <work>555-555-5555</work> <phoneNumbers> <

How to include automatically xmlbeans generated code into maven jar?

白昼怎懂夜的黑 提交于 2019-12-09 08:38:07
问题 I have a project which uses Apache Xmlbeans for databinding. Currently it is very simple it only has some Schema-Files in src/main/xsd and xsdconfig in src/main/xsdconfig. I want to include the generated Classes into the generated jar-File. It works if I specify the xmlbeans goal: "mvn xmlbeans:xmlbeans package" --> Creates a Jar with the xmlbeans classes But I want to do this within the normal build cycle: "mvn package" --> should create a jar with the xmlbeans classes, but won't. The pom is

Saxon XMLBeans Tomcat

只愿长相守 提交于 2019-12-08 04:13:19
问题 We recently updated our Tomcat web service. The only things we really updated were that we updated XMLBeans to version 2.4 and Saxon to version 9. Running it Netbeans and eclipse, our project now works fine, but when trying to deploy to tomcat we get the following. We tried updating JAXEN to version 1.1.1 but no joy. Any ideas? The error we get in deployment is: java.lang.IllegalArgumentException: dom4j-core,jdom,xml-apis,xerces,junit-Extension-Name at java.util.jar.Attributes$Name.

XMLBeans jar can't be signed when imported from custom class

妖精的绣舞 提交于 2019-12-07 04:46:59
问题 In NetBeans I created an Exporter class that exports some data to an EXCEL file using APACHE POI, which uses XMLBeans. I added the APACHE POI 3.10.1 libraries by downloading the zip binaries and adding the jars manually. When I use this class inside the same project, everything runs correctly. Then I added this class to another project, via right click Libraries -> Add Project. But when I tried running this I got the following error while compiling. Signing JAR: C:\Users\c\p\dist\lib\xmlbeans

How to XmlObject.selectPath() by *default* namespace?

China☆狼群 提交于 2019-12-06 01:23:39
I found this method of querying an XmlObject to return an element containing a particular namespace: XmlObject xobj = XmlObject.Factory.parse( "<a xmlns='testA'>\n" + " <B:b xmlns:B='testB'>\n" + " <B:x>12345</B:x>\n" + " </B:b>\n" + "</a>"); // Use xpath with namespace delcaration to find <B:b> element. XmlObject bobj = xobj.selectPath( "declare namespace B='testB'" + ".//B:b")[0]; This is pretty straightforward and can be used for other named namespaces, but how do I do the same for a default namespace? i.e. xmlns= like this: XmlObject xobj = XmlObject.Factory.parse( "<a xmlns='testA'>\n" +

XMLBeans jar can't be signed when imported from custom class

∥☆過路亽.° 提交于 2019-12-05 10:25:12
In NetBeans I created an Exporter class that exports some data to an EXCEL file using APACHE POI, which uses XMLBeans. I added the APACHE POI 3.10.1 libraries by downloading the zip binaries and adding the jars manually. When I use this class inside the same project, everything runs correctly. Then I added this class to another project, via right click Libraries -> Add Project. But when I tried running this I got the following error while compiling. Signing JAR: C:\Users\c\p\dist\lib\xmlbeans-2.6.0.jar to C:\Users\c\p\dist\lib\xmlbeans-2.6.0.jar as nb-jfx jarsigner: unable to sign jar: java

java简单的从数据库查询数据使用POI导出excel文件

寵の児 提交于 2019-12-04 14:38:01
个人公众号:Java技术大杂烩,每天10点精美文章准时奉上 使用java简单的从数据库中查询数据,然后写入到excel中,数据的类型为 List<Map<String, Object>>格式的数据。 首先下载POI的jar包,网址: https://poi.apache.org/download.html#POI-3.16-beta2 然后导入jar包到工程下 : 此外还需要 commons-collections4-4.1.jar 和 xmlbeans-2.6.0.jar 两个额外的jar包,因为我使用的是 3.15 版本的,所以 commons-collections4-4.1.jar 需要使用 4.1 版本的,原来使用的是 4.0 ,报错了。 这两个包可以在这里下载: https://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans/2.6.0 https://mvnrepository.com/artifact/org.apache.commons/commons-collections4/4.1 导入的类: import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.ss.usermodel.BorderStyle; import org