Re: Getting XMLBeans out of Attic
Hi Nick, I was wondering if this was going to get off the ground. I'm still game to work on this and have been poking at bits on my github fork. As a prior committer all the legalese has been completed once before. Do I or should I do anything else for this incubating project? -jacobd On Oct 24, 2013 4:43 AM, Nick Burch apa...@gagravarr.org wrote: On Thu, 24 Oct 2013, Tammo van Lessen wrote: Me too, I can also serve as a mentor. Perhaps we should also inform attic (and board?) when we get this started so that the actual move to attic can be avoided. I think the attic already knows? I've created an initial proposal, feedback welcome! I've also added the people who volunteered in this thread. Jerry and Serkan - there's a few bits you need to edit about yourselves on the wiki The proposal is available at: https://wiki.apache.org/**incubator/XMLBeansProposalhttps://wiki.apache.org/incubator/XMLBeansProposal Nick --**--**- To unsubscribe, e-mail: user-unsubscribe@xmlbeans.**apache.orguser-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Project still maintained?
Hi Elvis, The XMLBeans project is in the process of moving to the attic http://www.mail-archive.com/dev%40xmlbeans.apache.org/msg02815.html -jacobd On Mon, Jul 22, 2013 at 10:28 AM, Elvis Stansvik elvst...@gmail.com wrote: Hi folks, I had a look at the bugs reported over the past 6 months (496-503) [1]. None of these 7 bugs have been assigned to anyone, and none have been commented on by a commiter/maintainer. Most of them are fairly well described and have test cases/good description, or at least an idea of a fix. Two of them include actual patches. One of them seems to be a dupe. So my question is: Is the project still maintained? Not complaining, just interested in what the status is, since use XMLBeans and like it a lot. Best regards, Elvis Stansvik [1] https://issues.apache.org/jira/issues/?jql=project%20%3D%20XMLBEANS%20AND%20created%20%3E%3D%202013-01-01%20AND%20created%20%3C%3D%202013-07-22%20ORDER%20BY%20created%20DESC%2C%20key%20DESC
Re: using xmlbeans on client side (in conjunction with axis2); null returns although data is available
Have you tried validating the payload? If there are errors that could indicate what is causing the error. Otherwise, I've only used XMLBeans with document/literal webservices and I don't remember how rpc encoded array are handled. -jacobd On Mon, Nov 26, 2012 at 9:32 PM, Tim Watts t...@cliftonfarm.org wrote: On Mon, 2012-11-26 at 12:40 +0100, moh.sushi wrote: Hi Tim, thank yor for your answer. going into generated source code, apply https://recettage.ria.neopod.fm-ged.com/ws; in first arg for qname = private static final javax.xml.namespace.QName RETURN$0 = new javax.xml.namespace.QName(https://recettage.ria.neopod.fm-ged.com/ws;, return); Repack jar-file (of generated classes) and start test Unfortunately, test fails = java.lang.ClassCastException: org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be cast to com.fm_ged.neopod.ria.recettage.ws.Order at com.fm_ged.neopod.ria.recettage.ws.impl.GetImageURLResponseDocumentImpl$GetImageURLResponseImpl.getReturn(GetImageURLResponseDocumentImpl.java:102) Well, you shouldn't have to monkey with the generated code like that. If it wasn't generated correctly you need to look into why that's happening. The ClassCastException may just be another side effect of incorrectly generated code. Another possibility is to make sure the client has schemaorg_apache_xmlbeans available in its classpath. This should be produced from the xmlbeans compiler. I'm no expert but I think the XmlAnyType is what xmlbeans uses when it can't map an xml doc to a schema and thus a bean type. Which suggests the client may not have these in its classpath (even if they're physically present on the client). But if it's in the root of the client jar and you're running this from the jar then that should be sufficient. Also, maybe consider using the latest version of XmlBeans if possible. I've been using v2.5.0 so I may be talking apples to your oranges. Regards, Sascha On Mon, Nov 26, 2012 at 12:09 PM, Tim Watts t...@cliftonfarm.org wrote: On Mon, 2012-11-26 at 08:37 +0100, moh.sushi wrote: Hello together, i have a problem with using xmlbeans. Following situation is given. - remote wsdl available (see http://pastebin.com/5qnFScMx) - code generation using axis2 and databinding xmlbeans i can do a request and i get a response, too. The problem is while iterating through given response. I just want to get part of the response with xmlbeans therefore i post the question on this mailing list. this is toString-ouput of the response: (1) GetImageURLResponse xmlns=https://recettage.ria.neopod.fm-ged.com/ws; xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; return CODE_ORDERxyz/CODE_ORDER PICTURES item OCD2011-10-20/OCD PICTURE_ID1/PICTURE_ID URLhttps://host.fr/images/1.jpg/URL SCAN_DATE2011-11-18/SCAN_DATE /item item OCD2011-10-20/OCD PICTURE_ID2/PICTURE_ID URLhttps://host.fr/images/2.jpg/URL SCAN_DATE2011-10-31/SCAN_DATE /item item OCD2011-10-20/OCD PICTURE_ID3/PICTURE_ID URLhttps://host.fr/images/3.jpg/URL SCAN_DATE2011-11-18/SCAN_DATE /item /PICTURES /return /GetImageURLResponse the toString output of the return fragement (2) xml-fragment xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:ws=https://recettage.ria.neopod.fm-ged.com/ws; ws:return ws:CODE_ORDERyxz/ws:CODE_ORDER ws:PICTURES ws:item ws:OCD2011-10-20/ws:OCD ws:PICTURE_ID1/ws:PICTURE_ID ws:URLhttps://host.fr/images/1.jpg/ws:URL ws:SCAN_DATE2011-11-18/ws:SCAN_DATE /ws:item ws:item ws:OCD2011-10-20/ws:OCD ws:PICTURE_ID2/ws:PICTURE_ID ws:URLhttps://host.fr/images/2.jpg/ws:URL
Re:
Hi Nick, If you look in the manifest from oldxbean.jar you can get the svn info for the sources that were used to create the jar. In the latest trunk I see something like Apache XmlBeans version 2.3.0-r532896 which means you could grab the r532896 revision and that should have the sources you are looking for. oldxbean.jar is used to 'bootstrap' the build and I used to have a much better understanding of what that meant exactly. I vaguely remember it had something to do with needing to compile the main schema xsd's as part of the build. HTH, -jacobd On Tue, Sep 25, 2012 at 10:07 AM, buzz lightyear buzzheavyy...@hotmail.com wrote: Hi, I've spent most of the day trying to track down the source of oldxbean.jar, in particular the source of the org.apache.xmlbeans.impl.xb package. Could somebody possibly point me in the right direction to a source archive. I've pulled down all of the archived xmlbeans distributions - no luck. Very grateful for any kind of answer - it's been a long day. Thanks in advance, Nick - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Trying to find a nice XML Bean with generic put functionality
I can't say I've needed xmlbeans for this, but I've used free marker templates to do something similar based on map key/values. Would that work for you? -jacobd On Aug 25, 2012 8:29 PM, Craig Burlock craig.burl...@gmail.com wrote: Hello everyone! Does anyone know of a bean / object with a put method that is designed to be XMLizable using the key name and it's value object? Something like this: *BeanObject root = new BeanObject(); beanObject.put(name, Joe Smith); beanObject.put(gender, Male); beanObject.put(age, 22);* ...will produce this xml: *root nameJoe Smith/name genderMale/gender age22/age /root* I'm certain I've used a Java Object that does this may moons ago. The standard Java Map kinda works, but it produces excessive nodes and the node names aren't based on the key. I am wanting something generic because I would like to avoid creating new classes just so my xml is clean... Can anyone help me find the Object I am looking for (or is this my version of Skittle-Brew)?
Re: Updating from 2.2.0 to 2.5.0: Migrationpath and Compatibility issues
Hi Oliver, I don't know of anything specific but the only issues I've had with this sort of migration/upgrade were my own and were caused by using different JDK versions when compiling some newer schemas with some older dependent schemas. It was a simple fix to set the javac target/source attribute in my ant file. When you give this a try, please let the list know what if any issues you encounter. -jacobd On Thu, Jun 21, 2012 at 2:08 AM, Oliver Meyer oliver.me...@dsa-ac.de wrote: Hi, in a project in which we are using xmlbeans 2.2.0 and used it to generate classes for multiple different schema files, we now need to update the xmlbeans lib (we just created a schema, for which 2.2.0 can no longer generate correct classes). Is there a document describing (in-)compatibilities between these versions and what to do to update? We are using xmlbeans mainly to read in xml files. Rarely we create files with it. I like to now specifically: 1. Do I have to regenerate all schema specific libs from the .xsd files? 2. Are there known incompatibilities in behaviour? 3. Are xmlbeans 2.2.0 and 2.5.0 declared to be compatible? What kind of compatibility is meant here? I did not find any information concerning this migration use case on the apache page. If some one could point me to it, I would be more than happy to read. The only thing I could find, was the pointer to the common error of not adding the qname library to the class path. But, I was looking for a positive list of what to do, so that an update will work in the first place. I guess (but I like that to be confirmed) that update from 2.x to 2.x+y should work without regenerating, without compile time issues, and (if I do not depend on a buggy behaviour in 2.x) without changes in the application code, unless I like to use a new feature. Any pointers? Cheers, Oliver -- oliver.me...@dsa-ac.de +49 (0)2408 9492 - 793 DSA - Daten- und Systemtechnik GmbH Pascalstraße 28, 52076 Aachen, Germany http://www.dsa.de Sitz und Registergericht/Domicile and Court of Registry: Aachen HRB-Nr./Commercial Register No.: 11960 Geschäftsführung/Board of Management: Dr. Eckhard Schulz, Dr. Volker Gehring, Dr. Ansgar Schleicher - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Scoped default namespaces
There are a couple other XMLOptions available like setSaveAggressive and setSaveDefault Namespace methods to render what you want. -jacobd On Jun 8, 2012 1:44 AM, Kaan Yamanyar k...@yamanyar.com wrote: Hi, Is there a possible way to make use of default scoped name spaces? I have not found any resources for this issue. instead of: alfa data=abc xmlns=http://test1.com/; mus:beta xmlns:mus=http://test2.com; mus:a1234567897/mus:a mus:s777666/mus:s /mus:beta /alfa I would like to have: alfa data=abc xmlns=http://test1.com/; beta xmlns=http://test2.com; a1234567897/a s777666/s /beta /alfa note: Map map = new HashMap(); map.put(http://test1.com/,;); map.put(http://test2.com/,;); xo.setSaveSuggestedPrefixes(map); does not work Cheers, Kaan
Re: Multiple schema jars
Hi Bob, I'm not sure what you mean by lib dependency but thought this link might be of some use http://wiki.apache.org/xmlbeans/XmlBeansFaq#schemaDependencies Are both baseschemas.jar and vendor1.jar on the classpath during execution? Can you try doing a Class.getResource or something along those lines and accessing a resource or file in baseschemas.jar before your call to getClassA? Please let me know if this works. HTH, -jacobd On Tue, Jan 10, 2012 at 6:59 AM, Bob Harvey robert.l.harvey...@gmail.com wrote: Hi, I am developing in Netbeans and need to provide our customer APIs a base XMLBean library (for example sake, call it baseschemas.jar. This base library will be used to support different vendors the ability to build their own customized XMLBean objects. In my testing, I have created a XMLBean library called Vendor1 (vendor1.jar). In vendor1.jar, I have Class B which contains a class member, Class A, defined in baseschemas.jar. The Vendor1 Netbeans project module compiles with no problems (baseschemas.jar is a lib dependency). However, in my Netbeans app at runtime, when Class B attempts to access Class A (getClassA), a null pointer exception occurs: java.lang.NullPointerException at org.apache.xmlbeans.impl.schema.SchemaPropertyImpl.getType(SchemaPropertyImpl.java:92) at org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createElementType(SchemaTypeImpl.java:965) at org.apache.xmlbeans.impl.values.XmlObjectBase.create_element_user(XmlObjectBase.java:924) at org.apache.xmlbeans.impl.store.Xobj.getUser(Xobj.java:1669) at org.apache.xmlbeans.impl.store.Xobj.find_element_user(Xobj.java:2074) at vendors1.impl.ClassBImpl.getClassA(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at groovy.lang.MetaClassImpl$GetBeanMethodMetaProperty.getProperty(MetaClassImpl.java:3460) at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:61) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:237) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetPropertySafe(AbstractCallSite.java:343) I have tried using XMLBeans 2.4 and 2.5 and the same result occurs. Any help is much appreciated, Thanks! - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Adding linked image to XLSX corrupts previous drawings
Hey Michael, I don't have the knowledge of POI to really understand whats going on here but I'll give it a shot. patriarch.createLinkedPicture(anchor, uri.toString()); What is uri.toString here? is uri and xmlbeans type? if so, what is it a type of? What were you expecting the value to be? it looks likes the code should create something like a href=uri.toString() .../ is that correct? If so, where does the image/link href get interpretted? workbook.write(outDoc); Can you post the resulting code snippet of this section of the workbook to highlight the error in the output? Thanks, -jacobd On Tue, Jan 3, 2012 at 11:27 AM, Michael Benoit mbenoit2...@gmail.com wrote: When adding a linked image to an XLSX using POI that already has at least one drawing, the resulting file is corrupted but can be recovered. However the original drawings are gone. Here is a code fragment: Workbook workbook = getWorkbook(doc); Sheet sheet = workbook.getSheetAt(0); Drawing patriarch = sheet.createDrawingPatriarch(); ClientAnchor anchor = workbook.getCreationHelper().createClientAnchor(); anchor.setCol1(0); anchor.setRow1(0); anchor.setDx1(100); anchor.setDy1(100); patriarch.createLinkedPicture(anchor, uri.toString()); workbook.write(outDoc); doc.close(); outDoc.close(); I know that POI does not consider this a bug on their end so I was wondering if this has to do with xmlbeans and if I could custom compile xmlbeans so that I don't have this problem. Thanks, Michael Benoit - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: schemaorg_apache_xmlbeans.system.sB96777C4495A76B8788F8D7E0FEDDCED.TypeSystemHolder
I'm not sure of your usecase here, but how are you compiling and packaging your schemas? Is the compiled schema all in one jar? My guess is probably not, but can you confirm? -jacobd On Mon, Dec 5, 2011 at 4:30 PM, MurphyR murphyricha...@gmail.com wrote: Environment: Axis2, Tomcat 6, hibernate, SQLserver2008. Task I am exposing the PersonManager.AddPerson() method as a Webservice. Observations: I get the following error: Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.sB96777C4495A76B8788F8D7E0FEDDCED.TypeSystemHolder. Make sure the generated binary files are on the classpath. at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783) at org.openhie.openempi.configuration.xml.MpiConfigDocument.clinit(MpiConfigDocument.java:20) ... 31 more Caused by: java.lang.ClassNotFoundException: schemaorg_apache_xmlbeans.system.sB96777C4495A76B8788F8D7E0FEDDCED.TypeSystemHolder at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:769) ... 32 more I placed the schemaorg_apache_xmlbeans directory in the WEB-INF\classes directory of the axis2 webapp and still I get the same error as above. Looks like it did not find it, I request to please let me know the correct path. I need help on this. Thanks in Advance -- View this message in context: http://old.nabble.com/schemaorg_apache_xmlbeans.system.sB96777C4495A76B8788F8D7E0FEDDCED.TypeSystemHolder-tp32921399p32921399.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: XML basics
Hi Heather, I'm not sure this is the best mailing list for your question as its pretty specific to a particular set of technologies related to XML Schema and java technologies. I haven't ever used CSS with XML, only with HTML, but they work roughly the same. CSS is just used to apply styling to an XML instance. I would think it better to use CSS3 as it is the latest emerging standard A good intro to XML is available via the standards body W3C at: http://www.w3.org/standards/xml/core Information on CSS is available from w3c as well http://www.w3.org/Style/CSS/learning XPath is a standard to refer to locations within an xml instance. http://www.w3.org/TR/xpath/ If you did mean HTML, I like HTML5rocks.com While not completely standards conforming, there is a pretty simple explanation of using all of these technologies on http://www.w3schools.com Others from the list may have other recommendations for coming up to speed with these technologies. HTH, -jacobd On Sun, Nov 13, 2011 at 10:42 AM, just a beginner heather.edmu...@aggiemail.usu.edu wrote: Hello! I'm just starting out my college education in technical writing, and for a class I've been researching XML. I'm understanding just the basics of XML, but realize it works well with CSS. Is it better to use CSS or CSS 2? Also, I keep running into the term xpath. Can someone explain what xpath is? All help will be greatly appreciated. Thanks! -- View this message in context: http://old.nabble.com/XML-basics-tp32835889p32835889.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: time to execute an xquery
Are you looking for some kinf of API from xmlbeans? When I've wanted this information I've just tossed out some timestamps to the log pre and post query execution. Will that not work for your case? -jacobd On Oct 23, 2011 6:29 PM, tejaswi chennubhotlla tejaswi@gmail.com wrote: Hi All How do I know the time taken to execute an xquery on an xml file. Thank you Tej
Re: xmlsbeans 2.5 does not check sequence order ?
In general xmlbeans will not throw an exception for instances that are invalid according to the schema. If you want to throw an exception on this, try validating the instance with an xmloptions that includes an error listener. If after checking the error list for errors you are concerned with after validation you can throw your own exception. HTH, -jacobd On May 4, 2011 11:18 AM, philippe.legay.exte...@telintrans.fr wrote: Hello, I parse a xml string, but wmlsbeans does not see that the version element is not present ! I am expecting an exception like I have one when there is a syntax error in the xml string. So my problems with xmlsbeans 2.5 are : - xmlsbeans does not throw an exception when an element of a sequence is not here ? - xmlsbeans does not throw an exception when an element of a sequence is not at the right position ? - xmlsbeans does not throw an exception when an element of a sequence is not declared in the XSD ? My java code is : DeclareParcelsAndCustomsResponseDocument ansDoc = DeclareParcelsAndCustomsResponseDocument.Factory.parse(answer); DeclareParcelsAndCustomsResponseDocument.DeclareParcelsAndCustomsResponse ans = ansDoc.getDeclareParcelsAndCustomsResponse() ; XSD Source === ?xml version=1.0 encoding=UTF-8? xsd:schema targetNamespace=http://www.colis-logistique.com/i-net/wsapi; xmlns:xsd=http://www.w3.org/2001/XMLSchema; elementFormDefault=qualified xsd:element name=DeclareParcelsAndCustomsResponse xsd:complexType xsd:sequence xsd:element name=Version type=xsd:string minOccurs=1 maxOccurs=1/ xsd:element name=Timestamp type=xsd:string minOccurs=1 maxOccurs=1/ xsd:element name=AckCode type=xsd:string minOccurs=1 maxOccurs=1/ xsd:element name=HMacBase64Code type=xsd:string minOccurs=1 maxOccurs=1/ /xsd:sequence /xsd:complexType /xsd:element /xsd:schema XML String = wsap:DeclareParcelsAndCustomsResponse xmlns:wsap=http://www.colis-logistique.com/i-net/wsapi; wsap:Timestamp2011-05-02T16:57:33.136Z/wsap:Timestamp wsap:AckCodeSUCCESS/wsap:AckCode wsap:HMacBase64CodeZjY5MDdlYWI4MGQxMGQ3MjM5OTExZmVmNjQ1NjY3ZDY3NTVkYmQ5MGQ4YTViM2JlOTE1OWU3ODFjZGJlYjIxNg==/wsap:HMacBase64Code /wsap:DeclareParcelsAndCustomsResponse validate xsd .xml = OK : There is no VERSION : I agree with this. But, I do not have the same behavior in my own java code ? Any idea ? Thanks, PHL ___ Philippe LEGAY TELINTRANS Direction Production Département Intégration des Projets E-Mail : philippe.legay.exte...@telintrans.fr Tel : (+33) 01 56 30 74 24 P Afin de contribuer au respect de l'environnement, merci de n'imprimer ce courriel que si nécessaire.
Re: Problem with xml files if length of file is exact 8193 bytes
Could you file a jira issue and attach one of the xml instances you are seeing this with? Thanks, -jacobd On Apr 29, 2011 2:32 AM, Hugo de Oude hdo...@allshare.nl wrote: Hello, We get the error 'Unexcpected element: CDATA' if the length of an xml file is exactly 8193. This can be reproduced using the xmlbeans 2.4.0 and 2.5.0 version. This can be reproduced by any xml file as long as the length of the file is exaclty 8193. Can this be fixed please? Thx. Hugo de Oude 06-21588438
Re: Tips for debugging XML beans - newbie
What does the schema look like? Are the elements and/or anyType? The majority of times I've hit a similar issue it has to do with an incorrect namespace or incorrect type. In the case of incorrect type, it was usually my error using XXDocument when I needed XXType. HTH, -jacobd On Thu, Feb 3, 2011 at 6:19 AM, Nicholas W 4...@log1.net wrote: Hi Cezar, Thanks for your reply. errorList is empty, so there are no error objects... Regards, Nicholas W. On Wed, Feb 2, 2011 at 7:19 PM, Cezar Andrei cezar.and...@oracle.com wrote: Nicholas, Did you try error.getObjectLocation()? Do you have any more details about the error? Cezar On Fri, 2011-01-28 at 15:48 +0100, Nicholas W wrote: Hi All, I am having some trouble unmarshalling data generated by a remote REST web service (for which I have the XSD. I have set log4j.logger.org.apache.xmlbeans = DEBUG in log4j.properties and I am using code like: XmlOptions xmloptions = new XmlOptions(); ArrayList errorList = new ArrayList(); xmloptions.setErrorListener(errorList); FindObjectsResponseDocument f = FindObjectsResponseDocument.Factory.parse(xmlresult,xmloptions); boolean valid = f.validate(); if (!valid) { for (int i = 0; i errorList.size(); i++) { XmlError error = (XmlError)errorList.get(i); System.out.println(\n); System.out.println(Message: + error.getMessage() + \n); System.out.println(Location of invalid XML: + error.getCursorLocation().xmlText() + \n); } } To find out whats going on. However. Elements are null when they should not be, nothing is reported in the logging and the errorList is empty. I would be greatful if you could point me to some resources to show how to debug XMLBeans unmarshalling. Thanks a lot Regards, Nicholas W. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Get Schema from Document
Have you tried the xsd2inst tool? Thats what I typically use for this sort of thing. -jacobd On Wed, Jan 12, 2011 at 3:06 PM, Curtis Jensen cur...@the-jensens.orgwrote: After compiling a schema, is it possible to generate a schema for a given XXXDocument class? ie. I don't want the whole original schema, just a schema that applies to the specific element. Thanks, Curtis - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Unable to retrieve value form Xmlbean document object
When I've seen something like this, its usually because my instance wasn't value. Try validating and verifying there are no errors. -jacobd On Thu, May 13, 2010 at 7:38 AM, GeniusS yogen...@gmail.com wrote: I'm not able to retrieve value from Xmlbean document object, however when I inspect the object the values is there. Following is the complete description of the problem Step 1 Following is the XSD used to generate XML Bean document objects xs:element name=getPremiumDetailResponse xs:complexType xs:complexContent mixed=false xs:extension base=response:messageResponse xs:sequence xs:element minOccurs=0 name=asOfDate type=xs:date / xs:element minOccurs=0 name=premiumQuoteIndividual xs:complexType xs:sequence xs:element minOccurs=0 name=individualFirstName type=pere:firstName / xs:element minOccurs=0 name=individualLastName type=pere:lastName / xs:element minOccurs=0 name=premiumQuotePlanGroup xs:complexType xs:sequence xs:element minOccurs=0 maxOccurs=unbounded name=premiumQuotePlan xs:complexType xs:sequence xs:element minOccurs=1 name=planDescription type=ppte:planDescription / xs:element minOccurs=1 name=amountDue type=ppte:amountDue / xs:element minOccurs=1 name=planSubTotal type=ppte:planSubTotal / /xs:sequence /xs:complexType /xs:element /xs:sequence /xs:complexType /xs:element Step 2 Code I'm using to get the document object values: GetPremiumDetailResponseDocument xbGetPremiumDetailResponseDocument = (GetPremiumDetailResponseDocument) gpsResponse; GetPremiumDetailResponse xbGetPremiumDetailResponse = xbGetPremiumDetailResponseDocument .getGetPremiumDetailResponse(); xbGetPremiumDetailResponse.getAsOfDate(); xbGetPremiumDetailResponse.getPremiumQuoteIndividual().getIndividualLastName(); Step 3 When I try to inspect xbGetPremiumDetailResponse.getPremiumQuoteIndividual(), I get to see following output: xml-fragment xmlns:gpd=http://gps.uhc.com/2008/08/01/getpremiumdetail; xmlns:mres=http://gps.uhc.com/2008/08/01/common/messageresponse; xmlns:pqp=http://gps.uhc.com/2008/08/01/common/premiumquoteplan; pqp:individualFirstNameTRVOF/pqp:individualFirstName pqp:individualLastNameFU/pqp:individualLastName pqp:premiumQuotePlanGroup pqp:premiumQuotePlan pqp:planDescriptionAARP MedicareComplete (HMO)/pqp:planDescription pqp:amountDue75.0/pqp:amountDue pqp:planSubTotal75.0/pqp:planSubTotal /pqp:premiumQuotePlan /pqp:premiumQuotePlanGroup pqp:premiumQuoteIndividualAdjustmentGroup/ pqp:premiumQuoteHouseholdAdjustmentGroup/ pqp:householdPremium75.0/pqp:householdPremium /xml-fragment Step 5: However When I try to inspect xbGetPremiumDetailResponse.getPremiumQuoteIndividual().getIndividualLastName(). it returns null. Although the value is there in the pqp:individualLastNameFU/pqp:individualLastName node. It would great if anyone can help me out to sort out this issue. We have pilot release tommorow. Thanks Yogen -- View this message in context: http://old.nabble.com/Unable-to-retrieve-value-form-Xmlbean-document-object-tp28548413p28548413.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Build fails
You aren't trying to repackage xmlbeans on your own are you? What happens when you try using something like Sun's Java lib vs. gcj. [java]at java.lang.StringBuffer.substring(*libgcj.so.81*) [java]at java.lang.StringBuffer.subSequence(*libgcj.so.81*) [java]at java.util.regex.Matcher.appendReplacement(*libgcj.so.81* ) [java]at repackage.Repackager.repackage(Repackager.java:128) Seems a little suspicious to me. I didn't have any problems when I just built locally. -jacobd On Sat, May 8, 2010 at 3:06 PM, Erwin Kalvelagen erwin.kalvela...@gmail.com wrote: Hi: I am trying to build xmlbeans but it bombs out with: piccolo.classes: [mkdir] Created dir: /home/erwin/workspace/gdxls2/xmlbeans-2.5.0/build/private/piccolo [unjar] Expanding: /home/erwin/workspace/gdxls2/xmlbeans-2.5.0/external/lib/piccolo_apache_dist_20040711_v2.jar into /home/erwin/workspace/gdxls2/xmlbeans-2.5.0/build/private/piccolo [echo] Re-packaging Piccolo [java] Repackaging 41 files ... [java] Exception in thread main java.lang.StringIndexOutOfBoundsException [java]at java.lang.StringBuffer.substring(libgcj.so.81) [java]at java.lang.StringBuffer.subSequence(libgcj.so.81) [java]at java.util.regex.Matcher.appendReplacement(libgcj.so.81) [java]at repackage.Repackager.repackage(Repackager.java:128) [java]at repackage.Repackage.repackageJavaFile(Repackage.java:318) [java]at repackage.Repackage.repackageFile(Repackage.java:117) [java]at repackage.Repackage.repackage(Repackage.java:97) [java]at repackage.Repackage.main(Repackage.java:26) BUILD FAILED /home/erwin/workspace/gdxls2/xmlbeans-2.5.0/build.xml:1156: Java returned: 1 Total time: 3 seconds er...@erwin-desktop:~/workspace/gdxls2/xmlbeans-2.5.0$ gcj -v Using built-in specs. Reading specs from /usr/lib/gcc/i486-linux-gnu/4.2.4/libgcj.spec rename spec startfile to startfileorig rename spec lib to liborig Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,java --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-java-awt=gtk --enable-gtk-cairo --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.2-1.5.0.0/jre --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libmudflap --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3) er...@erwin-desktop:~/workspace/gdxls2/xmlbeans-2.5.0$ Any ideas how to proceed? Thanks very much! Erwin Erwin Kalvelagen Amsterdam Optimization Modeling Group er...@amsterdamoptimization.com http://amsterdamoptimization.com
Re: problem running the scomp
Is javac really located at /home/alaa/xmlbeans-tutorial/javac in your environment? Otherwise this looks like it might be addressed on the FAQ page, (sorry I don't have the link or answer with me at the moment) -jacobd On Wed, Mar 24, 2010 at 12:58 AM, alaa nobani alaa_nob...@yahoo.com wrote: Hi I have installed the XMLbeans 2.5 version and am having java 1.6 installed , when ever i try to to run the scomp command to compile my schema i get the following error although the JAVA_HOME is defined and the JAVA_HOME/bin added to path, the error is: java.io.IOException: Cannot run program /home/alaa/xmlbeans-tutorial/javac: java.io.IOExcep java.io.IOException: java.io.IOException: error=2, No such file or directory java.io.IOException: Cannot run program /home/alaa/xmlbeans-tutorial/javac: java.io.IOExcep at java.lang.ProcessBuilder.start(ProcessBuilder.java:474) at java.lang.Runtime.exec(Runtime.java:610) at java.lang.Runtime.exec(Runtime.java:483) at org.apache.xmlbeans.impl.tool.CodeGenUtil.externalCompile(CodeGenUtil.java:231) at org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java:1154) at org.apache.xmlbeans.impl.tool.SchemaCompiler.main(SchemaCompiler.java:373) Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.init(UNIXProcess.java:164) at java.lang.ProcessImpl.start(ProcessImpl.java:81) at java.lang.ProcessBuilder.start(ProcessBuilder.java:467) ... 5 more BUILD FAILED Any Idea what is this error and how can I fix it? thanks. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Xmlbeans errors for empty int tag
have you tried adding nillable=true to the file_id element. I believe this makes the type the Java Wrapper type (Integer in this case). Otherwise to check the existence of the element you could try xpath, or using the xmlcursor apis and seeing if you can navigate to the element. HTH, -jacobd On Tue, Mar 23, 2010 at 10:32 AM, Soumya soumya_...@yahoo.co.in wrote: Hello all, I am using xmlbeans 1.0.4 and have a strange issue at hand. We have an old webservice which was documented in DTD and to use advanced xmlbeans features we decided to write an xsd for it and use it at another place to send/get WS calls. Kindly note the xsd is used only at client side..ie.e where it invokes the WS. The WS is still the old one. Here is a snippet of teh xsd that is causing the issue - xs:complexType name =itemT xs:sequence maxOccurs=1 xs:element name=item_id type=xs:int minOccurs=1 maxOccurs=1/ xs:element name=file_id type=xs:int minOccurs=0 maxOccurs=1/ ... /xs:sequence /xs:complexType Now the 'file_id' field above is not mandatory and may be blank. The way our old WS responds in case there is nor file_id associated with type itemT is as follows. item item_id1602/item_id file_id/ .. /item SO even if there is no value for file_id it still returns an empty tag. Now this is of type xs:int I cannot do a null check - Hence in my java code whenever I try to access it like item.getFileId() - It always throws an exception stacktrace as follows org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException at org.apache.xmlbeans.impl.values.JavaIntHolder.set_text(JavaIntHolder.java:42) at org.apache.xmlbeans.impl.values.XmlObjectBase.update_from_wscanon_text(XmlObjectBase.java:1085) at org.apache.xmlbeans.impl.values.XmlObjectBase.check_dated(XmlObjectBase.java:1224) at org.apache.xmlbeans.impl.values.JavaIntHolder.intValue(JavaIntHolder.java:52) at org.apache.xmlbeans.impl.values.XmlObjectBase.getIntValue(XmlObjectBase.java:1442) at com.company.webservices.live.impl.ItemTImpl.getFileId(Unknown Source) at com.company.live.ws.service.NewWebService.fetchItem(LiveWebService.java:150) Is there a way in xmlbeans by which I can check that whether a int value is present or not (like we do for String i.e. null check) and only then try to retrieve the fileId value? I tried using item.isSetFileId() but that returns as true. I also tried item.xgetFileId() - checked if that is null but again when we try to get intValue() it throws same exception. Can anyone kindly help? Thanks in advance, SSP Your Mail works best with the New Yahoo Optimized IE8. Get it NOW!. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: XMLBeans 2.0 - Problem with derived/extended schema elements
This sounds like a Java problem more than an XMLBeans problem. From the sounds of it you are trying to cast up. In other words you AddressType - Cannot be cast to - EmployeeAddress But you were expecting something like this. EmployeeAddress - Can be cast to - AddressType Rather than use constructors from EmployeeAddressImpl, why not use the EmployeeAddress.Factory.parse(...)/newInstance(...) based on how you are writing/starting your instance. -jacobd On Fri, Mar 12, 2010 at 12:18 PM, Sri Harsha Yenuganti shyenuga...@gmail.com wrote: Hi , Here is the problem. I have the following interfaces ( These interfaces are generated by XMLBeans ) : Interface AddressType { ... } Interface EmployeeAddress extends AddressType { .. } I have the following implementation classes ( These classes are generated by XMLBeans ): Class AddressTypeImpl implements AddressType { } Class EmployeeAddressImpl extends AddressTypeImpl implements EmployeeAddress{ .. } Here is some class that uses these( This class is generated by XMLBeans ) : class MyClass { public AddressType someFunc(){ . return employeeAddress; } } In some other class i have this code ( This is written by me ) : EmployeeAddress ea; EmployeeAddress ea = (EmployeeAddress) myClass.someFunc(); someFunc() returns an object of type AddressType. I am trying to cast it to EmployeeAddress. This is throwing me a class cast exception. Cannot convert from AddressTypeImpl to EmployeeAddress type As AddressType is an interface, we are getting an object of AddressTypeImpl, not AddressType. These interfaces and classes are generated by XMLBeans. So I cant instantiate EmployeeAddressImpl which takes several XMLBeans custom parameters in its constructor. -- Sri Harsha Yenuganti shyenuga...@gmail.com IF YOU ARE NOT BRAVE ENOUGH TO FACE A FAILURE YOU ARE UNFIT TO SUCCEED.AIM HIGH BUT BE PREPARED FOR THE WORST. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: XmlBeans and Spring RestTemplate
Have you looked into using an xsdconfig file? I know you can do class mappings from that if its needed. I'm not familiar with Spring's RestTemplate. Did you use XmlBeans' inst2xsd tool to generate a schema for you? Usually the best way to find the class to marshal to when starting from an instance is to look for a class named ???Document where ??? == the name of the instance's root element. HTH, -jacobd On Fri, Feb 12, 2010 at 12:34 PM, Steven Haines lyg...@yahoo.com wrote: Hi, I'm trying to use XmlBeans as a marshaller/unmarshaller for Spring's RestTemplate for an XML document that does not specify an XSD in its header. I constructed the XSD and used the XmlBeans Maven task the generate code from it, but I'm not sure how to tell XmlBeans what classes to unmarshall the document to. I found an example using JAXB2 to accomplish the same objective (reading twitter web services from a manually created XSD): http://aruld.info/resttemplate-the-spring-way-of-accessing-restful-services/ The Jaxb2Marshaller has a classesToBeBound property: bean id=jaxbMarshaller class=org.springframework.oxm.jaxb.Jaxb2Marshaller property name=classesToBeBound list valuetwitter.model.Statuses/value /list /property /bean I did not see anything similar in the XmlBeansMarshaller (unless there is a way to specify class mappings in an XmlOptions object.) Does anyone have experience with Spring's XmlBeansMarshaller (http://static.springsource.org/spring/docs/3.0.0.RELEASE/javadoc-api/org/springframework/oxm/xmlbeans/XmlBeansMarshaller.html) that might be able to point me in the right direction? Thanks Steve - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: question on code generation with regard to non-alphabetic character in xml element name
So you would use reflection or something like it to infer the name? Seems like you could get this 'actual element name' information from the schematypesystem apis without too much hassle. -jacobd On Wed, Jan 20, 2010 at 10:29 AM, Jerry Wang skidooj...@gmail.com wrote: just want to get original element names from generated classes, so those names can be passed onto other components. On Wed, Jan 20, 2010 at 12:50 PM, Gillen, Paul paul.gil...@nscorp.com wrote: Pardon the impertinence, but why? Paul From: Jerry Wang [mailto:skidooj...@gmail.com] Sent: Wednesday, January 20, 2010 10:26 AM To: user@xmlbeans.apache.org Subject: question on code generation with regard to non-alphabetic character in xml element name I am using xmlbean to generate code from wsdl, the issue I am facing is that names of some xml elements have special character like _(for example first_name). and the getter generated is getFirstName(). can I somehow force the method generated to have exact xml tag name like getFirst_Name()? I really do not want to do mapping,just too much over head. Thanks Jerry - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: [VOTE] XMLBeans v2.5.0-RC1 to become official release
[X] +1 - I am in favor of this release, and can help Jacobd On Wed, Dec 9, 2009 at 9:23 AM, Cezar Andrei cezar.and...@oracle.com wrote: Please cast your vote for the XMLBeans v2.5.0-RC1, as published at http://xmlbeans.apache.org/dist/, to become XMLBeans v2.5.0 official release. The vote will be open until end of day Saturday, 12th of December. Anyone is allowed to show support or lack of it, but only XMLBeans committer votes are binding. [ ] +1 - I am in favor of this release, and can help [ ] +0 - I am in favor of this release, but cannot help [ ] -0 - I am not in favor of this release [ ] -1 - I am against this proposal (must include a reason) My vote is: [X] +1 - I am in favor of this release, and can help Cezar - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: SchemaTypeLoader problems in Equinox (OSGi): A solution
Thanks Mike! I'll add this to the FAQs when I get a chance. -jacobd On Tue, Oct 6, 2009 at 12:33 PM, Michael Furtak mfur...@cra.com wrote: Hi, all. This is my first message to the mailing list, so I apologize if I am stating some very old news. Recently I have been encountering some classloading problems when using XMLBeans in an OSGi environment (Equinox), and I have seen some other users with similar issues [1, 2]. The common symptom was that xsi:type information could neither be generated, nor interpreted while running in an OSGi environment. To my understanding, the use of the Thread Context ClassLoader, within the SchemaTypeLoader [3] needs some extra help to work properly within an OSGi environment. Equinox provides this help in the form of Buddy Class Loading (unfortunately, this is *not* part of the OSGi spec, making it an Equinox specific fix) [4]. By marking the XMLBeans bundle with an Eclipse-BuddyPolicy header in its manifest, and the compiled schema bundle with an Eclipse-RegisterBuddy header in its manifest, Equinox is able to bridge the classloading gap between the core XMLBeans jar and your compiled schema classes. Assuming that my XMLBeans bundle has: Bundle-SymbolicName: org.apache.xmlbeans I would include in that XMLBeans bundle manifest the line: Eclipse-BuddyPolicy: registered I would then alter my scomp'd schema classes bundle manifest to include: Eclipse-RegisterBuddy: org.apache.xmlbeans After doing this, my problems are resolved. I hope this can help someone else, and was not incredibly old news. Regards, -Mike Furtak 1) http://markmail.org/message/vx2vdg7yhb4l3ej6#query:+page:1+mid:vx2vdg7yh b4l3ej6+state:resultshttp://markmail.org/message/vx2vdg7yhb4l3ej6#query:+page:1+mid:vx2vdg7yh%0Ab4l3ej6+state:results 2) http://mail-archives.apache.org/mod_mbox/ws-axis-user/200701.mbox/%3C8d2 a81130701171341p55f95b70o7f144ea7d9416...@mail.gmail.com%3e 3) http://grepcode.com/file/repo1.maven.org$mav...@org.apache.xmlbeans$xmlb e...@2.4.0@org$apache$xmlbeans$impl$schema$SchemaTypeLoaderImpl.java#Sch emaTypeLoaderImpl.getContextTypeLoader%28%29 4) http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhancements#Ecli pse-BuddyPolicy_Headerhttp://wiki.eclipse.org/index.php/Context_Class_Loader_Enhancements#Ecli%0Apse-BuddyPolicy_Header THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS ADDRESSED. IT MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If you are not the intended recipient, your use of this message for any purpose is strictly prohibited. If you have received this communication in error, please delete the message and notify the sender so that we may correct our records. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Invalid escaping of XML
Hi Artem, Are these files supposed to be the same? This does seem quite odd as result2.xml isn't even valid xml. Will you file an issue in Jira and attach any test sources, etc to help with repro, it doesn't need to be exact and we will certainly try to do our best to repro with more information. Also, please include some info about the kind of environment this code was running in. Thanks, -jacobd On Fri, Oct 2, 2009 at 8:09 PM, Artem Portnoy artem.portnoy@gmail.comwrote: There appears to be some kind of problem with passing the XmlOptions().setSavePrettyPrint().setSavePrettyPrintIndent(4) option to the Document’s save function. It produces a corrupt output with certain data. See attached documents result1.xml and result2.xml. result1.xml was produced by code like this FileOutputStream result1 = *new* FileOutputStream( c:\\temp\\result1.xml); resDoc.save(result1); result2.xml was produced by FileOutputStream result2 = *new* FileOutputStream( c:\\temp\\result2.xml); resDoc.save(result2, *new*XmlOptions().setSavePrettyPrint().setSavePrettyPrintIndent(4)); Problem is the behavior seems to be highly dependent on data and is kind of hard to reproduce, so I’m not sure how to create a bug report for it. Artem On Fri, Oct 2, 2009 at 5:21 PM, Wing Yew Poon wing.yew.p...@oracle.comwrote: Jacob is correct. Only the '' needs to be escaped, not the ''. XML predefines exactly 5 entity references: lt; amp; gt; quot; apos; but only lt; and amp; must be used instead of the literal characters in element content; the others are optional, with the exception that the 3-character sequence ]] cannot appear in character data and must be written as ]]gt;. - Wing Yew -- *From:* Jacob Danner [mailto:jacob.dan...@gmail.com] *Sent:* Friday, October 02, 2009 1:55 PM *To:* user@xmlbeans.apache.org *Subject:* Re: Invalid escaping of XML Off the top of my head I think this is as expected. The does not need to be escaped only . -jacobd On Fri, Oct 2, 2009 at 1:17 PM, Artem Portnoy artem.portnoy@gmail.com wrote: Hello, We have an XmlBean that takes in a String. The problem is that if we pass in an XML String, the XML characters are not properly escaped. Here’s a simple program I use to test… *public* *static* *void* main(String[] args) { Trace trace = TestProcessFlowV2Res.Traces.Trace.Factory.*newInstance *(); trace.setStringValue(test); System.*out*.println(trace); } The output produced looks as follows… xml-fragmentlt;test/xml-fragment For some reason the ‘’ character is not getting escaped. We are currently using XmlBeans 2.1.0. I’ve tried searching for similar bug reports on the mailing list archive and couldn’t find anything. If anybody could shed some light on this issue it would be greatly appreciated. Thanks, Artem Portnoy Information Builders, Inc - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Invalid escaping of XML
Off the top of my head I think this is as expected. The does not need to be escaped only . -jacobd On Fri, Oct 2, 2009 at 1:17 PM, Artem Portnoy artem.portnoy@gmail.comwrote: Hello, We have an XmlBean that takes in a String. The problem is that if we pass in an XML String, the XML characters are not properly escaped. Here’s a simple program I use to test… *public* *static* *void* main(String[] args) { Trace trace = TestProcessFlowV2Res.Traces.Trace.Factory.*newInstance* (); trace.setStringValue(test); System.*out*.println(trace); } The output produced looks as follows… xml-fragmentlt;test/xml-fragment For some reason the ‘’ character is not getting escaped. We are currently using XmlBeans 2.1.0. I’ve tried searching for similar bug reports on the mailing list archive and couldn’t find anything. If anybody could shed some light on this issue it would be greatly appreciated. Thanks, Artem Portnoy Information Builders, Inc
Re: a stange problem: can not judge the type of a xmlObject
The fact that validation is not returrning true should be the first indication as to why you are not getting the value expected back. ObservationCollectionDocument ocd=ObservationCollectionDocument.Factory.parse(new File(DataArray.xml)); List errors = new LinkedList(); System.out.println(ocd.validate(error)); //iterate list and find out what the validation problems are with the instance. HTH -jacobd On Mon, Sep 28, 2009 at 5:33 AM, maven apache apachemav...@gmail.comwrote: 2009/9/28 heikki tropic...@gmail.com Why don't you try to see what the runtime type of your results actually *is* ? I try it ,but I am not exactly sure how to do it, and I think it may be caused by the different version, so I tried to get the real type by the codes: ObservationCollectionDocument ocd=ObservationCollectionDocument.Factory.parse(new File(DataArray.xml)); ObservationPropertyType xb_memeber=ocd.getObservationCollection().getMemberArray(0); XmlObject xb_result=xb_memeber.getObservation().getResult(); if(xb_result instanceof net.opengis.swe.x00.DataArrayType) { System.out.println(00); ..//for other version 00 10 101 However, it is none of the three typs. On Mon, Sep 28, 2009 at 3:53 AM, maven apache apachemav...@gmail.comwrote: Sorry this is the schema, I forget in the last post. 2009/9/28 maven apache apachemav...@gmail.com 2009/9/28 Jacob Danner jacob.dan...@gmail.com How is DataArray defined in your schema? I upload the DataArray schema. If possible, I would like some one can check it. Also, does this instance validate without errors? I get no error but only false when I use the following codes to validate: ObservationCollectionDocument ocd=ObservationCollectionDocument.Factory.parse(new File(DataArray.xml)); System.out.println(ocd.validate()); -jacobd On 9/27/09, maven apache apachemav...@gmail.com wrote: Hi : In the xml I uploaded, I want to get the valuse under the element DataArray, but I am not sure the type , so I use the following codes to judge: -- ObservationCollectionDocument ocd=ObservationCollectionDocument.Factory.parse(new File(DataArray.xml)); ObservationPropertyType xb_memeber=ocd.getObservationCollection().getMemberArray(0); XmlObject xb_result=xb_memeber.getObservation().getResult(); if(xb_result instanceof net.opengis.swe.x00.DataArrayType) { System.out.println(00); } else if(xb_result instanceof net.opengis.swe.x10.DataArrayType) { System.out.println(100); } else if(xb_result instanceof net.opengis.swe.x101.DataArrayType) { System.out.println(101); } else { System.out.println(null); }- -- However the output is null, it seems that it belongs to none of the three types. In face, from the file(in the attach) we can easily get the version of the DataArrayType is 1.0.1, but why the output is so strange? - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: toString() differs from save()
This is by design, take a peek at the javadoc. http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlTokenSource.html#xmlText(org.apache.xmlbeans.XmlOptions) xmlText String http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html *xmlText*(XmlOptions http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlOptions.html options) Just like xmlText() but with options. Options map may be null. Note that this method does not produce XML with the XML declaration, including the encoding information. To save the XML declaration with the XML, see save(OutputStream)http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlTokenSource.html#save%28java.io.OutputStream%29or save(OutputStream, XmlOptions)http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlTokenSource.html#save%28java.io.OutputStream,%20org.apache.xmlbeans.XmlOptions%29. HTH, -jacobd On Fri, Sep 25, 2009 at 1:13 AM, Nick de Graeve nick.degra...@telenet.bewrote: When I save my XMLBean to disk I get a slightly different result from when I do a toString() or xmlText(). The formatting and contents are the same but the file on disk starts with ?xml version=1.0 encoding=UTF-8? while the string does not. How can I make sure both are exactly the same? - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: a stange problem: can not judge the type of a xmlObject
How is DataArray defined in your schema? Also, does this instance validate without errors? -jacobd On 9/27/09, maven apache apachemav...@gmail.com wrote: Hi : In the xml I uploaded, I want to get the valuse under the element DataArray, but I am not sure the type , so I use the following codes to judge: -- ObservationCollectionDocument ocd=ObservationCollectionDocument.Factory.parse(new File(DataArray.xml)); ObservationPropertyType xb_memeber=ocd.getObservationCollection().getMemberArray(0); XmlObject xb_result=xb_memeber.getObservation().getResult(); if(xb_result instanceof net.opengis.swe.x00.DataArrayType) { System.out.println(00); } else if(xb_result instanceof net.opengis.swe.x10.DataArrayType) { System.out.println(100); } else if(xb_result instanceof net.opengis.swe.x101.DataArrayType) { System.out.println(101); } else { System.out.println(null); }- -- However the output is null, it seems that it belongs to none of the three types. In face, from the file(in the attach) we can easily get the version of the DataArrayType is 1.0.1, but why the output is so strange? - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Namespace problem reading xml
Have you looked into using an xmlconfig file to generate the classes into the packages you want. Take a peek on the xmlbeans wiki for more information on what to do. HTH, -jacobd On Fri, Sep 18, 2009 at 5:07 AM, JavierL xle...@gmail.com wrote: Hi I need to read an xml file. The namespace on the schema is noNamespace, and generated classes are on package noNamespace. But my project environment is a little bit special because I could not use my generated jar and I need to upload generated source code to a package name that will be something like xxx..noNamespace. I can refactor generated code, but I got errors when tried to read the xml because its namespace is still noNamespace. How could I allow my program to read the xml file succesfully on this environment ? Thanks in advance J -- View this message in context: http://www.nabble.com/Namespace-problem-reading-xml-tp25507615p25507615.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: java.lang.OutOfMemoryError: Java heap space
Hmm, are you putting 30K of xml into memory? or only parsing the results as they are needed? In other words, are there references left around that is causing the heap to grow? -jacobd On Mon, Sep 14, 2009 at 1:16 PM, Jason Berk jb...@purdueefcu.com wrote: I have an xml clob and account in a DB. I need to select the xml and bind it with XML Beans. This works fine for the first 30,000 or so accounts, but eventually I get ava.lang.OutOfMemoryError: Java heap space This is the line that is blowing up: MemberStatementDocument doc = MemberStatementDocument.Factory.parse(xml, validationOptions); In this method to do the bind: private MemberStatement bind(String xml) throws Exception { ArrayListXmlValidationError validationErrors = new ArrayListXmlValidationError(); XmlOptions validationOptions = new XmlOptions(); validationOptions.setErrorListener(validationErrors); //validationOptions.setLoadLineNumbers(); //validationOptions.setLoadTrimTextBuffer(); //validationOptions.setUnsynchronized(); //validationOptions.setLoadUseXMLReader( SAXParserFactory.newInstance().newSAXParser().getXMLReader() ); MemberStatementDocument doc = MemberStatementDocument.Factory.parse(xml, validationOptions); if (!doc.validate(validationOptions)) { logger.error(Validation errors discovered during binding:); IteratorXmlValidationError iter = validationErrors.iterator(); while (iter.hasNext()) { logger.error( + iter.next()); } throw new XmlException(Validation errors discovered during binding:); } MemberStatement memberStatement = doc.getMemberStatement(); if (memberStatement.getUnknownShareList().size() 0 || memberStatement.getUnknownLoanList().size() 0) { throw new XmlException(account contains unknown shares or loans); } return memberStatement; } Is there a better way to be doing the binding? What about the parse method is not playing well with the GC? Jason Now serving Boiler Spirit with every purchase. Switch to the new Purdue debit card today. Show your pride and earn Scorecard Rewards on the side. Just sign for your purchases and score valuable rewards points you can use for travel, electronics or even cash. ***This is a transmission from Purdue Employees Federal Credit Union (PEFCU) and is intended solely for its authorized recipient(s), and may contain information that is confidential and or legally privileged. If you are not an addressee, or the employee or agent responsible for delivering it to an addressee, you are hereby notified that any use, dissemination, distribution, publication or copying of the information contained in this email is strictly prohibited. If you have received this transmission in error, please notify us by telephoning (765) 497-3328 or returning the email. You are then instructed to delete the information from your computer. Thank you for your cooperation.*** - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Cannot load SchemaTypeSystem
If the file is present as a result of the ant build, I'd say the issue lay somewhere in your netbeans configuration. Is there a reason you need the xmlbeans sources? From your ant task it looks like you want the task to generate source (srcOnly) and a jar (destFile). I've only used the task with one or the other options specified. There are several options for scomp output, but I think srconly overrides destfile. -jacobd On Sun, Sep 13, 2009 at 6:58 AM, Wynand Vermeulen groendra...@gmail.comwrote: Hello, I'm trying to get XMLBeans 2.4.0 to work in a standard Netbeans project. I have a built.xml file in my project directory, which contains ANT script to build the XMLBeans source. I get no errors while performing the build, but do get a runtime exeception java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.sBA558E54E426CCFF39A8E684578DC966.TypeSystemHolder. Make sure the generated binary files are on the classpath.. I have been finecombing the documentation, and searching the web (and this list's archives) for days now and have found several of these types of messages reported, and usually the advice is to make sure the TypeSystemHolder.class is on the classpath. My ANT script stores the generated files in the project's build\classes folder, and directly after the build I can see that the class file and xsd files have been generated in the proper location, however for some strange reason once I run the application the TypeSystemHolder.class file disappears and the exception occurs! I assume that everything in the build\classes folder is part of the classpath. If not, how do I add the schemaorg_apache_xmlbeans.system.sBA558E54E426CCFF39A8E684578DC966.TypeSystemHolder to the classpath in Netbeans? I've tried right clicking on the project, and adding the folder to the compile and runtime classpaths, and I've tried adding it to the classpath in the ANT script together with xbean.jar, but as then the compiler complains that the directory does not exist (since it has not yet been built). The ANT Script I use (based on tutorial at http://lajavaloca.wordpress.com/2008/05/26/xmlbeans-with-netbeans-thats-a-lot-of-beans/ ): taskdef name=xmlbean classname=org.apache.xmlbeans.impl.tool.XMLBean classpath=../3rd Party/xmlbeans-2.4.0/lib/jsr173.jar: ../3rd Party/xmlbeans-2.4.0/lib/xbean.jar / target name=-pre-compile antcall target=gen-schema2/ /target target name=gen-schema xmlbean srconly=true verbose=true srcgendir=src classgendir=build/classes download=true destfile=DeviceListXmlTypes.jar schema=./src/CardWizard/resources/config/DeviceList.xsd/ /target Please help, I really need to get XMLBeans working asap. Kind Regards Wynand
Re: scomp fails trying javac
I'm not sure of the question, but I've been using scomp with JDK 1.6 version 04, 10 and now 14 without problems for many months. HTH, -jacobd On 9/12/09, Jerry Brown jbr...@dvierow.com wrote: I am a newbie and this is an 'old' error. But I have the JDK ahead of the JRE on my PATH. It is Java 1.6. Do you really mean xmbeans 2.4.0 goes with Java 1.5, or does this mean Java 1.5+? I have not yet tried %JAVA_HOME%\bin\java (or javac?) in the scomp.cmd file. Please give me your thoughts -- what would the revised script look like? Do I really need to convert from Java 1.6 back to Java 1.5? Jerry Brown - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: locale issue: translating xmlbean error texts
The properties file is just a resource bundle so I think adding your own properties file for your locale should work. Here is a link that may help http://java.sun.com/docs/books/tutorial/i18n/resbundle/index.html -jacobd On Wed, Sep 2, 2009 at 1:53 AM, vinc.turco vinc.tu...@gmail.com wrote: Hi Jacob, thanks for replying I would like to change the error messages directly in the jar, without recompiling everything from source. Which one is that? Thanks, regards Vincenzo Jacob Danner-2 wrote: The properties file containing the resource strings is located at src\xmlpublic\org\apache\xmlbeans\message.properties (for EN) -jacobd On Tue, Sep 1, 2009 at 8:42 AM, vinc.turco vinc.tu...@gmail.com wrote: Hi developers, I need to translate xmlbeans error messages from english, how can I do that? Is there something like a map error_code, error_message which can be arbitrarily replaced? Thanks, regards Vincenzo -- View this message in context: http://www.nabble.com/locale-issue%3A-translating-xmlbean-error-texts-tp25242711p25242711.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org -- View this message in context: http://www.nabble.com/locale-issue%3A-translating-xmlbean-error-texts-tp25242711p25253920.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: locale issue: translating xmlbean error texts
The properties file containing the resource strings is located at src\xmlpublic\org\apache\xmlbeans\message.properties (for EN) -jacobd On Tue, Sep 1, 2009 at 8:42 AM, vinc.turco vinc.tu...@gmail.com wrote: Hi developers, I need to translate xmlbeans error messages from english, how can I do that? Is there something like a map error_code, error_message which can be arbitrarily replaced? Thanks, regards Vincenzo -- View this message in context: http://www.nabble.com/locale-issue%3A-translating-xmlbean-error-texts-tp25242711p25242711.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Illegal XML character: 0x1c inside CDATA
I've seen similar when working with content retrieved from URLs. What I found was the problem wasn't in the content of the xml, but in some additional data that was passed along prior to the xml payload I wanted. My workaround to this was to use some IO Stream APIs to read the content into a string and then parse the data. Out of curiousity, if you save the payload to a file, can you read it with XMLBeans (ie, XMLObject.parse(...))? HTH, -jacobd On Fri, Aug 21, 2009 at 10:03 AM, Bartolomeo Nicolotti bnicolo...@siapcn.it wrote: Hi, we're receiving xml from a supplier encoded in ISO-8859-1, but some tags body are encoded with UTF-8, but they are surrounded with CDATA, so that strange encodings, like 0x1c character shouldn't be a problem to the parser, as said here: http://www.w3schools.com/xmL/xml_cdata.asp We've built a parser with xmlbean last stable version, but the parser complain about this 0x1c character, see attachment near: ... denominaciones de origen espa ... Fri Aug 21 16:14:39 CEST 2009:class com.siap.DPKWebServices.Util.OTA_literal_HttpPost.queryHttp caught an exception: 29047814 org.apache.xmlbeans.XmlException e.toString():org.apache.xmlbeans.XmlException: error: Illegal XML character: 0x1c org.apache.xmlbeans.impl.piccolo.io.IllegalCharException: Illegal XML character: 0x1c at org.apache.xmlbeans.impl.piccolo.xml.XMLReaderReader.read(XMLReaderReader.java:169) at org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.yy_refill(PiccoloLexer.java:3474) at org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.yynextChar(PiccoloLexer.java:3721) at org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.parseCdataSection(PiccoloLexer.java:2671) at org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.yylex(PiccoloLexer.java:4850) at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.yylex(Piccolo.java:1290) at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.yyparse(Piccolo.java:1400) at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:714) at org.apache.xmlbeans.impl.store.Locale $SaxLoader.load(Locale.java:3439) at org.apache.xmlbeans.impl.store.Locale.parse(Locale.java:706) at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:690) at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:677) at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:208) at com.siap.TransHotel.GetAvailAccomDocument $Factory.parse(Unknown Source) at com.siap.DPKWebServices.Util.TransHotelUtil.validateRS(TransHotelUti Is there a way to work-around this prolem? Many thanks Best regards Bartolomeo -- Bartolomeo Nicolotti SIAP s.r.l. www.siapcn.it v.S.Albano 13 12049 Trinità(CN) Italy ph:+39 0172 652553 centralino: +39 0172 652511 fax: +39 0172 652519 - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Suppress prefix validation in the XML -Message
from what you describe it sounds like you might have a validation issue with the instance. Have you tried validating and seen if there are errors? This: responsexmlns=http://kkk/schema/xsxs; xmlns:ns1=http://kkk/xsx.org/; ns1:something ns1:mn and so on/ns1:mn /ns1:something /response compared to this: responsexmlns=http://kkk/schema/xsxs; xmlns:ns1=http://kkk/xsx.org/; something mn and so on/mn /something /response are actually quite different. If you still need help, please let us know what the validation errors are. -jacobd On Sat, Jul 25, 2009 at 6:41 AM, Henry Ahenry_hu...@yahoo.de wrote: The message that my client gets from service looks lik this: response xmlns=http://kkk/schema/xsxs; xmlns:ns1=http://kkk/xsx.org/; ns1:something ns1:mn and so on/ns1:mn /ns1:something /response Because the prefix ns1 is used in the message, the xmlbenas in client fails with an error! But when I remove the prefix from xml response and then handover to the xmlbean works fine. How can I say xmlbeans to understand the prefix in the message? Thanks for your hint in advance. -- View this message in context: http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message-tp24658040p24658040.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Suppress prefix validation in the XML -Message
A) Take a peek at http://xmlbeans.apache.org/docs/2.0.0/guide/conValidationWithXmlBeans.html#validation_apis you can set an error listener on the XMLOptions you pass into the validate method and get much more useful information. The value of false means the instance is not valid according to the schema. B) In your example payload, you have responsexmlns=http://kkk/schema/xsxs; xmlns:ns1=http://kkk/xsx.org/; ns1:something ... and you are saying that when you remove the namespace prefix everything works fine. I'm saying that instance is NOT the same as the one you posted. For example, if you remove the prefix on the something / element, what is the new QName on it? It inherits the namespace from the xmlns value. In the example you posted the xmlns value and the value assigned to ns1 are not the same. In long form: (before) responsexmlns=http://kkk/schema/xsxs; something *xmlns=http://kkk/xsx.org/* ... (after removing the prefix) responsexmlns=http://kkk/schema/xsxs; something *xmlns=http://kkk/schema/xsxs* Does that help you see the difference? I also imagine the additional error messages will state something about 'found element someth...@xsx.org, but expected someth...@xsxs HTH, -jacobd On Sat, Jul 25, 2009 at 11:16 AM, Henry Ahenry_hu...@yahoo.de wrote: from what you describe it sounds like you might have a validation a) The only message after validating of response i get is a boolean value:false //hier is the validation responseDoc.Factory.parse(respons_decoded).validate(); Are there other options to get more validation data from the xmlbean!? b) I do not understand what you mean, they are total different messages?? The message 1 you see below is the original response The message 2 is the original response after i removed the prefixes ?? strange enough, after removing the ns1: from tags, xmlbeans does process the response fine but still the validation value of document is false! ?? - Jacob Danner-2 wrote: from what you describe it sounds like you might have a validation issue with the instance. Have you tried validating and seen if there are errors? This: responsexmlns=http://kkk/schema/xsxs; xmlns:ns1=http://kkk/xsx.org/; ns1:something ns1:mn and so on/ns1:mn /ns1:something /response compared to this: responsexmlns=http://kkk/schema/xsxs; xmlns:ns1=http://kkk/xsx.org/; something mn and so on/mn /something /response are actually quite different. If you still need help, please let us know what the validation errors are. -jacobd On Sat, Jul 25, 2009 at 6:41 AM, Henry Ahenry_hu...@yahoo.de wrote: The message that my client gets from service looks lik this: responsexmlns=http://kkk/schema/xsxs; xmlns:ns1=http://kkk/xsx.org/; ns1:something ns1:mn and so on/ns1:mn /ns1:something /response Because the prefix ns1 is used in the message, the xmlbenas in client fails with an error! But when I remove the prefix from xml response and then handover to the xmlbean works fine. How can I say xmlbeans to understand the prefix in the message? Thanks for your hint in advance. -- View this message in context: http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message-tp24658040p24658040.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org -- View this message in context: http://www.nabble.com/Suppress-prefix-validation-in-the-XML--Message-tp24658040p24660279.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: How creating an XmlObject only knowing the name of the generated document class?
Have you tried XmlObject xmlobject = XmlObject.Factory.newInstance()? -jacobd On Tue, Jun 16, 2009 at 12:01 AM, Hildegunde Weinzierlhildegunde.weinzi...@esg.de wrote: Hi, how can I get the XmlObject like I would get with the following call XmlObject xmlobject = OwnReportDocument.Factory.newInstance(); but without using the generated Document-Class 'OwnReportDocument'. I tried using the following code and got a NoSuchMethodException (no init-function!): String messagetype = mynamespace.OwnReportDocument; // also tested ...$Factory Class? clas = Class.forName(messagetype); Constructor ctor = clas.getConstructor(); ctor.setAccessible(true); XmlObject xmlobject = (XmlObject)ctor.newInstance(); // also tested clas.newInstance()! Is there another way to create a new XmlObject only knowing the name of the generated Document class? Best regards Hildegunde Weinzierl - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: the default namespace when write a xml
Wasn't this message already posted and answered on the 25th? The link works for me. Here are the contents of the relevant FAQ How can I influence the namespace prefix used when saving/printing out my XML? XMLBeans does not keep the prefixes when the original XML is loaded into the underlying XML store. If you need/want a specific prefix to be associated with a namespace you can use the setSaveSuggestedPrefixes(...) XmlOption. Here is a code example from this helpful post, [WWW] http://nagoya.apache.org/eyebrowse/readmsg?listname=xmlbeans-u...@xml.apache.orgmsgNo=33 : HashMap suggestedPrefixes = new HashMap(); suggestedPrefixes.put(http://foo.com/;, foo); XmlOptions opts = new XmlOptions(); opts.setSaveSuggestedPrefixes(suggestedPrefixes); String output = document.xmlText(opts); -jacobd On Wed, May 27, 2009 at 11:44 PM, apachemaven apachemav...@gmail.com wrote: With the xmlbeans I made a xml file,however the namespace is n1 n2 and so on, ns:Execute language=en_US version=1.0.0 xmlns:ns=http://www.swe.com/ow ns1:Identifier xmlns:ns1=http://www.swe.net;org/ns1:Identifier ns:DataInputs ns:Input ns1:Identifier xmlns:ns1=http://www.swe.net;inder inner/ns1:Identifier ns1:Title xmlns:ns1=http://www.swe.net;title/ns1:Title /ns:Input /ns:DataInputs /ns:Execute how to specify them? they should look like this: com:Executelanguage=en_US version=1.0.0 xmlns:com=http://www.swe.com/ow net:Identifier xmlns:net=http://www.swe.net;org/net:Identifier com:DataInputs com:Input net:Identifier xmlns:net=http://www.swe.net;inder inner/net:Identifier net:Title xmlns:net=http://www.swe.net;title/net:Title /com:Input /com:DataInputs /com:Execute PS: what is the difference between the add and set method? take the above for example: Execute.addNewInstance(IdentifierType id) Execute.setIdentifier(CodeType id) Some one have given a reply: http://wiki.apache.org/xmlbeans/XmlBeansFaq#suggestedPrefixes but I found the link is no longer available == apachemaven 2009-05-28 - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: error: URL ../X/Y/SchemaExample.xsd is not well-formed
This new error means something the references are now being resolved properly. You'll have to find out why you are getting this new error, but it looks like 2 of your artifacts are compiling/referencing WS-ResourceProperties.wsdl Best of luck, -jacobd On Wed, May 13, 2009 at 12:31 AM, Michael Xenakis michael@gmail.com wrote: Jacob Danner wrote: What do you mean by to change sth on the namespaces ? When i parse ( with WSDL4J ) a WSDL document from a specified URL i copy the namespaces from WSDL definitions because some of the prefixes that are used in the xsds encapsulated in types are not resolved...So, i get the definitions namespaces that are absent from schema contained in types and put them to the schemas. (i hope you understand) Okay so a couple of things... -You are parsing String representations of schemas which is why you are having trouble resolving references. If you parsed the files, this probably wouldn't be an issue. I can't parse a file.Everything is parsing runtime and online from a specified URL. -You are having these troubles because there is no way for your initial wsdl/xsd compile to resolve the schemaLocation field since there is no path or source information associated your initial xsd. -Why are you specifying: opts = opts.setCompileDownloadUrls(); ? None of the schemaLocations have a point of reference in your wsdl/xsd? Since you aren't compiling from the filesystem or URL I have this xmloption because there are xsds that have imports and on my tests without this option it couldn't compile the schemas. So, when there is an import it downloads and put it's components on my schema. Additionally, you mention... The problem is that inside the xsd, the imports have not well formed url as import namespace=x SchemaLocation=./../blah/blah.xsd These are valid imports with valid URLs in the schemaLocation field. The schemaLocation values appear to resolve properly on the file system and the URL. XMLBeans isn't doing anything wrong here and is actually processing the schema correctly So, in other words take the following example (excuse the poor incorrect xml grammar, this is for example only): String a_xsd = schema targetNamespace=DnaCopy elementFormDefault=qualified attributeFormDefault=unqualified import namespace=b schemaLocation=../a/b/c.xsd/ complexType name=baz // model group, etc... element type=b:foo / /schema; String c_xsd =schema targetNamespace=DnaCopy elementFormDefault=qualified attributeFormDefault=unqualified element name=foo type=xs:string / /schema; // PLEASE ANSWER // a) looking at a_xsd, how/where does ../a/b/c.xsd resolve to? // b) what is the absolute path of the schemaLocation in a_xsd // so you are trying ArrayListXMLObject al; al.add(XMLObject.Factory.parse(a_xsd)); al.add(XMLObject.Factory.parse(c_xsd)); // correct? // do you understand why these schemaLocations aren't resolving? This part of code is correct. Why? Because every schema doesn't have a specified source name (a base URI or something )? Have you tried setting the source names? Did that solve your problem? I tried to setSourceName on every Schema with the documentBaseURI and there was a change on the output error: org.apache.xmlbeans.XmlException: http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/wsrf/properties/WS-ResourceProperties.wsdl:0: error: sch-props-correct.2: Duplicate global type: resourceunknownfaultt...@http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd (Original global type found in file: URI_SHA_1_D21B615216D90E442798637B7BBCAEE503228906/WS-ResourceProperties.wsdl) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667) at org.apache.xmlbeans.XmlBeans.compileXsd(XmlBeans.java:553) -jacobd On Tue, May 12, 2009 at 2:01 PM, Michael Xenakis michael@gmail.com wrote: Actually, i am going to tell you exactly what i do... compilationObject is ArrayListXmlObject and contains all my schemas, but before adding all the schemas to the ArrayList i take the string representation of every xmlobject (schema) to change sth on the namespaces section and again parse them to take the xmlobject representation of the schema. (I hope it's clear ) now, the code XmlOptions opts = new XmlOptions(); opts = opts.setCompileDownloadUrls(); /*opts = opts.setLoadUseDefaultResolver(); */ sts = XmlBeans.compileXsd(compilationObjects.toArray(new XmlObject[compilationObjects.size()]),XmlBeans.getBuiltinTypeSystem(),opts
Re: error: URL ../X/Y/SchemaExample.xsd is not well-formed
If I'm following whats happening, the issue is actually in how you are compiling all of the schemas together. You probably have several schemas that include the contents of WS-ResourceProperties.wsdl I would imagine the issue is now in your code. As a simple workaround, you might be able to override this with the -allowMdefs settings (XMLOptions has an equivalent) from teh command line. -jacobd On Wed, May 13, 2009 at 12:53 AM, Michael Xenakis michael@gmail.com wrote: Do you mean by that , that the problem is in the wsdl document or the code? Also yesterday i've tried to find where is this WS-ResourceProperties.wsdl and i couldn't find it in their server thanks again Jacob, Michael Jacob Danner wrote: This new error means something the references are now being resolved properly. You'll have to find out why you are getting this new error, but it looks like 2 of your artifacts are compiling/referencing WS-ResourceProperties.wsdl Best of luck, -jacobd On Wed, May 13, 2009 at 12:31 AM, Michael Xenakis michael@gmail.com wrote: Jacob Danner wrote: What do you mean by to change sth on the namespaces ? When i parse ( with WSDL4J ) a WSDL document from a specified URL i copy the namespaces from WSDL definitions because some of the prefixes that are used in the xsds encapsulated in types are not resolved...So, i get the definitions namespaces that are absent from schema contained in types and put them to the schemas. (i hope you understand) Okay so a couple of things... -You are parsing String representations of schemas which is why you are having trouble resolving references. If you parsed the files, this probably wouldn't be an issue. I can't parse a file.Everything is parsing runtime and online from a specified URL. -You are having these troubles because there is no way for your initial wsdl/xsd compile to resolve the schemaLocation field since there is no path or source information associated your initial xsd. -Why are you specifying: opts = opts.setCompileDownloadUrls(); ? None of the schemaLocations have a point of reference in your wsdl/xsd? Since you aren't compiling from the filesystem or URL I have this xmloption because there are xsds that have imports and on my tests without this option it couldn't compile the schemas. So, when there is an import it downloads and put it's components on my schema. Additionally, you mention... The problem is that inside the xsd, the imports have not well formed url as import namespace=x SchemaLocation=./../blah/blah.xsd These are valid imports with valid URLs in the schemaLocation field. The schemaLocation values appear to resolve properly on the file system and the URL. XMLBeans isn't doing anything wrong here and is actually processing the schema correctly So, in other words take the following example (excuse the poor incorrect xml grammar, this is for example only): String a_xsd = schema targetNamespace=DnaCopy elementFormDefault=qualified attributeFormDefault=unqualified import namespace=b schemaLocation=../a/b/c.xsd/ complexType name=baz // model group, etc... element type=b:foo / /schema; String c_xsd =schema targetNamespace=DnaCopy elementFormDefault=qualified attributeFormDefault=unqualified element name=foo type=xs:string / /schema; // PLEASE ANSWER // a) looking at a_xsd, how/where does ../a/b/c.xsd resolve to? // b) what is the absolute path of the schemaLocation in a_xsd // so you are trying ArrayListXMLObject al; al.add(XMLObject.Factory.parse(a_xsd)); al.add(XMLObject.Factory.parse(c_xsd)); // correct? // do you understand why these schemaLocations aren't resolving? This part of code is correct. Why? Because every schema doesn't have a specified source name (a base URI or something )? Have you tried setting the source names? Did that solve your problem? I tried to setSourceName on every Schema with the documentBaseURI and there was a change on the output error: org.apache.xmlbeans.XmlException: http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/wsrf/properties/WS-ResourceProperties.wsdl:0: error: sch-props-correct.2: Duplicate global type: resourceunknownfaultt...@http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd (Original global type found in file: URI_SHA_1_D21B615216D90E442798637B7BBCAEE503228906/WS-ResourceProperties.wsdl) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667) at org.apache.xmlbeans.XmlBeans.compileXsd(XmlBeans.java:553
Re: error: URL ../X/Y/SchemaExample.xsd is not well-formed
Hmm, I think you are making it too hard on yourself with all of the WSDL4J to pull out the types element. XMLBeans' scomp tool can be run on wsdls. Have/can you give this a try? I ran the following from the command line without much of a problem. # scomp http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/DnaCopy.wsdl -dl and got the following output http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/edu.wustl.icr.asrv1. dnacopy.xsd:34:25: warning: p-props-correct.2.2: maxOccurs must be greater than or equal to 1. Time to build schema type system: 5.344 seconds Time to generate code: 1.453 seconds Time to compile code: 7.844 seconds Compiled types to: xmltypes.jar relative URLs (../some.xsd) can be tricky, and I'd suggest making them absolute where ever possible. I don't see any issues with the XSDs referenced, but didn't verify the path was correct for all of them. I went ahead and made the paths absolute and verified I could compile the wsdl with scomp locally. Can you try the same. Thanks, -jacobd On Mon, May 11, 2009 at 11:55 PM, Michael Xenakis michael@gmail.com wrote: Hi Jacob and thanks for the reply, Let's start from scratch. I have WSDL files with WSDL imports. I use WSDL4j to parse the wsdl files...so, when i get the types section of the WSDL document i hold on a Xmlobject array all the XSDs from the types element. After doing this procedure to store the xsds i compile the xsds (all together), and the problem rises on this part. To specify a little bit the problem just look on this wsdl document as an example, http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/DnaCopy.wsdl and check how the imports are...on the first one i get error: URL ../wsrf/faults/WS-BaseFaults.xsd is not well formed . some import examples that their URLs are not well formed: import namespace=http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd; schemaLocation=../wsrf/faults/WS-BaseFaults.xsd/ import namespace=gme://caGrid.proposed/1.0/graph.transfer schemaLocation=./graphtransfer.xsd/ import namespace=gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata schemaLocation=./xsd/cagrid/types/caGridMetadata.xsd/ import namespace=http://transfer.cagrid.org/Transfer; schemaLocation=./caGrid_Transfer.xsd/ import namespace=gme://caB2B.icr/1.0/edu.wustl.icr.asrv1.cnat.ext schemaLocation=./edu.wustl.icr.asrv1.cnat.ext.xsd/ import namespace=gme://caB2B.icr/1.0/edu.wustl.icr.asrv1.dnacopy schemaLocation=./edu.wustl.icr.asrv1.dnacopy.xsd/ import namespace=gme://caB2B.icr/1.0/edu.wustl.icr.asrv1.common schemaLocation=./edu.wustl.icr.asrv1.common.xsd/ import namespace=gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.security schemaLocation=./xsd/cagrid/types/security/security.xsd/ The problem (I suppose) is the call on the import due to the URI format with the dots etc... and the xmlbeans doesn't understand the ./../ so thats why i was studying the entityresolver. I hope u can fully understand what's the problem, thanks in advance, Michael Jacob Danner wrote: Maybe I'm missing something in your scenario, but whenever I've seen that error it has meant something is wrong with something in my XML. With your error message, I'd suggest looking at ../X/Y/SchemaExample.xsd as a starting point. Is this file well-formed? What makes you think its an issue that requires entity resolvers? -jacobd On Mon, May 11, 2009 at 3:15 PM, Michael Xenakis michael@gmail.com wrote: Hi everybody, i get the error on the Subject with the above details: at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667) at org.apache.xmlbeans.XmlBeans.compileXsd(XmlBeans.java:553) My problem is that i have a lot of XSDs that have imports with the above format: import namespace=http://blahblahzdoing.com; SchemaLocation=./../X/Y/Z/SchemaExample.xsd/ is there any way i can solve this problem?I've studied a little bit the EntityResolver but i don't think that it could help me (and by the way i can't fully understand the way it works- (stupid :-( ) ). Is there any XmlOptions (or something ) that can solve my problem? By the way, i've already used the setLoadUseDefaultResolver() before the XmlBeans.compileXsd(compilationObjects.toArray(ArrayOfSchemas[],XmlBeans.getBuiltinTypeSystem(),Xmloptions) method... but nothing... Also, this feature is mandatory for my project and it's urgent , so i would be thankful for quick and right answers! Thanks in Advance, Mike
Re: error: URL ../X/Y/SchemaExample.xsd is not well-formed
Hi Michael, I did just convert the wsdl imports by hand because it was the quickest and easiest way for me to. There shouldn't be a problem using the relative URLs so long as the schemaLocation values are all correct (point to proper files) once the scomp is run. Are you doing your compilation programmatically or via the scomp tool? If you are doing it programmatically this might be one of the reasons you are having difficulty resolving the paths during compile time. -jacobd On Tue, May 12, 2009 at 8:27 AM, Michael Xenakis michael@gmail.com wrote: Hi Jacob and thank you for your answer, The think is that i can't pull out the WSDL4j from my code because my work is a part of a bigger project that uses WSDL4j. Could you tell me please the way to convert the relative URLs on the imports to absolute URLs?I hope u did that by xmloptions or sth and not by hand... Is there any way to convert automatically all the relative URLs to absolute in runtime(compileXSD time)? Thanks in Advance for your answers, Michael Jacob Danner wrote: Hmm, I think you are making it too hard on yourself with all of the WSDL4J to pull out the types element. XMLBeans' scomp tool can be run on wsdls. Have/can you give this a try? I ran the following from the command line without much of a problem. # scomp http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/DnaCopy.wsdl -dl and got the following output http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/edu.wustl.icr.asrv1. dnacopy.xsd:34:25: warning: p-props-correct.2.2: maxOccurs must be greater than or equal to 1. Time to build schema type system: 5.344 seconds Time to generate code: 1.453 seconds Time to compile code: 7.844 seconds Compiled types to: xmltypes.jar relative URLs (../some.xsd) can be tricky, and I'd suggest making them absolute where ever possible. I don't see any issues with the XSDs referenced, but didn't verify the path was correct for all of them. I went ahead and made the paths absolute and verified I could compile the wsdl with scomp locally. Can you try the same. Thanks, -jacobd On Mon, May 11, 2009 at 11:55 PM, Michael Xenakis michael@gmail.com wrote: Hi Jacob and thanks for the reply, Let's start from scratch. I have WSDL files with WSDL imports. I use WSDL4j to parse the wsdl files...so, when i get the types section of the WSDL document i hold on a Xmlobject array all the XSDs from the types element. After doing this procedure to store the xsds i compile the xsds (all together), and the problem rises on this part. To specify a little bit the problem just look on this wsdl document as an example, http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/DnaCopy.wsdl and check how the imports are...on the first one i get error: URL ../wsrf/faults/WS-BaseFaults.xsd is not well formed . some import examples that their URLs are not well formed: import namespace=http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd; schemaLocation=../wsrf/faults/WS-BaseFaults.xsd/ import namespace=gme://caGrid.proposed/1.0/graph.transfer schemaLocation=./graphtransfer.xsd/ import namespace=gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata schemaLocation=./xsd/cagrid/types/caGridMetadata.xsd/ import namespace=http://transfer.cagrid.org/Transfer; schemaLocation=./caGrid_Transfer.xsd/ import namespace=gme://caB2B.icr/1.0/edu.wustl.icr.asrv1.cnat.ext schemaLocation=./edu.wustl.icr.asrv1.cnat.ext.xsd/ import namespace=gme://caB2B.icr/1.0/edu.wustl.icr.asrv1.dnacopy schemaLocation=./edu.wustl.icr.asrv1.dnacopy.xsd/ import namespace=gme://caB2B.icr/1.0/edu.wustl.icr.asrv1.common schemaLocation=./edu.wustl.icr.asrv1.common.xsd/ import namespace=gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.security schemaLocation=./xsd/cagrid/types/security/security.xsd/ The problem (I suppose) is the call on the import due to the URI format with the dots etc... and the xmlbeans doesn't understand the ./../ so thats why i was studying the entityresolver. I hope u can fully understand what's the problem, thanks in advance, Michael Jacob Danner wrote: Maybe I'm missing something in your scenario, but whenever I've seen that error it has meant something is wrong with something in my XML. With your error message, I'd suggest looking at ../X/Y/SchemaExample.xsd as a starting point. Is this file well-formed? What makes you think its an issue that requires entity resolvers? -jacobd On Mon, May 11, 2009 at 3:15 PM, Michael Xenakis michael@gmail.com wrote: Hi everybody, i get the error on the Subject with the above details: at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke
Re: error: URL ../X/Y/SchemaExample.xsd is not well-formed
You can't skip an error like this. It's valid. If I'm understanding your case properly, the error message is telling you the imported schemas cannot be found. I would start by looking at how you are creating your XMLObject array. What is the value of XMLObject.getDocumentProperties().getSourceName(). Is it null? I think there might be a couple of examples of this in the xmlbeans test compile directory. -jacobd On Tue, May 12, 2009 at 8:44 AM, Michael Xenakis michael@gmail.com wrote: Hey Jacob, Yes, i'm doing the compilation programmatically with compileXSD method...and that was a compileXSD error apparently. I've checked the xmloptions to find a way to skip this error but nothing. Jacob Danner wrote: Hi Michael, I did just convert the wsdl imports by hand because it was the quickest and easiest way for me to. There shouldn't be a problem using the relative URLs so long as the schemaLocation values are all correct (point to proper files) once the scomp is run. Are you doing your compilation programmatically or via the scomp tool? If you are doing it programmatically this might be one of the reasons you are having difficulty resolving the paths during compile time. -jacobd On Tue, May 12, 2009 at 8:27 AM, Michael Xenakis michael@gmail.com wrote: Hi Jacob and thank you for your answer, The think is that i can't pull out the WSDL4j from my code because my work is a part of a bigger project that uses WSDL4j. Could you tell me please the way to convert the relative URLs on the imports to absolute URLs?I hope u did that by xmloptions or sth and not by hand... Is there any way to convert automatically all the relative URLs to absolute in runtime(compileXSD time)? Thanks in Advance for your answers, Michael Jacob Danner wrote: Hmm, I think you are making it too hard on yourself with all of the WSDL4J to pull out the types element. XMLBeans' scomp tool can be run on wsdls. Have/can you give this a try? I ran the following from the command line without much of a problem. # scomp http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/DnaCopy.wsdl -dl and got the following output http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/edu.wustl.icr.asrv1. dnacopy.xsd:34:25: warning: p-props-correct.2.2: maxOccurs must be greater than or equal to 1. Time to build schema type system: 5.344 seconds Time to generate code: 1.453 seconds Time to compile code: 7.844 seconds Compiled types to: xmltypes.jar relative URLs (../some.xsd) can be tricky, and I'd suggest making them absolute where ever possible. I don't see any issues with the XSDs referenced, but didn't verify the path was correct for all of them. I went ahead and made the paths absolute and verified I could compile the wsdl with scomp locally. Can you try the same. Thanks, -jacobd On Mon, May 11, 2009 at 11:55 PM, Michael Xenakis michael@gmail.com wrote: Hi Jacob and thanks for the reply, Let's start from scratch. I have WSDL files with WSDL imports. I use WSDL4j to parse the wsdl files...so, when i get the types section of the WSDL document i hold on a Xmlobject array all the XSDs from the types element. After doing this procedure to store the xsds i compile the xsds (all together), and the problem rises on this part. To specify a little bit the problem just look on this wsdl document as an example, http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/DnaCopy.wsdl and check how the imports are...on the first one i get error: URL ../wsrf/faults/WS-BaseFaults.xsd is not well formed . some import examples that their URLs are not well formed: import namespace=http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd; schemaLocation=../wsrf/faults/WS-BaseFaults.xsd/ import namespace=gme://caGrid.proposed/1.0/graph.transfer schemaLocation=./graphtransfer.xsd/ import namespace=gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata schemaLocation=./xsd/cagrid/types/caGridMetadata.xsd/ import namespace=http://transfer.cagrid.org/Transfer; schemaLocation=./caGrid_Transfer.xsd/ import namespace=gme://caB2B.icr/1.0/edu.wustl.icr.asrv1.cnat.ext schemaLocation=./edu.wustl.icr.asrv1.cnat.ext.xsd/ import namespace=gme://caB2B.icr/1.0/edu.wustl.icr.asrv1.dnacopy schemaLocation=./edu.wustl.icr.asrv1.dnacopy.xsd/ import namespace=gme://caB2B.icr/1.0/edu.wustl.icr.asrv1.common schemaLocation=./edu.wustl.icr.asrv1.common.xsd/ import namespace=gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.security schemaLocation=./xsd/cagrid/types/security/security.xsd/ The problem (I suppose) is the call on the import due to the URI format with the dots etc... and the xmlbeans doesn't understand the ./../ so thats why i was studying the entityresolver. I hope u can fully understand what's the problem, thanks in advance, Michael Jacob Danner wrote: Maybe I'm missing something in your scenario, but whenever
Re: error: URL ../X/Y/SchemaExample.xsd is not well-formed
If been a while since I've tinkered with these APIs, but I would try setting the sourceName value to the value of the schemaLocation ie, setSourceName(../foo.xsd); Let the list know how this turns out. -jacobd On Tue, May 12, 2009 at 10:34 AM, Jacob Danner jacob.dan...@gmail.com wrote: You can't skip an error like this. It's valid. If I'm understanding your case properly, the error message is telling you the imported schemas cannot be found. I would start by looking at how you are creating your XMLObject array. What is the value of XMLObject.getDocumentProperties().getSourceName(). Is it null? I think there might be a couple of examples of this in the xmlbeans test compile directory. -jacobd On Tue, May 12, 2009 at 8:44 AM, Michael Xenakis michael@gmail.com wrote: Hey Jacob, Yes, i'm doing the compilation programmatically with compileXSD method...and that was a compileXSD error apparently. I've checked the xmloptions to find a way to skip this error but nothing. Jacob Danner wrote: Hi Michael, I did just convert the wsdl imports by hand because it was the quickest and easiest way for me to. There shouldn't be a problem using the relative URLs so long as the schemaLocation values are all correct (point to proper files) once the scomp is run. Are you doing your compilation programmatically or via the scomp tool? If you are doing it programmatically this might be one of the reasons you are having difficulty resolving the paths during compile time. -jacobd On Tue, May 12, 2009 at 8:27 AM, Michael Xenakis michael@gmail.com wrote: Hi Jacob and thank you for your answer, The think is that i can't pull out the WSDL4j from my code because my work is a part of a bigger project that uses WSDL4j. Could you tell me please the way to convert the relative URLs on the imports to absolute URLs?I hope u did that by xmloptions or sth and not by hand... Is there any way to convert automatically all the relative URLs to absolute in runtime(compileXSD time)? Thanks in Advance for your answers, Michael Jacob Danner wrote: Hmm, I think you are making it too hard on yourself with all of the WSDL4J to pull out the types element. XMLBeans' scomp tool can be run on wsdls. Have/can you give this a try? I ran the following from the command line without much of a problem. # scomp http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/DnaCopy.wsdl -dl and got the following output http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/edu.wustl.icr.asrv1. dnacopy.xsd:34:25: warning: p-props-correct.2.2: maxOccurs must be greater than or equal to 1. Time to build schema type system: 5.344 seconds Time to generate code: 1.453 seconds Time to compile code: 7.844 seconds Compiled types to: xmltypes.jar relative URLs (../some.xsd) can be tricky, and I'd suggest making them absolute where ever possible. I don't see any issues with the XSDs referenced, but didn't verify the path was correct for all of them. I went ahead and made the paths absolute and verified I could compile the wsdl with scomp locally. Can you try the same. Thanks, -jacobd On Mon, May 11, 2009 at 11:55 PM, Michael Xenakis michael@gmail.com wrote: Hi Jacob and thanks for the reply, Let's start from scratch. I have WSDL files with WSDL imports. I use WSDL4j to parse the wsdl files...so, when i get the types section of the WSDL document i hold on a Xmlobject array all the XSDs from the types element. After doing this procedure to store the xsds i compile the xsds (all together), and the problem rises on this part. To specify a little bit the problem just look on this wsdl document as an example, http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/DnaCopy.wsdl and check how the imports are...on the first one i get error: URL ../wsrf/faults/WS-BaseFaults.xsd is not well formed . some import examples that their URLs are not well formed: import namespace=http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd; schemaLocation=../wsrf/faults/WS-BaseFaults.xsd/ import namespace=gme://caGrid.proposed/1.0/graph.transfer schemaLocation=./graphtransfer.xsd/ import namespace=gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata schemaLocation=./xsd/cagrid/types/caGridMetadata.xsd/ import namespace=http://transfer.cagrid.org/Transfer; schemaLocation=./caGrid_Transfer.xsd/ import namespace=gme://caB2B.icr/1.0/edu.wustl.icr.asrv1.cnat.ext schemaLocation=./edu.wustl.icr.asrv1.cnat.ext.xsd/ import namespace=gme://caB2B.icr/1.0/edu.wustl.icr.asrv1.dnacopy schemaLocation=./edu.wustl.icr.asrv1.dnacopy.xsd/ import namespace=gme://caB2B.icr/1.0/edu.wustl.icr.asrv1.common schemaLocation=./edu.wustl.icr.asrv1.common.xsd/ import namespace=gme://caGrid.caBIG/1.0/gov.nih.nci.cagrid.metadata.security schemaLocation=./xsd/cagrid/types/security/security.xsd/ The problem (I suppose) is the call on the import due
Re: error: URL ../X/Y/SchemaExample.xsd is not well-formed
Okay, taking your example from above import namespace=http://blahblahzdoing.com; SchemaLocation=./../X/Y/Z/SchemaExample.xsd/ You are probably doing something like this to load SchemaExample.xsd XMLObject xo = XMLObject.Factory.parse(StringOfSchemaExample.xsd); you might be able to do something like XMLObject xo = XMLObject.Factory.parse(new File(./../X/Y/Z/SchemaExample.xsd)); and/or xo.getDocumentProperties().setSourceName(./../X/Y/Z/SchemaExample.xsd); HTH, -jacobd On Tue, May 12, 2009 at 1:35 PM, Michael Xenakis michael@gmail.com wrote: Ok, but the schemaLocations are attributes of the import elements...how could i manipulate every import and correct it , in order to compile? Every import could have different namespace and schemaLocation fields With setSourceName you just set the url of the whole schema... Could you please give a little bit more infos? Thanks again, Michael Jacob Danner wrote: If been a while since I've tinkered with these APIs, but I would try setting the sourceName value to the value of the schemaLocation ie, setSourceName(../foo.xsd); Let the list know how this turns out. -jacobd On Tue, May 12, 2009 at 10:34 AM, Jacob Danner jacob.dan...@gmail.com wrote: You can't skip an error like this. It's valid. If I'm understanding your case properly, the error message is telling you the imported schemas cannot be found. I would start by looking at how you are creating your XMLObject array. What is the value of XMLObject.getDocumentProperties().getSourceName(). Is it null? I think there might be a couple of examples of this in the xmlbeans test compile directory. -jacobd On Tue, May 12, 2009 at 8:44 AM, Michael Xenakis michael@gmail.com wrote: Hey Jacob, Yes, i'm doing the compilation programmatically with compileXSD method...and that was a compileXSD error apparently. I've checked the xmloptions to find a way to skip this error but nothing. Jacob Danner wrote: Hi Michael, I did just convert the wsdl imports by hand because it was the quickest and easiest way for me to. There shouldn't be a problem using the relative URLs so long as the schemaLocation values are all correct (point to proper files) once the scomp is run. Are you doing your compilation programmatically or via the scomp tool? If you are doing it programmatically this might be one of the reasons you are having difficulty resolving the paths during compile time. -jacobd On Tue, May 12, 2009 at 8:27 AM, Michael Xenakis michael@gmail.com wrote: Hi Jacob and thank you for your answer, The think is that i can't pull out the WSDL4j from my code because my work is a part of a bigger project that uses WSDL4j. Could you tell me please the way to convert the relative URLs on the imports to absolute URLs?I hope u did that by xmloptions or sth and not by hand... Is there any way to convert automatically all the relative URLs to absolute in runtime(compileXSD time)? Thanks in Advance for your answers, Michael Jacob Danner wrote: Hmm, I think you are making it too hard on yourself with all of the WSDL4J to pull out the types element. XMLBeans' scomp tool can be run on wsdls. Have/can you give this a try? I ran the following from the command line without much of a problem. # scomp http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/DnaCopy.wsdl -dl and got the following output http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/edu.wustl.icr.asrv1. dnacopy.xsd:34:25: warning: p-props-correct.2.2: maxOccurs must be greater than or equal to 1. Time to build schema type system: 5.344 seconds Time to generate code: 1.453 seconds Time to compile code: 7.844 seconds Compiled types to: xmltypes.jar relative URLs (../some.xsd) can be tricky, and I'd suggest making them absolute where ever possible. I don't see any issues with the XSDs referenced, but didn't verify the path was correct for all of them. I went ahead and made the paths absolute and verified I could compile the wsdl with scomp locally. Can you try the same. Thanks, -jacobd On Mon, May 11, 2009 at 11:55 PM, Michael Xenakis michael@gmail.com wrote: Hi Jacob and thanks for the reply, Let's start from scratch. I have WSDL files with WSDL imports. I use WSDL4j to parse the wsdl files...so, when i get the types section of the WSDL document i hold on a Xmlobject array all the XSDs from the types element. After doing this procedure to store the xsds i compile the xsds (all together), and the problem rises on this part. To specify a little bit the problem just look on this wsdl document as an example, http://linuxcomp64.wustl.edu:9880/wsrf/share/schema/DnaCopy/DnaCopy.wsdl and check how the imports are...on the first one i get error: URL ../wsrf/faults/WS-BaseFaults.xsd is not well formed . some import examples that their URLs are not well formed: import namespace=http://docs.oasis
Re: error: URL ../X/Y/SchemaExample.xsd is not well-formed
What do you mean by to change sth on the namespaces ? Okay so a couple of things... -You are parsing String representations of schemas which is why you are having trouble resolving references. If you parsed the files, this probably wouldn't be an issue. -You are having these troubles because there is no way for your initial wsdl/xsd compile to resolve the schemaLocation field since there is no path or source information associated your initial xsd. -Why are you specifying: opts = opts.setCompileDownloadUrls(); ? None of the schemaLocations have a point of reference in your wsdl/xsd? Since you aren't compiling from the filesystem or URL Additionally, you mention... The problem is that inside the xsd, the imports have not well formed url as import namespace=x SchemaLocation=./../blah/blah.xsd These are valid imports with valid URLs in the schemaLocation field. The schemaLocation values appear to resolve properly on the file system and the URL. XMLBeans isn't doing anything wrong here and is actually processing the schema correctly So, in other words take the following example (excuse the poor incorrect xml grammar, this is for example only): String a_xsd = schema targetNamespace=DnaCopy elementFormDefault=qualified attributeFormDefault=unqualified import namespace=b schemaLocation=../a/b/c.xsd/ complexType name=baz // model group, etc... element type=b:foo / /schema; String c_xsd =schema targetNamespace=DnaCopy elementFormDefault=qualified attributeFormDefault=unqualified element name=foo type=xs:string / /schema; // PLEASE ANSWER // a) looking at a_xsd, how/where does ../a/b/c.xsd resolve to? // b) what is the absolute path of the schemaLocation in a_xsd // so you are trying ArrayListXMLObject al; al.add(XMLObject.Factory.parse(a_xsd)); al.add(XMLObject.Factory.parse(c_xsd)); // correct? // do you understand why these schemaLocations aren't resolving? Have you tried setting the source names? Did that solve your problem? -jacobd On Tue, May 12, 2009 at 2:01 PM, Michael Xenakis michael@gmail.com wrote: Actually, i am going to tell you exactly what i do... compilationObject is ArrayListXmlObject and contains all my schemas, but before adding all the schemas to the ArrayList i take the string representation of every xmlobject (schema) to change sth on the namespaces section and again parse them to take the xmlobject representation of the schema. (I hope it's clear ) now, the code XmlOptions opts = new XmlOptions(); opts = opts.setCompileDownloadUrls(); /*opts = opts.setLoadUseDefaultResolver(); */ sts = XmlBeans.compileXsd(compilationObjects.toArray(new XmlObject[compilationObjects.size()]),XmlBeans.getBuiltinTypeSystem(),opts); as i stated before the wsdl i gave on the first post of this thread had multiple import layers (like baboushka dolls) and one of those layers (wsdl documents actually) had the types section, i took the xsds as xmlobjects from the types element casted to string to manipulate a little bit the namespaces of each xsd and then back to xmlobject with parse method. With this as statements, i try to compile all the schemas together to get a SchemaTypeSystem with the components of all schemas retrieved from the wsdl(s). The problem is that inside the xsd, the imports have not well formed url as import namespace=x SchemaLocation=./../blah/blah.xsd i can't parse the ./../X/Y/Z/SchemaExample.xsd as new File because it is in the xsd and inside the importsi have to find a way to change the form of the imports (or make xmlbeans understand thoroughly the above import form) before (or maybe at compile time) If u want more infos/code from my project to understand the problem i can cp more code, no prob! Thanks Michael Jacob Danner wrote: Okay, taking your example from above import namespace=http://blahblahzdoing.com; SchemaLocation=./../X/Y/Z/SchemaExample.xsd/ You are probably doing something like this to load SchemaExample.xsd XMLObject xo = XMLObject.Factory.parse(StringOfSchemaExample.xsd); you might be able to do something like XMLObject xo = XMLObject.Factory.parse(new File(./../X/Y/Z/SchemaExample.xsd)); and/or xo.getDocumentProperties().setSourceName(./../X/Y/Z/SchemaExample.xsd); HTH, -jacobd On Tue, May 12, 2009 at 1:35 PM, Michael Xenakis michael@gmail.com wrote: Ok, but the schemaLocations are attributes of the import elements...how could i manipulate every import and correct it , in order to compile? Every import could have different namespace and schemaLocation fields With setSourceName you just set the url of the whole schema... Could you please give a little bit more infos? Thanks again, Michael Jacob Danner wrote: If been a while since I've tinkered with these APIs, but I would try setting the sourceName value to the value of the schemaLocation ie, setSourceName(../foo.xsd); Let the list know how this turns out. -jacobd On Tue, May 12, 2009
Re: error: URL ../X/Y/SchemaExample.xsd is not well-formed
Maybe I'm missing something in your scenario, but whenever I've seen that error it has meant something is wrong with something in my XML. With your error message, I'd suggest looking at ../X/Y/SchemaExample.xsd as a starting point. Is this file well-formed? What makes you think its an issue that requires entity resolvers? -jacobd On Mon, May 11, 2009 at 3:15 PM, Michael Xenakis michael@gmail.com wrote: Hi everybody, i get the error on the Subject with the above details: at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667) at org.apache.xmlbeans.XmlBeans.compileXsd(XmlBeans.java:553) My problem is that i have a lot of XSDs that have imports with the above format: import namespace=http://blahblahzdoing.com; SchemaLocation=./../X/Y/Z/SchemaExample.xsd/ is there any way i can solve this problem?I've studied a little bit the EntityResolver but i don't think that it could help me (and by the way i can't fully understand the way it works- (stupid :-( ) ). Is there any XmlOptions (or something ) that can solve my problem? By the way, i've already used the setLoadUseDefaultResolver() before the XmlBeans.compileXsd(compilationObjects.toArray(ArrayOfSchemas[],XmlBeans.getBuiltinTypeSystem(),Xmloptions) method... but nothing... Also, this feature is mandatory for my project and it's urgent , so i would be thankful for quick and right answers! Thanks in Advance, Mike - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: XMLBeans-Axis2 - Type naming differences
You could probably use an xsdconfig file to specify the namespaces to package name mapping. Also, with a mix of xsds and wsdls have you thought about using sfactor to create a schema containing common types and elements. HTH, -jacobd On Wed, Mar 11, 2009 at 8:49 AM, martin.ba...@wellsfargo.com wrote: Hello, I am using Axis2 1.4 and XMLBeans 2.4. I would like to use XMLBeasn ant task to generate all the XMLBeasn artifacts and use Axis2 to just generate the skels and stubs. This is because I have a mix of .wsdl’s and .xsd’s I need to generate and would like to normalize the resource files. What I’ve found is, though, that the Axis2 tasks and XMLBeans tasks name entities differently when a span in the entity path starts with a number. For example: Element namespace – com/example/testService/2009/03 Schema – com/example/testService/2009/03/myTestSchema XMLBeans generated element – com.example.testService.x2009.x03 .myTestSchema Axis2 generated element – com.example.testService._2009._03 .myTestSchema Note that XMLbeans prepends ‘x’ and Axis2 ‘_’ to numerics. This difference changes the resource index mapping making it impossible to use the separately generated files. Can anyone tell me how to normalize the naming between Axis2 and XMLBeans? Thanks in advance, Martin
Re: Navigating Untyped XmlObject with XmlCursor
I'm not sure I really understand the question you are trying to ask, but why not try xmlcursor.toChild(1)? -jacobd On Wed, Mar 11, 2009 at 1:31 PM, Kapil Anand kapil...@yahoo.com wrote: hi I am struggling to select the contents of the first child of an untyped root element. The qname of the child is not known but the position is, so I am using xmlCursor.toFirstChild() XmlCursor code works fine if there is only one child under the root element, but it fails if there are more than one. Interestingly the navigation works fine but the XML contents of the first child XML Object selected by cursor has xml-fragment and other sibling children much like the schema typed contents of an element defined in a schema. Please see the attached file (UnTyped_XmlObject_cursor.txt) for the navigation code and the output. The XML value for First Child at Level 1: is the erroneous output. I would really appreciate any help. (i have seen similar questions posted here without any response) thanks kapil http://www.nabble.com/file/p22463857/UnTyped_XmlObject_cursor.txt UnTyped_XmlObject_cursor.txt -- View this message in context: http://www.nabble.com/Navigating-Untyped-XmlObject-with-XmlCursor-tp22463857p22463857.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: NewLine character in xmlbeans generated xml instance
Try XmlOptions.setPrettyPrint() There are some other methods in XmlOptions that can help you tailor the spacing etc. -jacobd On Wed, Mar 11, 2009 at 4:14 PM, Garima Bathla garima.bat...@gmail.comwrote: So I am using xmlbeans to generate xml instance based on xsd schema. But the issue is that in my generated xml instance all the tokens in xml are well formed but missing \n ( new line); How do I generate an xml instance with new line characters already inserted so that the generated xml is more readable. so my current output is like this starthomeaddressunit2200/unitstreetXYZ/streetstateWA/statecountryUSA/countryzip98122/zip/address/home/start And I want the output to look like: start home address unit2200/unit streetXYZ/street stateWA/state countryUSA/country zip98122/zip /address /home /start So that it is more readable? ANY help in this direction will be helpful. Regards, Garima.
Re: XmlBeans.compileXmlBeans() fails on *some* w3c Elements
I think the error message is pretty clear on this one. The 0th supplied input is not a schema document: its type is N= The XmlBeans.compileXmlBeans method only takes schema elements and whatever you have passed in does not meet that criteria. You can read more about the method parameters at the following javadoc URL. http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlBeans.html#compileXmlBeans(java.lang.String,%20org.apache.xmlbeans.SchemaTypeSystem,%20org.apache.xmlbeans.XmlObject[],%20org.apache.xmlbeans.BindingConfig,%20org.apache.xmlbeans.SchemaTypeLoader,%20org.apache.xmlbeans.Filer,%20org.apache.xmlbeans.XmlOptions) ... The XmlObjects passed in should be w3c schema elements whose type is org.w3c.x2001.xmlSchema.Schema. (That is, schema elements in the XML namespace http://www.w3c.org/2001/XMLSchema.) Also org.w3c.x2001.xmlSchema.SchemaDocument is permitted. HTH, -jacobd On Sun, Mar 8, 2009 at 6:46 AM, ali...@gmx.net ali...@gmx.net wrote: Hi, I get the following error when trying to compile a XML Schema by passing a org.w3c.dom.Element to the XmlBeans.compileXmlBeans() function: reson: Thread main: The 0th supplied input is not a schema document: its type is N= The error is caused not by all Element (s) i pass to the function, only by a subset, for example when I get the XSD from a file this way in Java: DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); Document doc_input = factory.newDocumentBuilder().parse(new File(xsd_input)); Element the_element_to_pass = doc_input.getDocumentElement(); When I get the Element from another XML lib and pass it, it works... Any idea what's wrong with the Element I loaded from file and extracted with getDocumentElement() ? - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: How to generically create a SchemaType instance doc?
Take a peek at the xsd2inst tool under your xmlbeans_home\bin directory -jacobd On Tue, Feb 24, 2009 at 5:41 PM, Andy Putnins putn...@lett.com wrote: Given a schem that has been parsed and loaded into a SchemaTypeSystema, how can I create a document instance with just the root element? I don't have prior knowledge of the schema contents other than knowing that it has a single global element. I can confirm that it has a global element with SchemaType.isDocumentType() but how should I proceed? Perhaps if I could discover it's QName, I could construct an element instance, but how? Or is there a better approach? - Andy - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: xml-fragment Issues
Can you post a snippet of code? -jacobd On Tue, Feb 17, 2009 at 5:19 PM, riya rachan...@gmail.com wrote: Hi, I generated xsd using inst2xsd provided with xmlbeans. command: inst2xsd rd Address_Valid_Request.xml Following is the xsd I got: ?xml version=1.0 encoding=UTF-8? xs:schema attributeFormDefault=unqualified elementFormDefault=qualified xmlns:xs=http://www.w3.org/2001/XMLSchema; xs:element name=ADDR_VALID_REQUEST type=ADDR_VALID_REQUESTType/ xs:complexType name=HEADERType xs:sequence xs:element type=xs:string name=APPLICATION_ID/ xs:element type=xs:string name=IBPASSWORD/ xs:element type=xs:string name=LANGUAGE_CD/ /xs:sequence /xs:complexType xs:complexType name=ADDR_VALID_REQUESTType xs:sequence xs:element type=HEADERType name=HEADER/ xs:element type=xs:int name=DSID/ xs:element type=xs:string name=COUNTRY/ xs:element type=xs:string name=ADDRESS1/ xs:element type=xs:string name=ADDRESS2/ xs:element type=xs:string name=ADDRESS3/ xs:element type=xs:string name=ADDRESS4/ xs:element type=xs:string name=CITY/ xs:element type=xs:string name=STATE/ xs:element type=xs:string name=COUNTY/ xs:element type=xs:int name=POSTAL/ /xs:sequence /xs:complexType /xs:schema Now when I try to generate a xml based on jar generated from above xsd, I get following: xml-fragment HEADER APPLICATION_IDUSER/APPLICATION_ID IBPASSWORDxyz/IBPASSWORD LANGUAGE_CDENG/LANGUAGE_CD /HEADER DSID45454545/DSID COUNTRYUSA/COUNTRY ADDRESS1s/ADDRESS1 ADDRESS2s/ADDRESS2 ADDRESS3/ ADDRESS4/ CITYs/CITY STATECA/STATE COUNTY/ POSTAL95014/POSTAL /xml-fragment The xml as you can see is mostly fine, except for the top node which is /xml-fragment. Can some one please tell me how to correct this? Thanks in advance! riya -- View this message in context: http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22070264.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Issues with Maven and XMLBeans
Interesting, I don't know the maven plugin, so I can't comment as to the what and why this is happening. As a workaround, have you tried using an xsdconfig file. Something like xb:config xmlns:xb=http://xml.apache.org/xmlbeans/2004/02/xbean/config; xb:namespace uri=urn:uddi-org:api_v3 xb:packageapi_v3.uddi_org/xb:package /xb:namespace /xb:config HTH, -jacobd On Wed, Feb 4, 2009 at 11:21 AM, Mike Wallace the_real_bri...@yahoo.com wrote: Hi. I'm attempting to generate classes using XMLBeans 2.2.0 within a Maven build. The XMLBeans Maven Plugin version is 2.3.2. The problem I'm running into is that for some of the Namespaces in the schema files, the package names aren't being generated as expected. The namespace in question is urn:uddi-org:api_v3. I expect the package name to be api_v3.uddi_org. However, what I'm getting is uddiOrgApiV3. Are there any settings that can be used to control the naming scheme? This seems to work as expected within an Ant task. Unfortunately, I don't know enough about it to determine what the differences are. Thanks, Mike - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Novice XmlBeans user question
What errors are you seeing? On Fri, Jan 9, 2009 at 10:30 AM, Wm.A.Stafford staff...@marine.rutgers.edu wrote: Jacob. The MetadataDocument is not valid. What does this mean? -=beeky Jacob Danner wrote: Did you try validating it? Here is what I was referring to: MetadataDocument mDoc =MetaDataDocument.Factory.parse(new URL(server_url)); MetadataResultType doc = mDoc.getMetadataResultType(); System.out.println(title= + doc.getTitle() ); System.out.println(doc= + doc.toString()) ; On Fri, Jan 9, 2009 at 9:16 AM, Wm.A.Stafford staff...@marine.rutgers.edu wrote: Jacob, Thanks for the quick reply. Unfortunately, I still don't see the solution. I think you are saying that the MetadataResultType.getTitle() function I mentioned is associated with type information not the actual value of the Title element. By this do you mean that there will not be a getTitle() function that returns the value of the Title element? I suppose I'm approaching this in a backward fashion. I used XmlBeans to generate classes and javadoc and then searched the javadoc for a getTitle() function. How is this usually done, i.e. how do you go from schema element to java class to method that gets the element value? Thanks, -=beeky - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Novice XmlBeans user question
Okay, thats kind of what I thought. Check the XML you are getting back from the serverURL. My guess is it won't match the document you are trying to parse it to. On Fri, Jan 9, 2009 at 10:39 AM, Wm.A.Stafford staff...@marine.rutgers.edu wrote: jacob, This is the exception that is thrown: rg.apache.xmlbeans.XmlException: Element respo...@http://rs.tdwg.org/tapir/1.0 is not a valid metad...@http://rs.tdwg.org/tapir/1.0 document or a valid substitution. at org.apache.xmlbeans.impl.store.Locale.autoTypeDocument(Locale.java:328) at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1279) at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1263) at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345) at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:309) at org.tdwg.rs.tapir.x10.MetadataDocument$Factory.parse(Unknown Source) at org.iobis.TapirClientUtilities.getMetadata(TapirClientUtilities.java:44) at org.iobis.TapirClientUtilities.displayMetadataToSysout(TapirClientUtilities.java:72) at org.iobis.TapirClient.main(TapirClient.java:100) Jacob Danner wrote: What errors are you seeing? On Fri, Jan 9, 2009 at 10:30 AM, Wm.A.Stafford staff...@marine.rutgers.edu wrote: Jacob. The MetadataDocument is not valid. What does this mean? -=beeky Jacob Danner wrote: Did you try validating it? Here is what I was referring to: MetadataDocument mDoc =MetaDataDocument.Factory.parse(new URL(server_url)); MetadataResultType doc = mDoc.getMetadataResultType(); System.out.println(title= + doc.getTitle() ); System.out.println(doc= + doc.toString()) ; On Fri, Jan 9, 2009 at 9:16 AM, Wm.A.Stafford staff...@marine.rutgers.edu wrote: Jacob, Thanks for the quick reply. Unfortunately, I still don't see the solution. I think you are saying that the MetadataResultType.getTitle() function I mentioned is associated with type information not the actual value of the Title element. By this do you mean that there will not be a getTitle() function that returns the value of the Title element? I suppose I'm approaching this in a backward fashion. I used XmlBeans to generate classes and javadoc and then searched the javadoc for a getTitle() function. How is this usually done, i.e. how do you go from schema element to java class to method that gets the element value? Thanks, -=beeky - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Create XSD Components via XMLBEANS
I was just playing with a couple of xmlbeans' tools that did this over the weekend. Take a peek at the inst2xsd or sfactor tools and the source code behind them. Both tools create schemas. -jacobd On Mon, Dec 22, 2008 at 12:14 PM, michael michael@gmail.com wrote: Hi, I couldn't find the way to create schema components via xmlbeans... e.g how i could make elements,types etc via xmlbeans? All the classes / interfaces have get is methods and none has set or add methods ,so i'am wondering if there is a way to create new XSD components via xmlbeans... Are there any classes to support the schema component creation? Generally, if there is a way let me know or tell me where i can study!It's urgent!! Thanks in Advance - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Create XSD Components via XMLBEANS
Hi Micheal, I was suggesting you look into the source of those tools as a reference point for what you are trying to do. In other words, the inst2xsd tool generates a schema from a xml instance. You are concerned with how to generate a schema using xmlbeans, so I would start by looking at how the inst2xsd tool does it. As far as a direct link, I'd say grab a copy of the source code for the xmlbeans project and start looking there. Thats where I go when I have questions. -jacobd On Mon, Dec 22, 2008 at 12:39 PM, michael michael@gmail.com wrote: First of all thank you for your quick answer, The first tool creates a schema from an instance document and for the second i have to search further to see the potentials. The problem is that i want to create components from scratch,with my willing and manage them.So,possibly the first i useless.These tools are accessible from xmlbeans API?i mean i can import the (jar?) into my code and use them as i now use the xmlbeans API? Do you have a direct link for further study because i couldn't find sth detailed(sth like a doc) over the internet except questions and general answers... thank you again Jacob Danner wrote: I was just playing with a couple of xmlbeans' tools that did this over the weekend. Take a peek at the inst2xsd or sfactor tools and the source code behind them. Both tools create schemas. -jacobd On Mon, Dec 22, 2008 at 12:14 PM, michael michael@gmail.com wrote: Hi, I couldn't find the way to create schema components via xmlbeans... e.g how i could make elements,types etc via xmlbeans? All the classes / interfaces have get is methods and none has set or add methods ,so i'am wondering if there is a way to create new XSD components via xmlbeans... Are there any classes to support the schema component creation? Generally, if there is a way let me know or tell me where i can study!It's urgent!! Thanks in Advance - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: create an array using Factory.newInstance() method
Hi Shahzad, AFAIK you can't create a new array using the Factory.newInstance() method, but you can initialize items in the array with the method. Rule[] rule = new Rule[15]; for(int i = 0; i rule.length; i++){ rule[i] = Rule.Factory.newInstance(); } and then a call to rule[0].setId(SomeVal) shouldn't fail with an NPE. You can also use generics instead of array if thats more convenient. to do so, just add to -source 1.5 option to scomp when you compile your schemas. -jacobd On Mon, Dec 22, 2008 at 3:28 PM, Qureshi,Shahzad [Ontario] shahzad.qure...@ec.gc.ca wrote: Hi all, I am having problem creating an array using object.Factory.newInstance() method. This is what I am trying to do I've an xml element and xmlbean generated object is called Rule. I need to create an array of Rule to use it in xmlbean genereated method setRuleArray(Rule[] args) I can't use Rule[] rule = new Rule[1]; Because when I try to use rule's methods like Rule[0].setId(1); I get a NullPointerException And I don't know how to use the Factory.newInstance() method to create an array Basically I would like to do something like the following Rule[] ruleArray = something here that creates the rule array; ruleArray[0].setId(1); someObj.setRuleArray(ruleArray); Any suggestions? Thank you Shahzad Qureshi Systems Analyst/Programmer Applications Directorate, CIOB Environment Canada shahzad.qure...@ec.gc.ca - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Generating .java files
Have you tried scomp with the -src option? -jacobd On Fri, Dec 19, 2008 at 11:01 AM, Wm.A.Stafford staff...@marine.rutgers.edu wrote: I would like to generate .java files from a schema and run Javadoc on them to produce developer level documentation of the XMLBeans classes used for this project. I tried doing this by using jad to reverse compile the class files generated by scomp then running the resulting source through Javadoc. However, the declaration: public static final SchemaType type = (SchemaType)XmlBeans.typeSystemForClassLoader... in every class file generates two errors so Javadoc cannot do anything. Is there any other way of generating the .java files that correspond to the class files? Thanks, beeky - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Questions from a newbie!
Hi Michael, There are some examples of this kind of thing in the test case directory. Take a peek in the SVN depot or view at: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/compile/scomp/som/ As far as the Eclipse errors you are seeing, those are just your standard Java errors. It might be worthwhile going through a java tutorial to save yourself some headaches. The lines you are on getting these errors from are lines 18 and 20. You can enable line numbers in eclipse in the preferences panel. -jacobd On Thu, Dec 18, 2008 at 11:49 AM, michael michael@gmail.com wrote: First of all thank you for your guick answer! I saw many of these before asking but i think that for the job i want to be done many of this are irrelevant because almost all tutorials and guides are mostly for instance manipulation. Is there any link/guide/tutorial for primitive jobs with xmlbeans?e.g parsing/compiling/loading of XSD's I wrote this piece of code and i can't figure out why it doesn't work. import org.apache.xmlbeans.*; import java.io.*; import javax.xml.namespace.*; public class XMLBeansClass { public static void main(String[] args) { XmlObject xob = XmlObject.Factory.parse(new File(/home/X/Y/Z/W/Eclipse_WorkPlace/ProjectXMLBeansTesting/src/T.xsd)); XmlObject xmlobj[] = {xob}; SchemaTypeSystem t = XmlBeans.compileXsd(xmlobj,XmlBeans.getBuiltinTypeSystem(),null); } } I get from eclipse compiler this error message : 3 errors : Unhandled exception type IOException line 18 Java Problem Unhandled exception type XmlException line 20 Java Problem Unhandled exception type XmlException line 20 Java Problem Can anyone indicate where the problem is?I can't figure out what to do Thanks in advance, Michael - Israel Rivera Jr wrote: Hey Michael, Do not worry we all had to start some where. Anyhow, when I first began using xmlbeans I read thought almost all of the tutorials. Sure it did take me a while to get up and running, however, once I was everything was working great and I understood why. Check these out and see what you come up with: http://xmlbeans.apache.org/docs/2.0.0/guide/conGettingStartedwithXMLBeans.html http://xmlbeans.apache.org/documentation/tutorial_getstarted.html http://xmlbeans.apache.org/documentation/index.html#XMLBeans+Version+1+User+Documentation Regards, Israel Rivera On Thu, Dec 18, 2008 at 11:56 AM, michael michael@gmail.com mailto:michael@gmail.com wrote: Hi everybody! First of all sorry for my procceded bad English. I'am really a dummy,so i am asking for help. My BA Thesis is about XSD type matching, so i need help. I've figured out that the API that more likely i need to use for my assignment is Schema Type API.(I hope i'am right!) So,for start , i am trying to insert (don't know the terminology,sorry) , possibly that would be compile/parse the XSD file into my code in order to use it and figure out what every interface/field/method does , simply newbie printing things for now. I tried to use on my code the CompileXsd() but i can't figure out and understand thoroughly how this method works,what it takes etc etc. To give you a more deep scope to what i want, i want to pass into my code the .xsd file which is specified somewhere in my disk and start playing with it , with the built-in interfaces. For the record,i'm using Eclipse ganymede and i've already insert the xmlbeans-2.4.0 jars etc into my personal libraries on the project , and all imports are ok. I would like to give me samples of code for passing in the .xsd file because i can't figure out what the methods take as parameters. Thanks in advance, Michael PS. I'm new to JAVA to... :( - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org mailto:user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org mailto:user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail:
Re:
So much has change between version 1.0.4 and the 2.4. Can you try on the latest release and see if its still an issue? I'm doubtful it will continue to be. -Jacobd On Wed, Dec 17, 2008 at 6:22 AM, GiuseppeBattista giuseppeba2...@yahoo.it wrote: Hello, I' m having the following error during validation; String: '06345' does not match pattern for type of abi element in driverTyp= e in namespace http://xmlbeans.notice1.notificator.dec.intesasanpaolo.com The fact is that this exception appears only sometimes against the same data! the rule in the xsd is the following:=20 xs:simpleType xs:restriction base=xs:string xs:pattern value=[0-9]{5}/xs:pattern /xs:restriction /xs:simpleType /xs:element I'm using xmlbeans :Implementation-Version: 1.0.4-r154371 the jdk where the application is running : jvm 1.4.2.20 Thanks a lot in advance Giuseppe Battista - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: parse a part of xml
Hi Eugen, Are you having troubles getting the value of the projectdataset element or are you just getting an exception when you are trying to parse it? Is there a projectDatasetType Class available? Have you tried that? What is the exception you are seeing? -jacobd On Mon, Dec 15, 2008 at 1:41 AM, Eugen Okon eugeno...@gmx.de wrote: Hello, i am new to xmlbeans, so maybe my question is a kind of basics for the framework. I am writing an application which communicates with Ms Project PSI Web Services. The application gets a SOAP response from Ms Project. The structure of this response is described below: soap:envelope ….. soap:body ReadProjectResponse … ProjectDataSet Information I need /ProjectDataSet … ReadProjectResponse /soap:body /soap:envelope Ok so now I can finally describe the problem. I have a xsd schema which models the structure of ProjectDataSet. From these xsd I've generated java code with xmlbeans's ant task. Now I am searching for an elegant possibility to parse this kind of responses. This means ProjectDataSetDocument.Factory.parse(is); should parse the inputstream beginning with the ProjectDataSet. In other cases I am understandably getting an exception. I hope someone can help me solving this problem. Eugen -- Pt! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
Re: Generated class differences between ant task maven plugin
As far as I remember the getFooList() methods are generated for generic accessors. This in done via the scomp tool with: -javasource [version] - generate java source compatible for a Java version ( 1.4 or 1.5) It looks like one of your tools' usages is settings this value while the other is not. On Tue, Dec 2, 2008 at 3:43 PM, Jim Johnson [EMAIL PROTECTED] wrote: Hi. I'm at a bit of a loss for the problem I'm currently facing. I currently have a project that uses the xmlbeans ant task to generate classes based on a supplied XSD. In my ant version I use XMLBeans 2.3.0. I'm in the process of converting this project over the maven, and as such I'm using the maven-xmlbeans-plugin. I'm using version 2.3.1 of the plugin which from what I can tell by inspecting the pom of the plugin uses XMLBeans 2.3.0 as well. The generated classes are different though in that my ant version generates methods like getFooList() along with getFooArray() which is deprecated. The maven version only generates a non-deprecated getFooArray() with no getFooList() to be found. I've tried digging through the code for the ant task to see if it passes some property that would be responsible for this that the maven version doesn't, but I have had no luck. Google is also failing me. Is there some simple setting I need for the SchemaCompiler to generate getXXXList() methods? Thank you much for any help. -Jim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Emtpy Arrays
without digging too much into the issue, have you looked into using XMLBeans inst2xsd tool to create an XSD for the instances you get from Xcelsius. I've had a lot of success with the xsds created and it was much easier than writing my own from scratch. As far as the empty array, it might be related to the namespace. try calling validate(errors) and iterating through the error list and that might shed some more light on what is causing this. -jacobd On Thu, Nov 27, 2008 at 6:13 AM, Schuster Stefan [EMAIL PROTECTED] wrote: Hi everyone, I have a problem with arrays. I get an XML document from a program that I cant change (Xcelsius). It looks like this data variable name=INFO_PROVIDER row columnIP1/column /row /variable variable name=VIEW_ID row columnnull/column /row /variable /data I created my own XSD to describe this document, in the XSD I have to use namespaces because data is already defined in the XSD namespace. The XSD is shown here: ?xml version=1.0 encoding=UTF-8? schema xmlns=http://www.w3.org/2001/XMLSchema; elementFormDefault=unqualified targetNamespace=http://cirquent.de/XcelsiusTable; xmlns:tns=http://cirquent.de/XcelsiusTable; complexType name=row sequence maxOccurs=unbounded minOccurs=0 element name=column type=string/element /sequence /complexType complexType name=variable sequence maxOccurs=unbounded minOccurs=0 element name=row type=tns:row/element /sequence attribute name=name type=string / /complexType element name=data type=tns:data/element complexType name=data sequence minOccurs=0 maxOccurs=unbounded element name=variable type=tns:variable/element /sequence /complexType /schema In order to handle the document, I have to replace the namespace using the substitution capabilities of XML Beans with the following code: namespaceMap.put(, http://cirquent.de/XcelsiusTable;); xmlOptions.setLoadSubstituteNamespaces(namespaceMap); The document is parsed and if I call the save() method, the following string is written: xcel:data xmlns:xcel=http://cirquent.de/XcelsiusTable;xcel:variable name=INFO_PROVIDERxcel:rowxcel:columnIP1/xcel:column/xcel:row/xcel:variablexcel:variable name=VIEW_IDxcel:rowxcel:columnnull/xcel:column/xcel:row/xcel:variable/xcel:data Here comes the problem: Calling getVariableArray() on the data element, I get an empty array as response. What am I doing wrong? Best regards, Stefan Schuster Consultant NW FI cirquent | softlab group Cirquent GmbH Königsberger Straße 29 | 60487 Frankfurt a.M. Telefon +49 69 97261-800 | Fax +49 69 97261-899 E-Mail [EMAIL PROTECTED] | Mobil +49 151 1822 5456 Internet http://www.cirquent.de Cirquent GmbH | Geschäftsführung: Peter Broicher (Vorsitzender), Dr. Stefan Aicher, Thomas Balgheim (stellvertretender Vorsitzender), Bernd Stroppel, Said Tabet Sitz und Amtsgericht: München HRB 51846 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Schema generation from Java classes (Java 1.4)
I don't think XMLBeans has what you are looking for in terms of creating a schema from existing java sources in the way JAXB's schema gen tool does. Have you looked at Castor or JIBx? -jacobd On Tue, Nov 25, 2008 at 4:16 AM, Abid Hussain [EMAIL PROTECTED] wrote: Hello everybody, I'm looking for a tool which can map existing classes to a schema. In Jaxb 2.0 this is possible (the tool is called schemagen) but only with Java 1.5. Jaxb 1.0 supports Java 1.4 but doesn't have such a tool. Does anybody know how to do so with Java 1.4? AFAIK there is no schemagen-like tool in XMLBeans... Regards, Abid -- Abid Hussain - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XMLBeans : How can I get a value and not an xml fragment?
I'm not sure how the type is defined, but aren't there getters and setters or something like intValue() to get this. You are seeing this because getM() returns some kind of type associated with xml (element in this case) and not some kind of java primitive. The docs explain things far better than I can (http://xmlbeans.apache.org/documentation/index.html) take a peek and let the list know if you have any questions. HTH, -jacobd On Sat, Nov 15, 2008 at 4:36 PM, MattC123 [EMAIL PROTECTED] wrote: I've just started using XMLBeans (read newbie) and I've run into a problem. I have a simple element and I am trying to get the value of it. Instead of getting the value I keep getting an XML fragment. An example should make this clearer: XML snippet: ... RES SN=1 EN=10 M1410/M ... XSD snippet: ... xs:element name=RES xs:complexType xs:sequence xs:element ref=M/ ... Java Code snippet: System.out.println(res.getM(); System.out.println(res.getM().xmlText()); System.out.println(res.getM().toString()); All 3 println() statements produce the following output: xml-fragment xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;1410/xml-fragment Why is it printing xml-fragment ...? What should I do just to get the value (i.e. 1410)? Thanks in advance, MattC -- View this message in context: http://www.nabble.com/XMLBeans-%3A-How-can-I-get-a-value-and-not-an-xml-fragment--tp20521127p20521127.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XMLCursor Helps.
I've noticed you've posted this message a couple of times. Are you having trouble? Why don't you post the parts of the code you are having trouble with and maybe the list can help you out. -jacobd also moving to the user list On Mon, Nov 3, 2008 at 7:29 AM, bala r [EMAIL PROTECTED] wrote: Hi, Are there any documents or sample codes for creating XML using XMLcursor with out any XSD? Thanks Bala. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XMLCursor Helps for creating XML
Definitely a question for the user list vs. the dev list. The sample you seek is mentioned on the xmlbeans sample page: http://xmlbeans.apache.org/samples/index.html#Examples+in+XMLBeans+Source # org.apache.xmlbeans.impl.xsd2inst.SampleXmlUtil It is a great example of how to combine the XmlCursor and SchemaType APIs to create a full [sub]document that includes required children, default values etc. HTH, -jacobd On Thu, Oct 30, 2008 at 3:23 AM, bala r [EMAIL PROTECTED] wrote: Hi, I need to create diffrent XML dynamically using XMLCursor. The no of XML types are more than 50s and we dont have Schema def.. The difference between each XMLType is Root Element and very few elements. IS there any document or sample code for creating new XMl using XMLCursor? Thanks in Advance. Thanks Bala. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: pls. help me
Have you tried XmlOptions.setSaveAggressiveNamespaces(). -jacobd 2008/9/26 wabby [EMAIL PROTECTED] all: why I create xml file with xmlbeans,cotain xmlns=http://xxx.xxx.xxx; in Every node, like the following : AS400Body xmlns=http://www.aaa.com.cn/aaaGateway; field name=QUERYTYPE xmlns=http://www.aaa.com.cn/aaaGateway 1/field field name=ORINGINALCMDATE xmlns=http://www.aaa.com.cn/aaaGateway 20080606/field field name=remark1 xmlns=http://www.aaa.com.cn/aaaGateway/ field name=ORINGINALSYS xmlns=http://www.aaa.com.cn/aaaGateway NIBS/field field name=QUERYDATE xmlns=http://www.aaa.com.cn/aaaGateway 20080926/field /AS400Body wabby [EMAIL PROTECTED] 2008-09-26
Re: Very simple question (I think)
For XML to be equivalent, things like namespace prefixes, whitespace*, etc can be different. With Strings, this is not the case. For example: foo xmlns=http://foobaz; / and baz:foo xmlns:baz=http://foobaz; / Are equivalent in XML. If you are hoping to do an == check using the above with strings it will ALWAYS fail with String.equals. Why not try XMLObject.[compareTo|compareValue|valueEquals] ? -jacobd On Mon, Sep 15, 2008 at 7:14 AM, Nicolai Odum [EMAIL PROTECTED] wrote: Sorry - but no good From the javadoc *toString* *String* http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html * toString*() Returns an XML string for this XML object. The string is pretty-printed. If you want a non-pretty-printed string, or if you want to control options precisely, use the xmlText() methods. /Nicolai CSC • This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose • CSC Danmark A/S • Registered Office: Retortvej 8, DK -1780 Copenhagen V , Denmark • Registered in Denmark No: 15231599 *Andrew Mansfield [EMAIL PROTECTED]* 15-09-2008 16:13 Please respond to user@xmlbeans.apache.org To user@xmlbeans.apache.org cc Subject RE: Very simple question (I think) try parse.toString(); -- *From:* Nicolai Odum [mailto:[EMAIL PROTECTED] * Sent:* 15 September 2008 15:09* To:* [EMAIL PROTECTED] Subject:* RE: Very simple question (I think) I will try again :-) Sorry for my pore english skills. When I say invalid i mean that the generated hash value no longer is valid...I can work with the xml beans structure but I need acces to the untouched, native, raw xml string that I used as a argument to the factory. XmlObject parse = XmlObject.Factory.parse(*xml*); /Nicolai CSC • This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose • CSC Danmark A/S • Registered Office: Retortvej 8, DK -1780 Copenhagen V , Denmark • Registered in Denmark No: 15231599 *Andrew Mansfield [EMAIL PROTECTED]* 15-09-2008 15:58 Please respond to user@xmlbeans.apache.org To user@xmlbeans.apache.org cc Subject RE: Very simple question (I think) I just ran the following Junit test with no problems... *public* *void* test() *throws* XmlException, IOException{ String xmltext = *new* String( testelement1testvalue/element1/test); XmlObject xmlObject = XmlObject.Factory.*parse*(*new*ByteArrayInputStream(xmltext.getBytes())); Node rootnode = xmlObject.getDomNode().getFirstChild(); *assertEquals*(test,rootnode.getNodeName()); } -- *From:* Nicolai Odum [mailto:[EMAIL PROTECTED] * Sent:* 15 September 2008 14:41* To:* [EMAIL PROTECTED] Subject:* RE: Very simple question (I think) Sorry bad example It's was just suppose to be psudo code String xml = big xml document; I have tried it with many big valid xml documents - without luck. /Nicolai *Andrew Mansfield [EMAIL PROTECTED]* 15-09-2008 15:36 Please respond to user@xmlbeans.apache.org To user@xmlbeans.apache.org cc Subject RE: Very simple question (I think) I think you need to parse a valid source document first. Then you can get access to the underlying XmlObject. Regards, -- *From:* Nicolai Odum [mailto:[EMAIL PROTECTED] * Sent:* 15 September 2008 14:32* To:* [EMAIL PROTECTED] Subject:* Very simple question (I think) Hello On *xmlbeans.apache.org*http://xmlbeans.apache.org/docs/2.0.0/guide/conGettingStartedwithXMLBeans.htmlit says that XMLBeans provide quote It provides a familiar Java object-based view of XML data without losing access to the original, native XML structure /quote I am using XMLBeans on a xml structure that is signed with a hash value so *nothing* must change before the xml is invalid. The question is: *HOW* do i get access to the original, native XML structure. because this doesn't work String xml = big xml document; XmlObject parse = XmlObject.Factory.parse(xml); String newXml = parse.xmlText(); if (xml.equals(newXml) System.out.println(jubii); else System.out.println(damn); Please help :-) Cheers Nicolai -- This email with all information contained herein or attached hereto may contain confidential and/or privileged
Re: ClassNotFoundException with generated code
How did you compile the schema? -jacobd On Wed, Jul 30, 2008 at 1:05 AM, Daniel Toffetti [EMAIL PROTECTED] wrote: Hi ! I've compiled an xsd and I'm getting an error while trying to use the generated classes like this: MyStandardDocument td = MyStandardDocument.Factory.newInstance(); MyRootElement tdi = td.addNewMyRootElement(); tdi.setCreator(Daniel); ... The error is this: GRAVE: Servlet.service() for servlet default threw exception java.lang.ClassNotFoundException: schemaorg_apache_xmlbeans.system.s8531D468835C899837F8F10B834D344C.TypeSystemHolder And points to this place in the generated code: public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType) org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(MyStandardDocument.class.getClassLoader(), schemaorg_apache_xmlbeans.system.s8531D468835C899837F8F10B834D344C).resolveHandle(traceabilitydocument3d16doctype); Now, what is schemaorg_apache_xmlbeans.system.s8531D468835C899837F8F10B834D344C ?? OK, I understand the string represents a SchemaTypeSystem, but how do I interpret its meaning ?? Any other hints ? Cheers, Daniel ¡Buscá desde tu celular! Yahoo! oneSEARCH ahora está en Claro http://ar.mobile.yahoo.com/onesearch - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Advice about tools
Hi Daniel, Yep, It's possible, and has been done by a couple of XML Editing tools already. While I haven't tried dev'ing this usage scenario myself, I don't see anything preventing you from using XMLBeans to do so. -jacobd On Tue, Jul 22, 2008 at 3:44 AM, Daniel Toffetti [EMAIL PROTECTED] wrote: Hi ! I would like to know if it's possible to do what I'm trying to do, and what would be the best tools to do that. Here is it: I want to load an XML Schema Definition into a TreeModel to display it in a user interface. The user should be able to interact with that interface to add and edit data, and then save the edited data as an XML Instance document. In other words, I want the user to be presented with the full Schema in the form of a tree template, where he can add data as needed and save instances. I will have to use some knowledge of the specific Schemas, for example for adding localized labels or some custom item editing features, but other than that, I want this to be as automatic as possible, I mean, if possible, I don't want to build the TreeModel by hand using knowledge of the specific XSD. Is this possible using available standards / libraries ?? Cheers, Daniel ¡Buscá desde tu celular! Yahoo! oneSEARCH ahora está en Claro http://ar.mobile.yahoo.com/onesearch - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XMLBeans regarding valid XML file as invalid?
Its because your code is using the Type instead of the Document. If you use WorkflowManagerInstanceDescriptorDocument in your code instead these errors should go away. You can read a little more about why this is so here, http://xmlbeans.apache.org/docs/2.0.0/guide/conJavaTypesGeneratedFromUserDerived.html HTH, -jacobd On Tue, Jul 15, 2008 at 8:22 AM, Andre de Souza [EMAIL PROTECTED] wrote: Hi all, I used scomp to generate a parser for an XML file which root element is expected to be WorkflowManagerInstanceDescriptor. The input file for scomp is the attached WorkflowManager.xsd file. I created an XML file (UnsecureWorkflow1.xml) and validated it against the schema using both Eclipse and Oxygen. For that reason, I believe the XML file is valid. However, when parsing it using the generated XMLBeans parser, I can't retrieve the information. Executing the attached java class gives an error message that claims the XML file isn't valid. So, have scomp not generated the parser appropriately or is one of my files invalid? error: cvc-complex-type.2.4a: Expected element '[EMAIL PROTECTED]://workflowmanagerservice.workflow.cagrid.org/WorkflowManagerService' instead of '[EMAIL PROTECTED]://workflowmanagerservice.workflow.cagrid.org/WorkflowManagerService' here error: cvc-complex-type.2.4c: Expected element '[EMAIL PROTECTED]://workflowmanagerservice.workflow.cagrid.org/WorkflowManagerService' before the end of the content - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XMLBeans regarding valid XML file as invalid?
I think the difference in the editor validation is you validated the instance as XML (thats what eclipse does) which is different than validating it against the schema type you had specified in your code. -jacobd On Tue, Jul 15, 2008 at 8:57 AM, Andre de Souza [EMAIL PROTECTED] wrote: Yes, I validated the input XML using the XMLBeans API (see the java class attached to my 1st message) and the error message indicates the input is invalid. Since the editors I mentioned and I myself could not see anything wrong with the input file, I don't understand why XMLBeans is regarding it as invalid. Could you take a look at the message XMLBeans reported and see if there's any inconsistency on the XML file I attached to my 1st message? Thanks. Andre de Souza Costello, Robert wrote: Have you tried validating the input against the schema using the XMLBeans API? xobj = XmlObject.Factory.parse(input, validateOptions); isValid = xobj.validate(validateOptions); I'm not familiar with Oxygen, but have run into other situations where I have seen validation differences in APIs. I've been very satisfied with the level of stringency in XMLBeans. Robert Costello -Original Message- From: Andre de Souza [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 15, 2008 10:23 AM To: user@xmlbeans.apache.org Subject: XMLBeans regarding valid XML file as invalid? Hi all, I used scomp to generate a parser for an XML file which root element is expected to be WorkflowManagerInstanceDescriptor. The input file for scomp is the attached WorkflowManager.xsd file. I created an XML file (UnsecureWorkflow1.xml) and validated it against the schema using both Eclipse and Oxygen. For that reason, I believe the XML file is valid. However, when parsing it using the generated XMLBeans parser, I can't retrieve the information. Executing the attached java class gives an error message that claims the XML file isn't valid. So, have scomp not generated the parser appropriately or is one of my files invalid? error: cvc-complex-type.2.4a: Expected element '[EMAIL PROTECTED]://workflowmanagerservice.workflow.cagrid.org/Workfl owManagerService' instead of '[EMAIL PROTECTED]://workflowmanagerservice.workflo w.cagrid.org/WorkflowManagerService' here error: cvc-complex-type.2.4c: Expected element '[EMAIL PROTECTED]://workflowmanagerservice.workflow.cagrid.org/Workfl owManagerService' before the end of the content - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [VOTE] XMLBeans 2.4.0 Release
+1 -jacobd On Thu, Jul 3, 2008 at 10:37 PM, Gustavo Aquino [EMAIL PROTECTED] wrote: +1 On Wed, Jul 2, 2008 at 3:43 PM, Cezar Andrei [EMAIL PROTECTED] wrote: Given that there are no known problems with RC3, I'm starting a vote for declaring RC3 the official XMLBeans 2.4.0 release. Files are still available at this location: http://xmlbeans.apache.org/dist/ Everyone is welcome to vote but only votes from committers and PMC members are binding. In order for the vote to pass, a majority approval is required and at least three +1 binding votes. This vote will end Monday, July 7, 2008 (End of Day). [ ] +1 - I am in favor of this release, and can help [ ] +0 - I am in favor of this release, but cannot help [ ] -0 - I am not in favor of this release [ ] -1 - I am against this proposal (must include a reason) My vote is: [X] +1 - I am in favor of this release, and can help Cezar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tags
It doesn't exactly work like that. The xsi:type is there to assert its an elements type, but it does not mean two elements are then equivalent only that they should conform to the type defined by the schema. The element names are the key here. If you are using XMLBeans and you want your FpML document, start working with the type FpMLDocument type. HTH, -jacobd On Wed, Jul 2, 2008 at 7:58 AM, Henry Barnett [EMAIL PROTECTED] wrote: Hi, I'm working with FpML and I'm not very knowledgeable about xml when it comes to standards and what is allowed and was hoping if you guy could answer a quick question I have. I have a message as follows fpml:ModifyTradeConfirmation xsi:type=fpml:ModifyTradeConfirmation... ... /fpml:ModifyTradeConfirmation Which fails validation because xmlbeans expects fpml:FpML xsi:type=fpml:ModifyTradeConfirmation... ... /fpml:FpML Is the first instance valid considering that fpml:ModifyTradeConfirmation extends fpml:FpML? Regards, Henry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help regarding CLASSPATH settings using XMLBEANS
Hi Hermanth, If there error is occuring at the line InventoryNotificationDocument.Factory.parse(xslTransormedXML); Just about anything could be occuring and we really need some more information to be able to accurately debug. Can you get any information about a stacktrace or validation issues on xslTranformedXML? Posting that here can greatly help get the answers you are looking for. -jacobd On Thu, Jun 5, 2008 at 1:27 PM, Hemanth Bhat [EMAIL PROTECTED] wrote: Hi Team I am using XMLBEANS 2.3 to develop a component The component contains a MDB (Message Driven Bean) in which I am using xml beans to process the data from the xml which I am receiving from the Weblogic JMS queue. Now when I am doing the below I am getting a problem also I am unable to catch as to what the exception is as the processing of the MDB is going into the loop after this line i.e. the same message is picked up again and again and being processed till it reaches the below line InventoryNotificationDocument poDoc = InventoryNotificationDocument.Factory.parse(xslTransormedXML); Basically I am running this code on the weblogic which is installed on the UNIX box but I have not installed the XMLBEANS software on that box However I have the following jars under the weblogic server classpath on which the code is deployed.Could this be the cause for this ? jsr173_1.0_api.jar resolver.jar xbean.jar xbean_xpath.jar xmlbeans-qname.jar xmlpublic.jar mlixmlbeans.jar I guess it is ok if I don't install xmlbeans on the Unix box as I have all the jars used in xmlbeans/lib under the classpath of the server Please guide me as to what might be the reasons or cases in which we would get problems doing the below InventoryNotificationDocument.Factory.parse(xslTransormedXML); Where InventoryNotification is my root element in the xml and xslTransormedXML is the xml String Thanks Regards Hemanth Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html externally and http://tim.techmahindra.com/Disclaimer.html internally within Tech Mahindra. -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ClassCastException when migrating to xmlbeans 2.2.9
Hi Shikhar, Have you recompiled all of your schemas? Are there any conflicting jars still on the classpath? -jacobd On Wed, Jun 4, 2008 at 7:57 AM, [EMAIL PROTECTED] wrote: Hi We are migrating our applications from Weblogic 8.1 / xbean (?) to Weblogic 9.2 / apache xbean 2.2.9-r540734 . We compiled our schema successfully with new version after making changes recommended by bea (replaced all com.bea.xml occurrences to org.apache.xmlbeans ) along with ant task def etc. XBEAN Compilation produces classes in following package structure: com.tuftshealth.container.providerListService.* and com.tuftshealth.container.providerListService.impl.* Our XSD looks like below: === ?xml version=1.0 encoding=UTF-8? schema xmlns=http://www.w3.org/2001/XMLSchema; xmlns:this=http://www.tuftshealth.com/Container/ProviderListService; xmlns:messageheader=http://www.tuftshealth.com/Base/MessageHeader; xmlns:name=http://www.tuftshealth.com/Base/Name; xmlns:status=http://www.tuftshealth.com/Base/Status; xmlns:network=http://www.tuftshealth.com/Base/Network; xmlns:date=http://www.tuftshealth.com/Base/DateRange; xmlns:contact=http://www.tuftshealth.com/Base/Contact; xmlns:address=http://www.tuftshealth.com/Base/Address; xmlns:reference=http://www.tuftshealth.com/Base/Reference; xmlns:member=http://www.tuftshealth.com/Base/Member; xmlns:benefit=http://www.tuftshealth.com/Base/Benefit; xmlns:covlimit=http://www.tuftshealth.com/Base/CoverageLimitations; xmlns:groupriders=http://www.tuftshealth.com/Base/GroupRiders; xmlns:buslninfo=http://www.tuftshealth.com/Base/BusinessLineInfo; xmlns:phone=http://www.tuftshealth.com/Base/Phone; targetNamespace=http://www.tuftshealth.com/Container/ProviderListService; elementFormDefault=qualified import namespace=http://www.tuftshealth.com/Base/MessageHeader; schemaLocation=../Base/MessageHeader.xsd/ .. element name=ProviderListRequest type=this:PrivderListServiceRequestType/ complexType name=PrivderListServiceRequestType sequence element name=MessageHeader type=messageheader:MessageHeaderType/ element name=providerRequestInfo type=this:ProviderListRequestParamsType/ = This results in exceptions at run time when we call a Tibco using a generic broker class. The broker uses following method to return class to us: obj = XmlObjectBase.Factory.parse(XMLString); XMLString contains following payload: ?xml version=1.0 encoding=UTF-8? ns0:ProviderListResponse xmlns:ns0=http://www.tuftshealth.com/Container/ProviderListService; Debug Info: PACKAGE NAME: com.tuftshealth.www.container.providerlistservice.impl CLASS NAME: ** com.tuftshealth.www.container.providerlistservice.impl.ProviderListResponseDocumentImpl java.lang.ClassCastException: com.tuftshealth.www.container.providerlistservice.impl.ProviderListResponseDocumentImpl XmlObjectBase is returning the class with www in package name. This causes ClassCastException. We tried to use XmlObject and XmlOptions is various combinations to see if www in package name goes away but it stays the same. Can someone please help us here ? It seems that behavior of XmlObject or XmlObjectBase has changed between two versions. Our apps can't work without the broker to return correct class type. Thanks for your help, Shikhar Confidential and Proprietary: This email message and any attached files contain information intended for the exclusive use of the individual or entity to whom it is addressed and may contain information that is considered privileged, proprietary, confidential and/or exempt from disclosure under applicable law. Please notify the sender, by email or telephone, if you are an unintended recipient, and delete the original message without making any copies. Thank you. -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.NoClassDefFoundError at Document$Factory.newInstance(Unknown Source)
Hi Selena, This is actually more appropriate for the user mailing list so I'm forwarding it there. Can you post some of the user code where this is occuring? Usually a NoClassDefFoundError indicates some kind of configuration issue in the application. How did you compile the schema types? Is the resulting schema type jar available on the to struts and the web application? -jacobd On Fri, May 30, 2008 at 10:34 PM, Selena Lai [EMAIL PROTECTED] wrote: I generated a client jar using scomp. Then wrote a client to create the soap object and make the web service call. The code compiles fine but during run time, I got this error. What is the dealio? java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchActio n.java:276) at org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatch Action.java:162) at com.wf.bd.ice.struts.BaseLookupDispatchAction.execute(BaseLookupDispa tchAction.java:261) at org.apache.struts.action.RequestProcessor.processActionPerform(Reques tProcessor.java:421) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja va:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:116 4) at com.wf.bd.ice.struts.ExtendedActionServlet.process(ExtendedActionServ let.java:135) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run (ServletStubImpl.java:1006) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:419) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:315) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio n.run(WebAppServletContext.java:6718) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate dSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java: 121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe rvletContext.java:3764) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm pl.java:2644) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178) Caused by: java.lang.NoClassDefFoundError at com.wellsfargo.service.provider.rws.form.createForm.x2007.CreateFormD ocument$Factory.newInstance(Unknown Source) Thanks! -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XMLBeans 1.0.4 Question about XmlDateTime xSet* methods
Interesting issue, I don't have 1.0.4 locally, but maybe you can try something for me. Can you validate your data and see if there are any errors? Thanks, -jacobd On Thu, May 15, 2008 at 3:30 PM, Inman, Peter [EMAIL PROTECTED] wrote: I have a problem and I'm not sure what's going wrong. I'm using versin 1.0.4 as I have to fit this into a WebLogic 8.1 app server, version 2.* isn't an option (as far as I know as there are conflicts with jar's) Anyway, I have a schema which has been defined using xsd:dateTime formats. XMLB has converted these and provided set methods as it should, for example setETA(Calendar cal) The problem I have is that the setETA() method takes in a calendar, and when this is converted to XML, it includes the time-zone information and I actually need a specific format for the date in the created XML. I then looked at the xsetETA() method, which takes in an XmlDateTime, and this looks like it will do the job, but when I call it, the value doesn't get set when I print out the xml. The XmlDateTime is correctly initialised. Has anyone any ideas? I could change the generated source code, and make the setETA method actually take in a string – that's what I want in the XML anyway, but I'd rather not do this if I can avoid it. I'd be grateful for any assistance. Pete -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Adding a xs:simpleType to the xml document
Hi John, If you have specify properties (ie, Type_Type) why isn't the type attribute set in your schema element? instead of: xs:element name=PropertyName/ try xs:element name=PropertyName type=Type_Type/ This will let you have specific methods for setting those enumeration values. I think your schema might need a little tweaking to make it more usable. If thats not an option, you are going to need to construct the type (Type_Type) and then set the value using one of the set or xset methods. HTH, -jacobd On Tue, May 6, 2008 at 5:05 PM, John Gan [EMAIL PROTECTED] wrote: Hi all, I'm having trouble adding a new element to the xml document. Here is the xsd snippet which represents some properties in my schema: xs:element name=ItemProperties minOccurs=0 xs:complexType xs:sequence minOccurs=0 maxOccurs=unbounded xs:element name=Property xs:complexType xs:sequence !--please refer to simpeType name-- xs:element name=PropertyName/ !--please refer to enumeration list in simpeType-- xs:element name=PropertyValue/ /xs:sequence /xs:complexType /xs:element /xs:sequence /xs:complexType /xs:element Somewhere else in the xsd the following snippet is one of many properties enumerations: xs:simpleType name=Type_Type xs:restriction base=xs:string xs:enumeration value=Area amp; Accent/ xs:enumeration value=Runners/ xs:enumeration value=Doormats/ xs:enumeration value=Rug sets/ xs:enumeration value=Rug Underlays, Pads amp; Grips/ xs:enumeration value=Tatami amp; Non-cloth/ xs:enumeration value=Artificial Flowers/ xs:enumeration value=Artificial Fruits/ xs:enumeration value=Artificial Grasses/ xs:enumeration value=Artificial Mixed Floral Arrangements/ xs:enumeration value=Artificial Plants/ xs:enumeration value=Artificial Shrubs/ xs:enumeration value=Artificial Topiaries/ xs:enumeration value=Artificial Trees/ xs:enumeration value=Artificial Vegetables/ /xs:restriction /xs:simpleType Looking at the source code for the generated xmlbean classes, I wrote the following code to add a new property to the document: com.mysite.XMLSchema.HomeLiving.ItemDataFeedDocument.ItemDataFeed.Items.Item.ItemProperties itemProperties = item.addNewItemProperties(); com.mysite.XMLSchema.HomeLiving.ItemDataFeedDocument.ItemDataFeed.Items.Item.ItemProperties.Property prop = itemProperties.addNewProperty(); XmlObject xmlObject1 = prop.addNewPropertyName(); XmlObject xmlObject2 = prop.addNewPropertyValue(); The method prop.addNewPropertyName() and prop.addNewPropertyValue() returns an XmlObject? How do I set the property name and value? I'm still new to XMlBeans and from what I read the XmlObject class is the super class of all elements in an xmlbean document (basically a blank element without name, attribute, or value)? But how do I set the name, value, or attribute to a blank XmlObject? Looking over the methods in XmlObject I don't see anything that will do that. Any help is greatly appreciated, John -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: does xmlBeans compile WSDL to Java interface?
XmlBeans creates types from the schemas that are children to the wsdl:types element. The PortType, client, Stub classes are generated for JAX-RPC and JAX-WS by other toolkits like apache Axis or XFire that might/can make use of XMLBeans as a binding system. HTH, -jacobd On Mon, Apr 7, 2008 at 9:55 AM, Jim the Standing Bear [EMAIL PROTECTED] wrote: This is probably a dumb question. Does XmlBeans compile WSDL to Java Interface? According to the xmlBeans ant task documentation, it should be able to compile schema and/or WSDL files; however, I am not seeing the service's PortType java interface being generated by xmlBeans. Did I miss something? Thanks. - Jim -- -- Standing Bear Has Spoken -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AxisFault.getCause()=null
This might a post more relevant to the Axis2 mailing list. Best of luck, -jacobd On Wed, Mar 26, 2008 at 2:22 PM, Adrián Cuartero [EMAIL PROTECTED] wrote: Hi all I keep fighting with the custom Exceptions and i'm desperate.. I send a custom exception inside an AxisFault but when the client catchs the exception fault.getCause allways is null. I've changed the Axis2.xml file setting the parameter parameter name=sendStacktraceDetailsWithFaultstrue/parameter. Has anyone an idea of what can be wrong? Where can i find a working example to know if the configuration is right or wrong? Thanks a lot. Enviado desde Correo Yahoo! Disfruta de una bandeja de entrada más inteligente.. -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What's wrong with the following XML??
I can see why inst2xsd tool is doing that. subComponents subComponent/ subComponent sequence/ /subComponent /subComponents The tools sees: subcomponent / and subComponentsequence / ... As 2 different types, if you want to correct that, you can try making them both subComponent Elements as subComponent sequence/ ... HTH, -jacobd On Wed, Mar 19, 2008 at 2:12 PM, Dan Hwang [EMAIL PROTECTED] wrote: Hello, I've beening using inst2xsd script to generate xsd from xml. I added relationships block to add some new features. After regenerating the xsd, I noticed that subComponents has been changed. before ... xs:element name=subComponents xs:complexType xs:sequence xs:element name=subComponent maxOccurs=unbounded minOccurs=0 ... after ... xs:element name=subComponents xs:complexType xs:choice maxOccurs=unbounded minOccurs=0 xs:element name=subComponent ... I'm running the following to generate xsd. ./xmlbeans-2.0.0/bin/inst2xsd -design rd -enumerations never -simple-content-types string rail.xml rail.xml-- ?xml version=1.0 encoding=UTF-8? rail keyword first/ second/ third/ /keyword relationships displayType/ relationship type/ content/ /relationship /relationships component sequence/ name/ header graphic image/ altText/ URL/ /graphic html text/ URL/ /html /header subComponents subComponent/ subComponent sequence/ /subComponent /subComponents /component /rail -- Thanks for your help~ -Dan PS: I noticed that putting the relationships block underneath the component seems to leave the subComponents unchanged... However, there's gotta be something wrong with the way I'm using it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help - Maven2 with XMLBean Integration
This is documented in the src. You can access it online at: http://svn.apache.org/viewvc/xmlbeans/trunk/maven-plugin/INSTRUCTIONS.txt?revision=220227view=markup -jacobd On Thu, Mar 6, 2008 at 9:05 PM, [EMAIL PROTECTED] wrote: Hi Friends, I am using XMLBeans to parse some XML Documents for this I want to generate Java classes from xsd by using XMLBean. In my project, we are using maven2 for building, So I want to add this generation of java classes from xsd to be included in the maven build. I plan to use maven-xmlbean-plugin. I have no idea about how to configure maven repository to have XMLBeans support, etc. Pls, Help me to solve this issue. Thanks, P.Sathish kumar The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xs:string - Isn't whitespaces preserved by default?
How are you generating the XML. I'm not positive its whitespace is preserved if something like xmlText() is used. I might try something like an xs:normalizedString and the whitespace=preserve. -jacobd On Wed, Feb 27, 2008 at 4:57 PM, dave [EMAIL PROTECTED] wrote: I have an xs:string type element to hold some regex expressions. I haven't put any restrictions/facets for this xs:string type. Isn't by default, it should preserve whitespace? Looks like the leading and trailing spaces are removed when I generate an XML using XmlBeans apis. In general, what is the better XSD data type to hold regex patterns? Is it just xs:string OR should I explicitly preserve Whitespace for this xs:string? Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: saving and getting back XMLBeans
Try the save(file) method on the xmlobject. -jacobd On Thu, Feb 21, 2008 at 7:07 AM, Dário Abdulrehman [EMAIL PROTECTED] wrote: Hi, I'd like to save a XMLBean with the declaration and encoding and read it back (using parse?). The method xmlText just saves a xmlfragment with no declaration so later when I try to read it back with parse it fails. Is there any code example for this? thx, Dário -- Dário Abdulrehman PGP Public Key: http://tinyurl.com/2pm9d7 -- -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [trying again] why validate text inside xs:documentaion
Hi Dave, everything inside and xsd:documentation needs to be well:formed xml. This means any elements declared in the documentation should be declared properly. I believe its actually the rules of XML that require prefixes to be defined. In other words you will have this problem when you do something like: xsd:documentation foo:undefinedPrefix / /xsd:documentation but not with xsd:documentation undefinedPrefix / /xsd:documentation or xsd:documentation xmlns:foo=... foo:undefinedPrefix / /xsd:documentation or xsd:documentation foo:undefinedPrefix xmlns:foo=/ /xsd:documentation Also, you should be receiving the same errors from other xml tools as well. I verified Xerces has issues with content like above. HTH, -jacobd On Thu, Feb 21, 2008 at 10:32 AM, dave [EMAIL PROTECTED] wrote: I just put some sample XML inside xs:documentaion element in my XML schema. This sample XML refers to some undeclared namespace prefix. The XMLBeans renders such XSD file invalid when validated against. Am just curious why? Of course, removing this ns prefix solved the problem though. Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Int/ Integer java types for xs:int schema type
Hi Ihab, Take a peek at http://xmlbeans.apache.org/docs/2.0.0/guide/conXMLBeansSupportBuiltInSchemaTypes.html otherwise you will need to declare teh type with nillable=true, etc. HTH, -jacobd On Wed, Feb 20, 2008 at 6:57 PM, Ihab EL-ALAMI [EMAIL PROTECTED] wrote: Hi, How can I generate the Java type Interger for xs:int? Of course, by default, it generates int. The problem with int is that you can not put it to null, and my application needs this possibility. Thanks in advance for your help -- Ihab -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SchemaType.getSourceName()
Hi Denis, From what I remember, SchemaComponent.getSourceName() will return the path/location of the xsd used to create the type system. http://xmlbeans.apache.org/docs/2.2.0/reference/org/apache/xmlbeans/SchemaComponent.html#getSourceName() If the schema was built from a string, this method returns null. Does this help, or was there something more specific you were looking for? -jacobd On Thu, Feb 14, 2008 at 12:11 AM, [EMAIL PROTECTED] wrote: Hi, everybody! Doesn anybody know how can I decode the result of SchemaType.getSourceName() method? Regards, Denis. Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mails are not encrypted and cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SchemaType.getSourceName()
Hi Denis, I see what you mean, I think in this case, getSourceName may be returning the path of the file in the scomp'ed jar. I'm on a machine without xmlbeans at the moment so maybe you can try something out for me. Will you open the scomp'ed jar and check in the schema(?)org_apache_xmlbeans\src directory and see if that xsd is present in a path similar to the one listed? As far as trying to decode the value, I think you are on the right track. XmlBeans is just munging the URI value with % being replaced with % for standard URL Encoding. Let me know about the scomp jar / src location -jacobd On Thu, Feb 14, 2008 at 11:14 PM, [EMAIL PROTECTED] wrote: Hi Jacob, I know what does this method return. But the result is encoded. Look at the example below: file_3A_2FC_3A_2Fmy_5Fxsd/datetime.xsd The question is how to decode it? For now I do it such a way: path = path.replaceAll(_2F, /); path = path.replaceAll(_2E, .); path = path.replaceAll(_3A, :); path = path.replaceAll(_5F, _); path = path.replaceAll(file:/, ); But I'm not sure that this is correct. Regards, Denis. -Original Message- From: Jacob Danner [mailto:[EMAIL PROTECTED] Sent: Thursday, February 14, 2008 8:32 PM To: user@xmlbeans.apache.org Subject: Re: SchemaType.getSourceName() Hi Denis, From what I remember, SchemaComponent.getSourceName() will return the path/location of the xsd used to create the type system. http://xmlbeans.apache.org/docs/2.2.0/reference/org/apache/xmlbeans/Sche maComponent.html#getSourceName() If the schema was built from a string, this method returns null. Does this help, or was there something more specific you were looking for? -jacobd On Thu, Feb 14, 2008 at 12:11 AM, [EMAIL PROTECTED] wrote: Hi, everybody! Doesn anybody know how can I decode the result of SchemaType.getSourceName() method? Regards, Denis. Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mails are not encrypted and cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mails are not encrypted and cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED
Re: How to apply an xpath query to a document ?
Take a peek at http://xmlbeans.apache.org/samples/XQueryXPath.html -jacobd On Feb 10, 2008 7:56 AM, Pascal Maugeri [EMAIL PROTECTED] wrote: Hi I need to do this simple operation: having a XML document (as a String for instance) I want to apply to it an XPath query and to get the XML fragment result in a new String. Could you give me some source code sample or a link ? Thanks in advance Pascal -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with integrating maven2 plugin and apache
Hi Todd, I'm not an eclipse user (IntelliJ IDEA), but I'll give it a try. Which maven plugin are you using, which version of eclipse? Have you queried the maven or eclipse projects for similar issues? -jacobd On Feb 10, 2008 6:21 PM, Todd Nine [EMAIL PROTECTED] wrote: Bump, I've been struggling with this for 2 days. Note that my title is incorrect, is should say integrating maven 2 plugin and Eclipse. I've tried downgrading xmlbeans.xbean from 2.2.0 to 2.1.0, which didn't fix my issue. If I choose a version less than 2.1.0, the plugin completely blows up due to deprecation problems. Has anyone successfully used this plugin with an Eclipse environment? If so how did you do it? This is immensely frustrating, and I don't want to use JAXB, but I'm running out of time to get XML Beans working. Thanks, Todd On Feb 8, 2008 1:03 PM, Todd Nine [EMAIL PROTECTED] wrote: Hi All, I'm using XML Beans version 2.2.0, and I'm trying to run my code through the Eclipse debugger. Its failing, and I receive the following errors. I've included my maven plugin 2 configuration, but basically I'm having the plugin create a jar of the classes that will be deployed, and including it into my classpath in Eclipse. Any idea why I'm getting this error? I'm using the same jdk for both maven, and eclipse, so I'm not sure why I'm getting the class version issues. Thanks, Todd Maven plugin configuration: plugin groupIdorg.codehaus.mojo/groupId artifactIdxmlbeans-maven-plugin/artifactId executions execution goals goalxmlbeans/goal /goals /execution /executions inheritedtrue/inherited configuration schemaDirectorysrc/main/xsd/schemaDirectory downloadtrue/download outputJartarget/eclipse/xmlbeans-eclipse-runtime.jar/outputJar /configuration Exception stacktrace: java.lang.ExceptionInInitializerError at sun.misc.Unsafe.ensureClassInitialized(Native Method) at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25) at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122) at java.lang.reflect.Field.acquireFieldAccessor(Field.java:917) at java.lang.reflect.Field.getFieldAccessor(Field.java:898) at java.lang.reflect.Field.get(Field.java:357) at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:770) at com.onwebconsulting.urchin.profiles.ProfilesDocument.clinit(Unknown Source) at com.onwebconsulting.urchin.profiles.ProfilesDocument$Factory.parse(Unknown Source) at com.bnp.insightCommon.dao.rest.UrchinDaoImpl.getProfiles(UrchinDaoImpl.java:81) at com.bnp.insightCommon.dao.UrchinDaoTest.getProfiles(UrchinDaoTest.java:54) at com.bnp.insightCommon.dao.UrchinDaoTest.testGetProfiles(UrchinDaoTest.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: java.lang.RuntimeException: Could not instantiate SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException): is the version of xbean.jar correct? at schemaorg_apache_xmlbeans.system.sD0FCECC1CA81F97745FE1F9A4449F63C.TypeSystemHolder.loadTypeSystem(Unknown Source) at
Re: Trouble generate java file with multiple xsd files
Hi Alex, You are getting an error because 2 of your schemas have the same type (in this case, attribute group) defined in them. You'll want to make sure the types are in fact the same, rather than just having the same name first. After that, there are a couple of things you can do here: 1) move the duplicate type into its own schema and compile them all together (the sfactor cmd can be helpful with creating a separate schema with the duplicate definitions) 2) compile one schema, then add the jar to the classpath when you compile the other (xmlbeans will use the existing type for the attribute group) 3) run scomp *.xsd with the alowmdef option and specify the duplicate type Hope this helps, -jacobd On Feb 6, 2008 9:07 AM, Alex Florentino [EMAIL PROTECTED] wrote: Hi all, I am newbye with xmlbeans, I was trying generate java code from some xsd files, but I get an error : the command : scomp -out file.jar *.xsd FS_OTA_HotelResNotifRQ.xsd:3407:2: error: sch-props-correct.2: Duplicate attribu te group: [EMAIL PROTECTED]://www.opentravel.org/OTA/2003/05 (Original attribute group found in file: FS_OTA_HotelResModifyNotifRQ.xsd) but if I run only one xsd file it works ok ! the xsd files are : http://www.alexflorentino.com/xsd_files.zip How I can solve this issue ? thanks a lot! Alex -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Great article - Receive events from XMLBeans
I just finished reading an article on IBM's devWorks site that I thought others might find interesting too. The article goes into some great detail explaining the extensions mechanism. A summary from the article: Through the use of two extension points in XMLBeans—the interface and PrePostSet—you can add eventing to XMLBeans. You use the interface extension to add listeners to XMLBeans, and you use the PrePostSet extension to capture the changes and notify the interested parties of the change. Finally, you integrate these extensions into XMLBeans generation through a configuration file. http://www.ibm.com/developerworks/xml/library/x-xmlbeanse/?S_TACT=105AGX54S_CMP=B0201ca=dnw-904 Kudos to Jacob Eisinger and Vince Brunssen for such a great article -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: user@xmlbeans.apache.org and complex schema
Hi Pierre, I'm not sure why the pathing to the type system holder class is different. Were there modifications to the jar after it was initially created? I'm not seeing any issues when I scomp the schema can you try rebuilding it? Ohh, I did make a couple fo changes to the XSD to make it easier for me to work with. I added and modified the xsd:import section to include schemaLocation so scomp can resolve types in other namespaces. This allowed me to not need to comment out the wsu:ld types and attributes. My modifications began around line 65 with xsd:import namespace= http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd schemaLocation= http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd; / xsd:import namespace=http://www.w3.org/2001/04/xmlenc#; schemaLocation= http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/xenc-schema.xsd; / xsd:import namespace=http://www.w3.org/2000/09/xmldsig#; schemaLocation= http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd; / then I was able to build the scomp'd jar by running scomp -dl -out something.jar SecPalSchema.jar Please let the list know if you continue to have problems, -jacobd On Jan 18, 2008 3:17 AM, Pierre De Leusse [EMAIL PROTECTED] wrote: Jacob, Thanks for the quick answer. If i open the .jar there is indeed a set of folders containing .xsb files. But there is no schemaorg_apache_xmlbeans.system.sFE919C74AB0DB9C5EAAB5EA9B1E50CD8.TypeS ystemHolder but only a schemaorg_apache_xmlbeans.system.sBC048193EBFE304C7C0734E701D4BCA0 (with a TypeS ystemHolder class inside). following is the command I've used to create the .jar: scomp -verbose -dl -compiler C:\Java\jdk1.6.0_04\bin\javac.exe -out F:\SecPal\SecPALSchema.jar F:\SecPal\SecPALSchema.xsd The only difference between this SecPALSchema.xsd and the original one being that the wsu:Id attributes have been commented out since the scomp tool couldn't find them. thanks, pierre -- *From:* Jacob Danner [mailto:[EMAIL PROTECTED] *Sent:* 17 January 2008 18:24 *To:* user@xmlbeans.apache.org *Subject:* Re: user@xmlbeans.apache.org and complex schema Hi Pierre, How are you creating your schema jar. It appears as though you might have a jar that only contains the java src and not the .xsb (xml schema binary files), etc. Can you crack your jar and verify the xsbs and the file mentioned in the stacktrace exist? Can you also let us know how you built your schema jar? Thanks, -jacobd On Jan 17, 2008 7:51 AM, Pierre De Leusse [EMAIL PROTECTED] wrote: Hi everybody, I'm trying to use xmlbeans on a fairly complex schema (http://research.microsoft.com/projects/secpal/docs/SecPALSchema.xsd). My install of xmlbeams 2.3.0 seems to work fine as I can run the easypo sample. With this schema(s), the .jar is apparently created correctly (no error as far as I could tell), I add it in the path of my project. But when I try to use it I get: Exception in thread main java.lang.ExceptionInInitializerError at com.microsoft.schemas.x2007.x02.declarativeSecurity.PolicyDocument$Facto ry.newInstance(PolicyDocument.java:45) at org.secpal.test.Serialisation2.main(Serialisation2.java :19) Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.sFE919C74AB0DB9C5EAAB5EA9B1E50CD8.TypeS ystemHolder. Make sure the generated binary files are on the classpath. at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783) at com.microsoft.schemas.x2007.x02.declarativeSecurity.PolicyDocument.clin it(PolicyDocument.java:20) ... 2 more Caused by: java.lang.ClassNotFoundException: schemaorg_apache_xmlbeans.system.sFE919C74AB0DB9C5EAAB5EA9B1E50CD8.TypeS ystemHolder at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass (Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:769) ... 3 more Could somebody tell me if it is me doing something wrong or is there another issue (and potentially a way to work on it)? Thanks, pierre - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd -- I'm competing