RE: ClassCastException
Looks like you've hit the runtime equivalent of the"multiple occurences"error. Basically, the reason XmlBeans can just read a document and validate it is that it uses the classpath to find a definition for the root element in a document. So what is happening is that, since you have multiple definitions for the same element, first one found on the classpath wins out, but this may not be the one that you are expecting. And by the way, since they all have the same name, how do you know which one you're expecting? There areseveral ways to fix this: - the obvious one, use namespaces, this is exactly what namespaces are for! - use XmlOptions.setDocumentType(x.y.z.RETURNDATADocument.type) before parsing the document: this works as long as you are not using "xsi:type" in your documents - use XmlOptions.setLoadReplaceDocumentElement() so that you can use namespaces in your Schemas, but not in the instance documents; same caveat as previous point - use custom typeloaders via XmlBeans.typeLoaderForResource(...).parse(); this allows you to take control over what type library is used when loading/validating document so it works in 100% of cases, but of course, involves writing more code. Radu -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Sent: Wednesday, May 25, 2005 7:26 AMTo: user@xmlbeans.apache.orgSubject: RE: ClassCastException I discovered that the problem is not the scema or the xml, but the classpath. I have many schemas and none of them have namespace declared. I can't change this because the schemas are coming form a service provider. Approx. all the tags in schemas have the same name. You can find RETURNDATA and DATA in each schema. The first time i tried to generate the jar i got the "multiple occurences" error. So i wrote a .xsdconfig for each schema, thus every schema have it's own package like: a.b.c.RETURNDATADocumentor x.y.z.RETURNDATADocument After the classCastException i added for each .xsdconfig file a _$ suffix where $ in (1, ...20). So now all the classes are a.b.c.RETURNDATADocument_1, ...etc If i try to parse a a.b.c.RETURNDATADocument_1 first , and it's jar in the first one in CLASSPATH it will work, but if i try after this to parse a x.y.z.RETURNDATADocument_2 i receive ClassCAstException. If i put the jars in another order, the first operation will give ClassCast PLease give me a clue at least!!On Wed May 25 4:52 , 'Don Stewart' [EMAIL PROTECTED] sent: Can you post the whole schema as I cannot see from the schema supplied the whole problem. Thanks Don From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 25 May 2005 10:37To: user@xmlbeans.apache.orgSubject: Re: ClassCastException I made a small test: i used xmlbeans to generate a sample xml file then i tried to parse it. I received ClassCastException again!!! Please help me!!On Wed May 25 2:38 , [EMAIL PROTECTED] sent: Hi! I'm receiving a ClassCastException when i'm trying to parse a VALID xml file.I'm sure the xmlbeans.jar is the right one and the schema and xml file are OK. PLease give me a clue. I pasted here a piece form xml file and xml schema Code: fr.xxx.yyy.zzz.RETURNDATADocument rd = fr.xxx.yyy.zzz.RETURNDATADocument.Factory.parse(new File(".xml")); Schema: ?xml version="1.0" encoding="UTF-8"? xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsd:annotation xsd:documentation xml:lang="en" Results of Hotel Details request, for a given Hotel Code. Any error messages in "MESSAGE" element with text "Error" followed by the error description /xsd:documentation /xsd:annotation xsd:element name="RETURNDATA" xsd:complexType ---XML: ?xml version='1.0' encoding='UTF-8'? RETURNDATA type='HDR' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://xx.yy.zz/aaa/HotelDetailRequestV4Rcv.xsd' MESSAGEDetails of the requested Hotel/MESSAGE DATA HOTEL_CODE='AUS' COUNTRY_CODE='AUS' CITY_CODE='SZG' PRINCIPAL_CODE='TRAVCO' BOARD_BASIS_CODE='BB' CATEGORY_CODE='HOT' HOTEL_NAMEAustrotel/HOTEL_NAME COUNTRY_NAMEAUS/COUNTRY_NAME /DATA /RETURNDATA- 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: Problems accessing enumerations's annotations
Ok, thanks for the information, it's clear now. Other than facets, the only things that come to mind are model groups (sequence, all, choice). For facets, the issue is that the way we expose facets is through the SchemaType.getFacet(int) API which returns an XmlAnySimpleType, which has no place for the annotation. This is definitely something good to have, but unfortunately, since no one asked for it before, I think it is a little late to expect it in the V2 timeframe. Radu -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, June 06, 2005 11:56 PM To: user@xmlbeans.apache.org Subject: RE: Problems accessing enumerations's annotations Hello, I am not sure what you mean by sort of XML Schema parser. Are you using the Schema* APIs or XmlCursor or XmlObject or none? I am going to assume that you use SchemaType and the parsing and compilation is actually done by XmlBeans. Yes, I load an XSD file then compile it with XMLBeans. Then I mainly use Schema* APIs to go through schema elements and attributes and call callbacks defined in an interface that clients (we also call them plugins) interested in can implement to generate some code (among other things, we have plugins to generate GUI elements and POJO with XDoclet @hibernate tags). And I use XmlCursor and XmlObject only to walk through application and user information embedded in annotations ... In this case, we unfortunately are not currently in the position to provide access to the Schema annotations for facets. Argh, ok ... and are facets the only case where we can't have access to Schema annotations or are there some others ? I'll follow up on that for the next release. Hmm, so there is some hope ? ;-) I don't realize the amount of stuff needed for that but if I can help in some way ... Regards, Benoit. - 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: problems with union of 2 enumerations.
Title: RE: NullPointerException when reading the leaves of the XML data Hm, I see what you're saying, but it can't work the way you want, unfortunately, because when you validate or data bind an instance of the union, the type assigned to it must be one of the member types of the union. Suppose we have two enumeration types Enum1 and Enum2 and Union a union between the two. Then, an instance of Union must either be an instance of Enum1 or an instance of Enum2, depending upon the value. Therefore (in Java) the Union class must be a superclass of both Enum1 and Enum2 (to be able to represent values of both types), so it can't be anenumeration itself. You can enforce usage of the enumeration values by turning XmlOptions.setValidateOnSet on and you can of course use the String constants generated for you in the two enumeration classes. The only thing that you'll lack is compile-time checking. Radu -Original Message-From: Ole Matzura [mailto:[EMAIL PROTECTED]Sent: Monday, June 27, 2005 2:30 AMTo: user@xmlbeans.apache.orgSubject: problems with union of 2 enumerations. Hi all! We have created two enumerations and a third simpleType consisting of a union of these 2, hoping that XMLBeans would create an enum with all enumeration values from both types available in our union type.. unfortunately this union type only gets setStringValue / setObjectValue methods and not any set( Enum ..) method(s).. (we're using 1.0.4) not a big problem really, just wondering if there is any solution or workaround available, it would be nice to enforce usage of enumeration values.. regards! /Ole
RE: How to parse the XML file with the correct 'document' class?
Peter-Paul, You can use XmlObject.Factory.parse() if you don't know the type of the message beforehand. The runtime type of the resulting object will be that of the class associated with the document, as determined by looking at the root element (as long as the appropriate scomp-generated jar is on the classpath). You can then use instanceof to check what the returned class was or get back the SchemaType using XmlObject.schemaType() (which you can then check using '==' against some known types). Radu -Original Message- From: Peter-Paul Rang [mailto:[EMAIL PROTECTED] Sent: Thursday, June 30, 2005 12:13 AM To: user@xmlbeans.apache.org Subject: How to parse the XML file with the correct 'document' class? Hi All, Perhaps anyone can help me with the following. I have several XML messages definitions to process. To parse the file with XMLBeans I have to know what message it is beforehand. Example: Here I know that it's a MCCIMT000100HT02MessageDocument, so I use that class to parse the inputFile. MCCIMT000100HT02MessageDocument document = MCCIMT000100HT02MessageDocument.Factory.parse(inputFile); But what Class should I use when I don't know yet the XML message definition of the inputFile? Can XMLBeans decide for me what Class to use? How can I check what type the inputFile is and what class to use to parse it with? Thanks for any hints, tips or suggestions. Peter-Paul - 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: Whitespace is not preserved
I see, so like if an element has element-only content, then we would insert spaces, but if it has mixed- or text-only content (simple content) the we would not touch it. Would this be based on the Schema or on the actual content of the element, you think? The reason I am asking is because you can create and manipulate invalid documents via XMLBeans. We would also need to find a way to cleanly expose this option without impacting the current functionality. Gretchen, it would be useful to have a JIRA improvement request for this, with the priority you think it has, then of course, we appreciate all the help we can get on it. Thanks, Radu -Original Message- From: Mark Lewis [mailto:[EMAIL PROTECTED] Sent: Monday, July 11, 2005 4:55 PM To: user@xmlbeans.apache.org Subject: RE: Whitespace is not preserved Hmmm, I wonder if it would be possible to alter the pretty printer to work even in this case. What if we check whether an element has leading/trailing whitespace that needs to be preserved, and selectively disable pretty-printing for that element only? Whitespace between tags wouldn't need to be preserved (unless it was defined in the schema, but most aren't written that way), so the overall document could still look pretty good. -- Mark Lewis On Mon, 2005-07-11 at 16:23 -0700, Radu Preotiuc-Pietro wrote: Well, to be honest, the meaning of pretty print is that you give up space preservation in order to get a document that's easier to read. If you care about spaces being preserved, you should _not_ use pretty print. They're exclusive and I am not sure how would they work together. However, if you access the document using, say, XmlCursor, then all the original spaces in the infoset will be there, regardless of the Pretty Print value. Radu - 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: binary xml support
Can you be more specific what flavor of binary XML are you thinking of? There is some work in progress in W3C around that but it's in very very early stages, basically they're discussing whether they should even consider it, let alone have a clear proposal on how to do it. And then there's other products each having its own brand of bin Xml, as well as academic research on the subject. Thanks, Radu -Original Message- From: Nathaniel G. Auvil [mailto:[EMAIL PROTECTED] Sent: Monday, July 25, 2005 8:26 AM To: user@xmlbeans.apache.org Subject: binary xml support when will XmlBeans support binary XML? __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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: Removing all elements in an Array
You mean something akin to List.clear(). There is nothing like this, no... Radu -Original Message- From: Joe Favero [mailto:[EMAIL PROTECTED] Sent: Friday, July 22, 2005 2:26 PM To: user@xmlbeans.apache.org Subject: Removing all elements in an Array Is there a recommended way I am not seeing in deleting all the elements in an array?? Do I have to call remove on each one first?? Or is there a way to just delete the array and start over?? Thanx Joe - 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: Problem compiling a set of schemas with xmlbeans 2.0.0
Hm, this does sound like a potential bug in the code generator. Any chance you could post your Schemas, or maybe just the part of your Schema that causes the problem or some other information to help us repro the problem? Thanks, Radu -Original Message- From: Johannes Echterhoff [mailto:[EMAIL PROTECTED] Sent: Thursday, July 28, 2005 11:57 AM To: user@xmlbeans.apache.org Subject: Problem compiling a set of schemas with xmlbeans 2.0.0 Hello. I tried to compile a set of schemas and got an error message that i do not understand. xmlbeans build the schema type system and generated the sources successfully: Time to build schema type system: 6.52 seconds Time to generate code: 81.447 seconds But when it gets to compiling i receive the following error message: Note: * uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 20 errors (I'll post the message from the command-line at the end of this mail.) Can someone help me and tell me what i did wrong? If more information is needed to solve the problem please tell me. The command i used is: scomp -d classes -src src -javasource 1.5 -out spsXmlBindings.jar -nopvr -mx 400m -catalog CustomCatalog.xml xsds Regards, Johannes Echterhoff C:\Daten\xmlbeans-2.0.0\SPSTest\src\net\opengis\gml\LineStringType.java:207: getPosList() is already defined in net.opengis.gml.LineStringType net.opengis.gml.DirectPositionListType getPosList(); ^ C:\Daten\xmlbeans-2.0.0\SPSTest\src\net\opengis\gml\LinearRingType.java:161: getPosList() is already defined in net.opengis.gml.LinearRingType net.opengis.gml.DirectPositionListType getPosList(); ^ C:\Daten\xmlbeans-2.0.0\SPSTest\src\net\opengis\gml\impl\LinearRingTypeImpl.java:504: getPosList() is already defined in net.opengis.gml.impl.LinearRingTypeImpl public net.opengis.gml.DirectPositionListType getPosList() ^ C:\Daten\xmlbeans-2.0.0\SPSTest\src\net\opengis\gml\impl\LineStringTypeImpl.java:659: getPosList() is already defined in net.opengis.gml.impl.LineStringTypeImpl public net.opengis.gml.DirectPositionListType getPosList() ^ C:\Daten\xmlbeans-2.0.0\SPSTest\src\net\opengis\gml\LineStringSegmentType.java:161: getPosList() is already defined in net.opengis.gml.LineStringSegmentType net.opengis.gml.DirectPositionListType getPosList(); ^ C:\Daten\xmlbeans-2.0.0\SPSTest\src\net\opengis\gml\impl\LineStringSegmentTypeImpl.java:504: getPosList() is already defined in net.opengis.gml.impl.LineStringSegmentTypeImpl public net.opengis.gml.DirectPositionListType getPosList() ^ C:\Daten\xmlbeans-2.0.0\SPSTest\src\net\opengis\gml\ArcStringType.java:161: getPosList() is already defined in net.opengis.gml.ArcStringType net.opengis.gml.DirectPositionListType getPosList(); ^ C:\Daten\xmlbeans-2.0.0\SPSTest\src\net\opengis\gml\impl\ArcStringTypeImpl.java:506: getPosList() is already defined in net.opengis.gml.impl.ArcStringTypeImpl public net.opengis.gml.DirectPositionListType getPosList() ^ C:\Daten\xmlbeans-2.0.0\SPSTest\src\net\opengis\gml\ArcStringByBulgeType.java:161: getPosList() is already defined in net.opengis.gml.ArcStringByBulgeType net.opengis.gml.DirectPositionListType getPosList(); ^ C:\Daten\xmlbeans-2.0.0\SPSTest\src\net\opengis\gml\impl\ArcStringByBulgeTypeImpl.java:510: getPosList() is already defined in net.opengis.gml.impl.ArcStringByB ulgeTypeImpl public net.opengis.gml.DirectPositionListType getPosList() ^ C:\Daten\xmlbeans-2.0.0\SPSTest\src\net\opengis\gml\GeodesicStringType.java:48:getPosList() is already defined in net.opengis.gml.GeodesicStringType java.util.Listnet.opengis.gml.DirectPositionType getPosList(); ^ C:\Daten\xmlbeans-2.0.0\SPSTest\src\net\opengis\gml\impl\GeodesicStringTypeImpl.java:109: getPosList() is already defined in net.opengis.gml.impl.GeodesicStringTypeImpl public java.util.Listnet.opengis.gml.DirectPositionType getPosList() ^ C:\Daten\xmlbeans-2.0.0\SPSTest\src\net\opengis\gml\CubicSplineType.java:161: getPosList() is already defined in net.opengis.gml.CubicSplineType net.opengis.gml.DirectPositionListType getPosList(); ^ C:\Daten\xmlbeans-2.0.0\SPSTest\src\net\opengis\gml\impl\CubicSplineTypeImpl.java:510: getPosList() is already defined in
RE: NullPointerException during schema compilation
I have looked over it and identified what is the most probable cause for this NPE, and as it turns out some checks were actually incorrect. Thanks for reporting this! I'll have a fix checked in SVN shortly. Radu -Original Message- From: Weiler, Frank (KBV) [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 27, 2005 1:05 AM To: user@xmlbeans.apache.org Subject: NullPointerException during schema compilation Hello, XMLBeans Users ! Trying to compile my XML-Schema with the V2 Release, I've got the following error message: [java] java.lang.NullPointerException [java] at org.apache.xmlbeans.impl.schema.StscChecker.mapAndSum(StscChecker.java:624) [java] at org.apache.xmlbeans.impl.schema.StscChecker.isParticleValidRestriction(StscChecker.java:510) [java] at org.apache.xmlbeans.impl.schema.StscChecker.checkRestriction(StscChecker.java:379) [java] at org.apache.xmlbeans.impl.schema.StscChecker.checkAll(StscChecker.java:64) [java] at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compileImpl(SchemaTypeSystemCompiler.java:310) [java] at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:181) [java] at org.apache.xmlbeans.impl.tool.SchemaCompiler.loadTypeSystem(SchemaCompiler.java:947) [java] at org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java:1067) [java] at org.apache.xmlbeans.impl.tool.SchemaCompiler.main(SchemaCompiler.java:367) [java] Exception in thread main [java] Java Result: 1 The Schema is valid itself (I think so), but where to look to resolve the error ? Regards, Frank - 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: Problem compiling a set of schemas with xmlbeans 2.0.0
I have tried to compile the Schemas from that location and I got no errors. Try using the same command-line that I have used to eliminate differences in environments as much as possible. scomp -dl -mx 512M opengis/ (directory where you've downloaded the Schemas) Now it looks to me like your compiler is picking up more files than it should... Radu -Original Message- From: Johannes Echterhoff [mailto:[EMAIL PROTECTED] Sent: Saturday, July 30, 2005 10:02 AM To: user@xmlbeans.apache.org Subject: Re: Problem compiling a set of schemas with xmlbeans 2.0.0 Hi. The schemas that seem to cause the problem can be found at http://schemas.opengis.net/gml/3.1.1/ The element DirectPositionListType can be found in base/geometryBasic0d1d.xsd and e.g. BSplineType can be found in base/geometryPrimitives.xsd Regards, Johannes Echterhoff - 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: Keeping track of where element was in XML
This is exactly what XmlCursors are for! Say you have a car object and an engine object. You can do switch (car.newCursor().comparePosition(engine.newCursor())) { case -1: // car comes before engine case 1: // car comes after engine } Or, you can do: XmlCursor c = parent.newCursor().toFirstChild(); SchemaType t = c.getObject().schemaType(); if (t == Car.type) { } // the first element was a car else if (t == Engine.type) { } the first element was an engine else ... (take a look at the OrderMatters sample from XmlBeans site) And finally, all the Java classes that we generate mirror the class derivation hierarchy from your Schema which most of times is the most convenient way of using polymorphism, because it matches the intent of the Schema author and matches valid input documents. Also, all Java classes extend XmlObject if you want to deal with it this way instead. And we have a feature that allows you to add functionality to generated XmlBeans classes, see the Extensions feature in the news section of the site. So you do have a number of options, and judging by what your needs are, it sounds like XmlBeans would fit the bill nicely. Radu -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Saturday, July 30, 2005 6:37 PM To: user@xmlbeans.apache.org Subject: Keeping track of where element was in XML Hi, Fir me - its important to know the order that the elements were seen in the XML document. For example I have a schema which allows cars, wheels, engines in any order, inside a car object (say). Firstly I need a way of telling XMLBeans tht all generated java code should extend a particualr object so i can deal with the objects poplymorphically. Second and more importantly I need a way of knowing that a wheel was the first element in the xml document, and that the car was the second. This is not availabloe. Please help - Email sent from http://www.ntlworld.com/ Virus-checked using McAfee(R) Software Visit www.ntlworld.com/security for more information - 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: Problem compiling a set of schemas with xmlbeans 2.0.0
Yeah, so it does seem that adding -javasource 1.5 when compiling this particular Schema causes problems, which is an unfortunate bug :-(. But the good news is that there is a simple workaround (not generating 1.5-specific classes) which you can use while we are fixing the problem. In answer to your PS question, indeed, the default value is 1.4, which is the Java version XmlBeans is compiled with, but we should have made it explicit. The meaning of 'the source-files are compatible with Java 1.5' is that the source files use Java 1.5-specific features, so you need a compiler = 1.5 on the path (this also needs clarification in the tool-doc). Radu -Original Message- From: Johannes Echterhoff [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 03, 2005 5:26 AM To: user@xmlbeans.apache.org Subject: Re: Problem compiling a set of schemas with xmlbeans 2.0.0 Well, i successfully compiled my schemas using the following command (hooray): scomp -d classes -src sources -out spsXMLBindings.jar -mx 512M -catalog CustomCatalog.xml pathToMySchemasThatImportGML But when i try the following command i get the same errors again: scomp -d classes -src sources -out spsXMLBindings.jar -javasource 1.5 -mx 512M -catalog CustomCatalog.xml pathToMySchemasThatImportGML So the problem seems to occur when i use the option '-javasource 1.5'. Now another question could be whether the problem is a result of compiling the schemas that import the GML-schemas or if the GML-schemas cause the error. So i tried to compile the GML-schemas as you did: scomp -d classes -src sources -out gml311.jar -dl -mx 512M gml311/base (this works) scomp -d classes -src sources -out gml311.jar -dl -javasource 1.5 -mx 512M gml311/base (this does not work!) My setup: XMLBEANS_HOME is set to C:\Daten\xmlbeans-2.0.0 JAVA_HOME is set to: C:\Programme\Java\jdk1.5.0_01 CLASSPATH ist set to: C:\Daten\xmlbeans-2.0.0\lib\xbean.jar;C:\Daten\SPS_x2j_test\CatalogManager.properties I suppose my setup is ok. Any suggestions on this? Johannes Echterhoff P.S.: what does the -javasource-tag really mean? The tool-docu says: 'Generate Java source compatible for the specified Java version (1.4 or 1.5).' And the homepage says: 'V2 will provide the option to take advantage of JDK 1.5 Generics and/or Enumerations in XMLBeans generated classes.' Ok, this might be as silly question, but nevertheless: if i compile my schemas without using the -javasource-tag then does this mean i compile for version 1.4 or 1.5? What is the default option and what is the meaning of 'the source-files are compatible with Java 1.5'? - 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: (Date to Date) instead of (Date to String)
Hm, there is not enough information in your message to tell. If you had xs:element name=DATE_CREATION type=xs:date minOccurs=0/ then I would have been surprised to see a String return type. But since your type is Date which looks like a user-defined type, then it's possible that it maps to String. Radu -Original Message- From: Celinio Fernandes [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 03, 2005 6:27 AM To: user@xmlbeans.apache.org Subject: (Date to Date) instead of (Date to String) Hi, Maybe I am missing something, please tell me if this is the case. I generated the javabean classes using the scomp command, under DOS. One thing that I do not understand is that it seems it has generated wrong return types for the getters / setters for the tags of type Date. For instance: xs:element name=DATE_CREATION type=Date minOccurs=0/ has generated a getter that returns a String, instead of a date : String noNamespace.MPGPVCDocument.MPGPVC.EPJ.IOS.IO.getDATECREATION() Does anyone have any information regarding this ? Thanks - 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 ant task
Given that XmlBeans does not compile XMLInputStream.java in any of our build scripts and we have the .class file checked in directly (and also that I am using jdk1.4.2_03 without problems as I am sure others are too), I would say what's probably happening is that you guys have some other version of jsr173_api.jar on your classpath from a different source than what's shipped with XmlBeans. Regarding your second problem, maarten, having to use the classpath attribute every time you call the ant task, I would agree that is a bug and in fact I do seem to remember that this didn't use to be the case, so someone needs to take a closer look and see what is happening there. Oh, and we do use the XmlBeans ant task in our testing framework (testbuild.xml) and I am sure others are using it too. But it so happens that the classpath attribute is already set to a pretty comprehensive classpath, so this slipped unnoticed. Radu -Original Message- From: Lawrence Jones Sent: Tuesday, August 16, 2005 10:07 AM To: user@xmlbeans.apache.org Subject: RE: xmlbeans ant task Hi all I'm going to submit a patch that will update the documentation to include jsr173_api.jar in the classpath. The UnsupportedClassVersionError is odd - the only circumstance when you would get that appears to me to be if you had already compiled org/apache/xmlbeans/xml/stream/XMLInputStream.java using a jdk 1.5 javac and then try to recompile some other part of the source code using jdk 1.4.x which depends on XMLInputStream and ends up picking up the org.apache.xmlbeans.xml.stream.XMLInputStream.class file which you compiled with jdk 1.5. Then the class file could have a later format which the 1.4.x javac doesn't understand. It could be an error in the 'clean' target not deleting org.apache.xmlbeans.xml.stream.XMLInputStream.class before starting the compile. If one of you could send me a repro containing the exact steps you took (you can send this to me offline if you like) then I'll raise a JIRA for it and we can get it looked at. Cheers, Lawrence -Original Message- From: Oakes, Jeff (HTSC, IT) [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 16, 2005 9:42 AM To: 'user@xmlbeans.apache.org' Subject: RE: xmlbeans ant task I had the same experience with j2sdk1.4.2_06 later, Jeff -Original Message- From: maarten [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 10, 2005 5:06 AM To: user@xmlbeans.apache.org Subject: Re: xmlbeans ant task maarten wrote: Hi, Using xmlbeans-1.0.4 I can compile and use my schema with jdk1.5.0_03 but when I try compiling with j2sdk1.4.2_08 I get the following error: java.lang.UnsupportedClassVersionError: org/apache/xmlbeans/xml/stream/XMLInputStream (Unsupported major.minor version 49.0) Using xmlbeans-2.0.0 I can compile with both jdk1.5.0_03 and j2sdk1.4.2_08 BUT i had to add jsr173_api.jar to the classpath of both the taskdef and the xmlbean task: I guess the examples on http://xmlbeans.apache.org/docs/2.0.0/guide/antXmlbean.html are incomplete ? This is my build.xml : project name=vapschema basedir=. default=vapschema target name=init mkdir dir=gen/xbeans/ mkdir dir=build/xbeans/classes/ tstamp/ /target target name=vapschema depends=init description=Compiles vap.xsd with xmlbeans taskdef name=xmlbean classname=org.apache.xmlbeans.impl.tool.XMLBean classpath=./jars/xbean-2.0.0.jar:./jars/jsr173_api.jar/ xmlbean schema=./src/be/sunrise/vap/vap.xsd classgendir=build/xbeans/classes srcgendir=gen/xbeans destfile=build/vap-schema.jar classpath=./jars/xbean-2.0.0.jar:./jars/jsr173_api.jar/ /target /project Maarten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Is nobody else using the ant task ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * PRIVILEGED AND CONFIDENTIAL: This communication, including attachments, is for the exclusive use of addressee and may contain proprietary, confidential and/or privileged information. If you are not the intended recipient, any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this communication and destroy all copies. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To
RE: xmlbeans ant task
Sorry, scratch the first part of my comment, I was under the impression that you were talking about XMLStreamReader, but XMLInputStream is different, so jsr173_api.jar has no role in this whatsoever. Radu -Original Message- From: Radu Preotiuc-Pietro Sent: Tuesday, August 16, 2005 1:54 PM To: user@xmlbeans.apache.org Subject: RE: xmlbeans ant task Given that XmlBeans does not compile XMLInputStream.java in any of our build scripts and we have the .class file checked in directly (and also that I am using jdk1.4.2_03 without problems as I am sure others are too), I would say what's probably happening is that you guys have some other version of jsr173_api.jar on your classpath from a different source than what's shipped with XmlBeans. Regarding your second problem, maarten, having to use the classpath attribute every time you call the ant task, I would agree that is a bug and in fact I do seem to remember that this didn't use to be the case, so someone needs to take a closer look and see what is happening there. Oh, and we do use the XmlBeans ant task in our testing framework (testbuild.xml) and I am sure others are using it too. But it so happens that the classpath attribute is already set to a pretty comprehensive classpath, so this slipped unnoticed. Radu -Original Message- From: Lawrence Jones Sent: Tuesday, August 16, 2005 10:07 AM To: user@xmlbeans.apache.org Subject: RE: xmlbeans ant task Hi all I'm going to submit a patch that will update the documentation to include jsr173_api.jar in the classpath. The UnsupportedClassVersionError is odd - the only circumstance when you would get that appears to me to be if you had already compiled org/apache/xmlbeans/xml/stream/XMLInputStream.java using a jdk 1.5 javac and then try to recompile some other part of the source code using jdk 1.4.x which depends on XMLInputStream and ends up picking up the org.apache.xmlbeans.xml.stream.XMLInputStream.class file which you compiled with jdk 1.5. Then the class file could have a later format which the 1.4.x javac doesn't understand. It could be an error in the 'clean' target not deleting org.apache.xmlbeans.xml.stream.XMLInputStream.class before starting the compile. If one of you could send me a repro containing the exact steps you took (you can send this to me offline if you like) then I'll raise a JIRA for it and we can get it looked at. Cheers, Lawrence -Original Message- From: Oakes, Jeff (HTSC, IT) [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 16, 2005 9:42 AM To: 'user@xmlbeans.apache.org' Subject: RE: xmlbeans ant task I had the same experience with j2sdk1.4.2_06 later, Jeff -Original Message- From: maarten [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 10, 2005 5:06 AM To: user@xmlbeans.apache.org Subject: Re: xmlbeans ant task maarten wrote: Hi, Using xmlbeans-1.0.4 I can compile and use my schema with jdk1.5.0_03 but when I try compiling with j2sdk1.4.2_08 I get the following error: java.lang.UnsupportedClassVersionError: org/apache/xmlbeans/xml/stream/XMLInputStream (Unsupported major.minor version 49.0) Using xmlbeans-2.0.0 I can compile with both jdk1.5.0_03 and j2sdk1.4.2_08 BUT i had to add jsr173_api.jar to the classpath of both the taskdef and the xmlbean task: I guess the examples on http://xmlbeans.apache.org/docs/2.0.0/guide/antXmlbean.html are incomplete ? This is my build.xml : project name=vapschema basedir=. default=vapschema target name=init mkdir dir=gen/xbeans/ mkdir dir=build/xbeans/classes/ tstamp/ /target target name=vapschema depends=init description=Compiles vap.xsd with xmlbeans taskdef name=xmlbean classname=org.apache.xmlbeans.impl.tool.XMLBean classpath=./jars/xbean-2.0.0.jar:./jars/jsr173_api.jar/ xmlbean schema=./src/be/sunrise/vap/vap.xsd classgendir=build/xbeans/classes srcgendir=gen/xbeans destfile=build/vap-schema.jar classpath=./jars/xbean-2.0.0.jar:./jars/jsr173_api.jar/ /target /project Maarten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Is nobody else using the ant task ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * PRIVILEGED AND CONFIDENTIAL: This communication, including attachments, is for the exclusive use of addressee and may contain proprietary, confidential and/or privileged information. If you are not the intended recipient, any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete
RE: XmlBeans V2 and Piccolo
Title: Message Yes, it does mean that. We repackage piccolo (so you can use a newer version if youd like) and then include it as part of xbean.jar. You do not need to do anything to get the advantages of Piccolo. Thanks, Radu -Original Message- From: Steve Davis [mailto:[EMAIL PROTECTED] Sent: Thursday, August 11, 2005 10:01 AM To: user@xmlbeans.apache.org Subject: XmlBeans V2 and Piccolo The News page statesXML parsing is now by default performed by Piccolo. Does this mean Piccolo is somehow included in the XML Binary release? If so, which JAR file? Or do I need to install Piccolo separately?
RE: XmlBeans V2 and Piccolo
Title: Message No, its not, but XmlBeans is (by default),so if you stick within XmlBeans you should have no problems. Radu -Original Message- From: Steve Davis [mailto:[EMAIL PROTECTED] Sent: Friday, August 19, 2005 1:05 PM To: user@xmlbeans.apache.org Subject: RE: XmlBeans V2 and Piccolo Excellent. One more question. Is Piccolo thread-safe ? Thanks, Steve -Original Message- From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] Sent: Friday, August 19, 2005 3:56 PM To: user@xmlbeans.apache.org Subject: RE: XmlBeans V2 and Piccolo Yes, it does mean that. We repackage piccolo (so you can use a newer version if youd like) and then include it as part of xbean.jar. You do not need to do anything to get the advantages of Piccolo. Thanks, Radu -Original Message- From: Steve Davis [mailto:[EMAIL PROTECTED] Sent: Thursday, August 11, 2005 10:01 AM To: user@xmlbeans.apache.org Subject: XmlBeans V2 and Piccolo The News page statesXML parsing is now by default performed by Piccolo. Does this mean Piccolo is somehow included in the XML Binary release? If so, which JAR file? Or do I need to install Piccolo separately?
RE: ordered collection implementation for groups of arbitrary cardinality???
XmlBeans supports this scenario very well. You would probably want to check out this sample, it seems relevant to what you are trying to do: http://xmlbeans.apache.org/samples/OrderMatters.html Radu -Original Message- From: Markus Pilzecker [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 04, 2005 1:04 PM To: user@xmlbeans.apache.org Subject: ordered collection implementation for groups of arbitrary cardinality??? Hello *, I'm just trying to deserialise BPEL files with xmlbeans. The problem, I stumbled over is, that I do not find an adequately simple possibility to get an order-preserving access to elements, which are specified as group ref=bpws:activity maxOccurs=unbounded/ in the XML Schema. bpws:activity is specified as the list of alternatives group name=activity choice element name=empty type=bpws:tEmpty/ element name=invoke type=bpws:tInvoke/ element name=receive type=bpws:tReceive/ element name=reply type=bpws:tReply/ element name=assign type=bpws:tAssign/ element name=wait type=bpws:tWait/ element name=throw type=bpws:tThrow/ element name=terminate type=bpws:tTerminate/ element name=flow type=bpws:tFlow/ element name=switch type=bpws:tSwitch/ element name=while type=bpws:tWhile/ element name=sequence type=bpws:tSequence/ element name=pick type=bpws:tPick/ element name=scope type=bpws:tScope/ /choice /group . Unfortunately, xmlbeans does not seem to give me a container, where all elements occur in parse order. Instead, I get a set of arrays like TInvoke[] getInvokeArray() TReceive[] getReceiveArray() and so on. In itself, they seem to be parse-ordered. Does anybody know of a proper work-around? One idea could be to apply a semantically equivalent transformation on the bpel.xsd, which would motivate the xmlbeans parser generator to generate a collection, spanning all alternatives at once. Or is there any other information about the parse-ordering of the elements, which could eventually be evaluated? No global counter or a timestamp, fine-grained enough to be unique? Or does anybody see a good method to inject this information, if not there? Any ideas? Thanks for listening to my bubbles. Bye, Markus PS: bpel.xsd is to be found in http://schemas.xmlsoap.org/ws/2003/03/business-process/ - 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: Re-Generating schema from the generated code
Just wanted to point out the XmlObject.documentProperties().setSourceName() method, which allows you to set the correct xsd name even when you havent parsed the xsd with XmlBeans. Radu From: Eran Chinthaka [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 04, 2005 10:30 PM To: Lawrence Jones Cc: user@xmlbeans.apache.org Subject: Re: Re-Generating schema from the generated code Hi Lawrence, Thanks for the reply. I can get theSchemaTypeSystem. But I don't want to traverse in that. I just need to generate the schema, preferably in to a String and want to add that as the schema in the WSDL. So how can I get the schema as a String. FYI : We generate the code not providing schema as a file, but as a DOM Node. And we are calling XMLBeans API programatically. Thanks for your help in this. Chinthaka Lawrence Jones wrote: There is also programmatic access to an object model representing theschema. From any generated bean, say a class called Abc, you can callAbc.type.getTypeSystem()This returns a SchemaTypeSystem on which you can execute all sorts ofmethods concerning the contents of the schema.Cheers,Lawrence -Original Message-From: Cezar AndreiSent: Tuesday, October 04, 2005 10:36 AMTo: user@xmlbeans.apache.org; [EMAIL PROTECTED]Subject: RE: Re-Generating schema from the generated codeScomp saves the original schema files inside the generated jar, and you can get to it in the following way:InputStream is = XMLParsers.class.getClassLoader().getResourceAsStream(schemaorg_apache_ xmlbeans/src/ + GeneratedXMLBean.type.getSourceName());Cezar -Original Message-From: Eran Chinthaka [mailto:[EMAIL PROTECTED]]Sent: Tuesday, October 04, 2005 11:33 AMTo: user@xmlbeans.apache.orgSubject: Re-Generating schema from the generated codeHi,I'm from Apache Axis2 team. I need a help in generating schema usingXMLBeans.My scenario is like this. I have bunch of classes created using a given xml schema, by XMLBeans. But at some time, I do not have the schema file which was used to generate the code, but I have all the classesgenerated using that schema by xml beans. Now I want to generate/derive the schema from the classes I have.I load the generated classes using a proper class loader and I couldfind all the generated codes which are global elements. How can Irecreate the schema which was used to generate this code. I don't have the initial schema file by now. I want to derive it using the classes I have.Any help in this is very much appreciated.(Sorry If I'm repeating this question on this list. I searched in the archives, but didn't find something similar to this.)Thanks,Chinthaka - 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: Problems with XMLBeans validation
Title: Message I know it's been over a month since this was asked, but today I finally took some time and reviewed the rules for keyref validation (there's also been a recent thread on xmlschema-dev about this very issue). It turns out that in a non-intuitive way, XMLSchema is esentially prohibitingkeyrefs from resolving to keys that are duplicated within the scope of the context element for the keyref. Note that the keys themselves are ok, since their scopes are disjoint, it's only when they are referenced by a keyref that the problem occurs. So basically, in this instance, Xerces got confused and XmlBeans was right. Whew! In case this is still useful, IMO keyrefs should be declared on the same elementas the corresponding key to ensure intuitive behavior. Thanks, Radu -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 07, 2005 9:46 PMTo: user@xmlbeans.apache.orgSubject: Problems with XMLBeans validationHi, The attached schema and matching xml sample show apparent problems with XMLBeans validation. The xml sample validates ok with the latest xerces, as well, the schema seem ok to me. Please note that the schema may seem a bit odd, with apparently redundant elements, it is the way it is for historical reasons, what is important is that it does appear to be a valid schema in spite of XMLBeans saying that the matching xml sample is invalid. Can anyone see a problem with my key definitions, or is there indeed a problem with XMLBeans validation? Thanks, Lawrence **IMPORTANT: This e-mail is intended for the use of the addressee and may contain information that is confidential, commercially valuable or subject to legal or parliamentary privilege. If you are not the intended recipient you are notified that any review, re-transmission, disclosure, use or dissemination of this communication is strictly prohibited by several Commonwealth Acts of Parliament. If you have received this communication in error please notify the sender immediately and delete all copies of this transmission together with any attachments.** BEAWorld 2005: coming to a city near you. Everything you need for SOA and enterprise infrastructure success. Register now at http://www.bea.com/4beaworld London 11-12 Oct| Paris13-14 Oct| Prague18-19 Oct |Tokyo 25-26 Oct| Beijing 7-8 Dec
RE: Serialization (again)
Hm, not sure why that happened, I would have expected it to work. Radu -Original Message- From: David Jencks [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 12, 2005 5:17 PM To: user@xmlbeans.apache.org Subject: Re: Serialization (again) On Oct 12, 2005, at 3:53 PM, Radu Preotiuc-Pietro wrote: I think the definitive answer is: - generated Java classes are serializable and the serialization format is XML, so that when you deserialize it you can go to parent, to DOM etc, and the behavior will be exactly the same as on the original instance (except for classoading-related things, of course) I had some problems serializing generated java classes. IIRC I got a DOM node from an xmlbeans object and later parsed it back into xmlbeans. The resulting XmlObject subclass instances were not serializable; they appeared to retain references to the non-serializable xmlbeans DOM nodes. Is this expected to work? thanks david jencks - the DOM implementation is currently not serializable, I don't really know what the reason for that is. Radu -Original Message- From: Jason Vasquez [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 11, 2005 11:27 AM To: user@xmlbeans.apache.org Subject: Serialization (again) Hi, I see a few posts on the list concerning XMLBeans Serialization, but nothing seems to answer the question definitively: Is Serialization officially supported? My particular case is this: I have my own Serializable classes which contain member variables that are DOM Objects obtained from XMLBeans objects. The Document implementation from XMLBeans is not serializable, so I am unable to serialize my class. My thought at this point is that I will need to muck about with writeObject/readObject on my own class to serialize the DOM Document to plain XML Strings and back. (This is all with 2.0.0, by the way) Any ideas? -jason - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: select a document type to parse my files.
Noah, It looks like you already found a way to do this by looking at the name of the document tag. And in fact, this is what XmlBeans is doing too when parsing using the generic parse method. So if you don't know beforehand what kind of document you are going to receive, do the following: XmlObject doc = XmlObject.Factory.parse(message); SchemaType type = doc.schemaType(); // the type of the document, based on the name of the root element and the xsi:type attribute if present if (type == MyDoc1Document.type) { MyDoc1Document myDoc1 = (MyDoc1Document) doc; // Specific processing } // Other possibilities Radu -Original Message- From: Noah Yan [mailto:[EMAIL PROTECTED] Sent: Thursday, October 13, 2005 10:12 AM To: user@xmlbeans.apache.org Subject: select a document type to parse my files. I am just starting using xmlbeans to read some xml file. I generated the .jar for my schema, and now can use the class to read the provided xml file. I have another problem, hope some of your could give me some suggestions. My schema defines several document type for user to use. In normal use, the users provided multiple xml docs for the different types of the schema. My program should pick an xml file, match it to a specific xml schema type and parse it using the cooresponding XMLBeans class. How XMLbean can tell what schema type of an xml file is associated so that the proper docType class can be used to parse the xml file? I know I can do this by use a general XML parse to find the name of the root document, and then call the cooresponding XMLBeans generated class. But I want to check whether XMLbeans have some other ways to do this. Thanks very much Noah - 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: Changing enumeration names
Unfortunately, the level of customization allowed by .xsdconfig is currently not finely grained enough to make it possible to rename enumeration fields, so I am afraid you are stuck using A, B and C. I wouldn't go to all the trouble of changing the generated code if I were you, I would just add a comment when using it. Radu -Original Message- From: David Smalley [mailto:[EMAIL PROTECTED] Sent: Thursday, October 13, 2005 11:08 AM To: XMLBeans Subject: Changing enumeration names I have a schema which defines the following simple type: xsd:simpleType name=DestinationType xsd:restriction base=xsd:normalizedString xsd:enumeration value=A/ xsd:enumeration value=B/ xsd:enumeration value=C/ /xsd:restriction /xsd:simpleType This generates the appropriate java class DestinationType with enum fields A, B, and C. The point is, these values are correct, because the document requires their use (per the schema), but they're meanings are actually: A - US Domestic B - US Territories C - Foreign I would rather have enum fields in the generated type like US_Domestic, US_Territories, and Foreign; in other words, defined as: static final Enum US_Domestic = Enum.forString(A); static final Enum US_Territories = Enum.forString(B); static final Enum Foreign = Enum.forString(C); I have looked in the FAQ and searched the mailing list. The FAQ says the xb:qname element in an xsdconfig file can be used to map elements and attributes as well as types, but I haven't figured out how to do it or found any examples. Is there any way to force scomp to rename enumerations like this, or am I stuck editing the generated code and then re-compiling? Thanks in advance for any insights. Dave - 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: Persisting XMLBeans to DB
Title: Message Well, you _can_ extend the XmlBeans objects without containment, using extension interfaces as described in http://wiki.apache.org/xmlbeans/ExtensionInterfacesFeature, but that won't give you the ability to add new constructors or static methods, though you could add something like "writeObject". Oh, and one approach thatI think would give good results is use the database engine to persist the xmlBeans objects as XML. Radu -Original Message-From: Shaun Farrugia [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 18, 2005 12:01 PMTo: user@xmlbeans.apache.orgCc: user@xmlbeans.apache.orgSubject: RE: Persisting XMLBeans to DB Yeah me neither. I'd like to be able to extend those classes to add different methods (for persistance) but it doesn't look like extending these things would work. I'd have to contain the xmlbean in another class, expose all the getters and setters in the new class and then add my methods to the new class in order for it to be usable. Can someone let me know if there's another way to do this? Right now XMLBeans is really good at being a VO and unmarshalling to and from XML but I have no way to put business operations on these objects without using containment. I'd like to extend or implement different interfaces on these guys w/o containment.Shaun.Farrugia. . [EMAIL PROTECTED]perm. desk.734.887.2148. . .cell.313.363.5006aim.dier0b0t . . ."Radu Preotiuc-Pietro" [EMAIL PROTECTED] "Radu Preotiuc-Pietro" [EMAIL PROTECTED] 10/18/2005 02:46 PM Please respond touser@xmlbeans.apache.org To user@xmlbeans.apache.org cc Subject RE: Persisting XMLBeans to DB I know of the difficulty of using hibernate with XmlBeans. I remember that someone researched some option that hibernate had to use factories instead of default constructors, but I don't know what the answer was.You can check out our Velocity sample http://xmlbeans.apache.org/samples/vxsdb.html which creates a SQL data model from an xsd Schema.Other than that, I would be interested too if anyone has found anything interesting in this area.Oh, about extending the implementation classes: how would tell XmlBeans to create one of your implementation classes instead of the ones that it knows of? I don't think that could work.Radu -Original Message-From: Shaun Farrugia [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 13, 2005 11:34 AMTo: XMLBeansSubject: Persisting XMLBeans to DB Looks like my original message was null - sorry about that everyone.I'm looking to implement some sort of OR layer using the generated XMLBeans as our VO objects.. What layer are you all using? I'm seeing that hibernate isn't necesarrily usable because of the XMLbean lack of default constructor. Would extending the implementation and adding a default constructor and then persisting the extended implementation be a decent option? I'd hate to talk to implementation classes but i see no other optionShaun.Farrugia. . [EMAIL PROTECTED]perm. desk.734.887.2148. . .cell.313.363.5006aim.dier0b0t . . .
RE: Set vs Add methods
Title: Message You are right, I couldn't find it either. I meant to do an update to the information that's on the website currently;haven't gotten to it yet, but it will be added. Thanks, Radu -Original Message-From: rabidgremlin [mailto:[EMAIL PROTECTED] Sent: Monday, October 17, 2005 6:28 PMTo: user@xmlbeans.apache.orgSubject: Re: Set vs Add methodsAh, that makes sense.Was that behavior documented anywhere ? I did not see it :)Jonathan On 10/18/05, David Jencks [EMAIL PROTECTED] wrote: In order not to have side effects on its argument, add(FooType foo)methods add a copy of foo rather than the foo you supply.Subsequentmodifications of foo will then have no effect on the copy.Theparticular change would be changing the parent xml object.I find using add much more convenient.thanksdavid jencks
RE: catalog-support in xmlbean-ant-task
Have you tried the catalog attribute on the ant task? I haven't tried it myself, but from looking at the code, looks like it's what you want (of course, we also have this option on the scomp script and I have successfully used it in that context). Radu -Original Message- From: Johannes Echterhoff [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 18, 2005 8:36 AM To: user@xmlbeans.apache.org Subject: catalog-support in xmlbean-ant-task Hi. Is it possible to define a catalog for use in a xmlbean-ant-task? If yes, how would a sample build-file (or part of it) look like? If no - why not? :-) Regards, Johannes Echterhoff - 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: Ant task generating bad code
Title: Message Those kind of things are very hard to diagnose, especially over e-mail. Since scomp works correctly, I have to assume that this is ant's doing, maybe some dependency checking causingsome classes not to get rebuilt? Radu -Original Message-From: rabidgremlin [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 18, 2005 3:26 PMTo: user@xmlbeans.apache.orgSubject: Ant task generating bad codeHi All,I have an ant build script which generates my XmlBeans .jar file. Whilst using this .jar I kept tripping up ClassCastExceptions when calling the newInstance() or methods on one of my objects.However if I run scomp to generate my .jar file then the ClassCastExceptions go away.For the moment I have just launched the scomp (SchemaCompiler) class using a java task in my ant script but I am curious as why the xmlbeans task does not work.Jonathan
RE: character sets
Also, Christian, could you try using ISO8859_1 rather than ISO-8859-1 for the encoding string in your code? XmlBeans is using the Java names for the encodings, which seemed more consistent than using the IANA names (so you can get the encoding from other Java code and set it directly etc). Of course, the generated documents always use the IANA names. Let us know how that works, Radu PS Regarding the use of setSaveSubstituteCharacters(), as the name indicates, this is a save-time XmlOption, so it will not have any effect when passed as argument to newInstance(), but when passed to xmlText() or other similar methods. The reason for this is that the infoset doesn't make any difference between a character being represented as entity or as literal value. -Original Message- From: Steve Davis [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 19, 2005 7:12 AM To: user@xmlbeans.apache.org Subject: RE: character sets I am not an expert in this area, but the following code may help: /** * Gets the formatted character-encoded string representation of an XmlTokenSource. * @param xmlTokenSource - typically an XmlBean object * @param encoding - the desired character encoding * @return String ready for transmission * @throws Exception */ public static String getEncodedXmlText(XmlTokenSource xmlTokenSource, String encoding) throws Exception { // Setup various properties of the XML instance document xmlTokenSource.documentProperties().setEncoding(encoding); xmlTokenSource.documentProperties().setVersion(1.0); XmlOptions xmlOptions = new XmlOptions(); xmlOptions.setCharacterEncoding(encoding); xmlOptions.setUseDefaultNamespace(); xmlOptions.setSaveAggressiveNamespaces(); // Format to a buffer and read it back into a string ByteArrayOutputStream bos = new ByteArrayOutputStream(); xmlTokenSource.save(bos, xmlOptions); return bos.toString(); } -Original Message- From: Wendell, Christian [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 19, 2005 4:31 AM To: user@xmlbeans.apache.org Cc: Kekkonen, Jari Subject: character sets Hi We have a Struts/tomcat solution, the jsp files using the 8859-1 character set, on top of an Oracle db, which uses UTF-8/Unicode. Of course, in Scandinavia, we have Scandinavian characters. The problem is putting stuff from the html input boxes into the db, and reading stuff from the db to the page, so that the umlaut chars work. The bean models we use are generated from schemas with XMLBean tools. In the action that reads stuff from the page and sends it to the db, we try to put the encoding into the XML header, but fail: XmlOptions opts= new XmlOptions(); /* we'd also like to encode '', using the newest devel version, which also has no effect: XmlOptionCharEscapeMap escapes= new XmlOptionCharEscapeMap(); escapes.addMapping('', XmlOptionCharEscapeMap.PREDEF_ENTITY); opts.setSaveSubstituteCharacters(escapes); */ opts.setCharacterEncoding(ISO-8859-1); Note addedNote= Note.Factory.newInstance(opts); //The bean addedNote.setNote(text); //text contains umlaut characters from the jsp Logging the xml structure, we can't see any difference in the generated xml whether we do setCharacterEncoding() or not. Is our strategy right but implementation wrong, or should we do this somehow else? Christian - 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: Remove namespace prefix from XmlBean
Note that the two documents are _different_, XmlBeans will output the one that you created. Try using XmlOptions.setUseDefaultNamespace() when you print out the document and see how that looks. Radu -Original Message- From: R. C. Hill [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 19, 2005 12:41 PM To: user@xmlbeans.apache.org Subject: Remove namespace prefix from XmlBean Does anyone know how to stript out the namespace prefixes when saving the output of an XmlBean. I'm using the saver to save to file, but I would like it to so without the name space prefix. Can this be done through the XmlOptions class? If so, how? Right now the output of the XmlBean looks something like: del:deliveries_report xmlns:del=http://www.something.com/metrics/report/deliveries; del:scheduled_deliveries del:month2005-06/del:month del:product del:nameSomeName/del:name del:uploads0/del:uploads del:files0/del:files del:megabytes0.0/del:megabytes /del:product /del:scheduled_deliveries /del:deliveries_report I would like it to look like: deliveries_report scheduled_deliveries month2005-06/month product nameSomeName/name uploads0/uploads files0/files megabytes0.0/megabytes /product /scheduled_deliveries /deliveries_report Thanks, - RH _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - 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: empty Attribute types cause error
Title: Message Basically, in your case, we are dealing with an invalid doc, since "" (empty string) is not in the value space of the "float" type. That being said, XmlBeans makes efforts to give you access to your data even for invalid documents. But this case, I think, falls under the category of things that are just too confusing for XmlBeans to let pass by - most people, Ibelieve,would find raising an error and pointing out the discrepancymore helpful than, say, converting it to 0 silently. Radu -Original Message-From: Shaun Farrugia [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 19, 2005 1:41 PMTo: user@xmlbeans.apache.orgSubject: empty Attribute types cause error I'm getting a ValueOutOfRange error when i call myObj.getPrice() . myObj is an interface created by XMLBeans based on a schema. getPrice should return a float. the schema defines Price as an attribute with a float type. The instance of the schema has price="". When I call .getPrice i get the exception thrown. how do i allow "" for attribute values?Shaun.Farrugia. . [EMAIL PROTECTED]perm. desk.734.887.2148. . .cell.313.363.5006aim.dier0b0t . . .
RE: CDATA sections
No, but the good news is that there is patch that was submitted to the list which will allow you to do it. Strangely enough, I can't point you to it, because that specific e-mail is missing from all our mailing archives. Here's a copy. The patch has two parts, one dealing with entities (which is now part of XmlBeans) and one dealing with CDATA sections, which was deemed a little too difficult to use and was not included. But it worked. So if you really need it, you're free to experiment. Let me know if attaching the original email with the attachment inside worked. Radu PS HTML makes use of a lot of '' and '', make sure first that the default algorithm doesn't do a fair job for you -Original Message- From: Adam Walsh [mailto:[EMAIL PROTECTED] Sent: Friday, October 21, 2005 12:52 AM To: user@xmlbeans.apache.org Subject: CDATA sections Hi all, According to this old message on the list [1] when embedding HTML as a textual value of an XML element sometimes xmlbeans will use a CDATA section but other times it will just escape the characters that it finds objectionable. Is there any way that I can force it to always use a CDATA section in xmlbeans 2.0? Thanks in advance Adam [1] http://nagoya.apache.org/eyebrowse/ReadMsg?listId=277msgNo=662 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ---BeginMessage--- I have attached a diff of changes in the Saver that will enable 2 things. First is the escaping of more characters than only and . For each character you want escaped you add an entry into a map that specifies which character is to be escaped and into what base (decimal or hex) it should be encoded. (no named escapes) Also the changes allow the threshold between multiple escaped characters and a CDATA section to be altered. Each of the parameters -- length of string, number of characters, and percentage of characters would be configurable. Since this is my first submission, please advise me as to what to do next. Thank you in advance. Roger -- [EMAIL PROTECTED] escchar.patch Description: escchar.patch ---End Message--- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Vote] Release of XmlBeans 2.1.0
Please vote on the release of XmlBeans 2.1.0 as it currently exists on http://xmlbeans.apache.org/dist as xmlbeans-2.1.0-rc1*. If the vote turns out positive, these archives are going to become the final release and be renamed to xmlbeans-2.1.0*, then signed and uploaded to the download servers. Everyone is welcome to make their opinion heard, however the only binding votes are those of commiters and PMC members. In order for the vote to pass, we need a majority approval and at least three binding +1 votes. This vote will end Tuesday, Nov 15th, 2005 at 5:00PM PST, so make sure to cast your vote by then as follows: [ ] +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) +1 Radu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: pretty print and preserving whitespace inside element
And probably trashes other valid strings by inserting newlines where they should not be :-) I'd have to look in more detail, but I believe your problem is that you are using pretty print, thereby giving XmlBeans some leeway in changing your document. I would be curious if the problem persists when you are not using pretty print. Thanks, Radu -Original Message- From: millerj [mailto:[EMAIL PROTECTED] Sent: Monday, November 21, 2005 12:49 PM To: user@xmlbeans.apache.org Subject: pretty print and preserving whitespace inside element Hello, I am in a bit of a bind and the documentation/information surrounding XMLBeans sometimes leaves me at a bit of a loss, like right now. We have been using XMLBeans in production code for two full years now without any major hiccups. We have been utilizing pretty print as the receiver of the XML document requriers that any given line in an XML document is not greater then 4000 characters. To solve this we use pretty print with indent of 0 characters. now we have a problem where a specific XML element can contain a string of only white space (specifically ) when data for the element is not present. pretty print then takes that valid string ( ) and trashes it! elementName /elementName -- non pretty-print version elementName/-- pretty-print version this is unacceptable for our implementation and I am at a loss for how to stop pretty-print some taking our valid data (inside a valid element) and manipulating it. my question is, is there a XMLOption for controlling this? is there a valid work around for this? the bugzilla for XMLBeans has some related bugs all of which say they won't be fixed and pretty print shouldn't be used. we need to use it unless there is a way to format the doc without pretty print? thanks, Jonathan Miller - 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 ant task
About searching the mail archives: no, the mod_mbox ones don't have search on them, which is really a shame but that's life, keeping in mind that the people who are maintaining them are doing so on their own free time Radu -Original Message- From: Sherman, Dennis (END-CHI) [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 30, 2005 7:29 AM To: 'user@xmlbeans.apache.org' Subject: RE: xmlbeans ant task We do conditional compilation like this: !-- - - - - - - - - - - - - - - - - - target: gen-xmlbeans - - - - - - - - - - - - - - - - - -- target name=gen-xmlbeans depends=init, set-schema.compile.notneeded unless=schema.compile.notneeded xmlbean schema=${module}.xsd srcgendir=${src.dir} destfile=${dist.dir}/${module}.jar classpathref=compile.classpath debug=true verbose=true/ /target !-- - - - - - - - - - - - - - - - - - target: set-schema.compile.notneeded compare the schema datestamp to the jar file datestamp - - - - - - - - - - - - - - - - - -- target name=set-schema.compile.notneeded uptodate property=schema.compile.notneeded srcfiles dir=${basedir} includes=*.xsd/ mapper type=glob from=*.xsd to=${dist.dir}/*.jar / /uptodate /target It's an ant thing, not an xmlbeans thing. -- Dennis R. Sherman Endeavor Information Systems 847-227-2976 [EMAIL PROTECTED] http://www.endinfosys.com -Original Message- From: Cordes, Hans-Dieter [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 30, 2005 9:04 AM To: user@xmlbeans.apache.org Subject: xmlbeans ant task Hello, I use the xmlbean ant task (in the context of XMLBeans-1.0.3; I have to use this version for compatibility reasons) like this: xmlbean classpath=${XMLBeans.jar} schema=${aots.xsd.dir} destfile=${jar.dir}/Schema.AOTS.jar srcgendir=${aots.xmlbeans.gen.dir}/src classgendir=${aots.xmlbeans.gen.dir}/classes/ When I run that task in my build target, the whole process of generating xmlbeans starts again, even if I did that a minute before. Is there a way to do the xmlbeans generation conditionally, i.e. only if the XSD file has changed? And then a second question: Is there a way to search in the XMLBeans user mailing list (http://mail-archives.apache.org/mod_mbox/xmlbeans-user/)? There is probably some good stuff in there, but without a search capability it is difficult to get your questions answered. Thanks in advance for your help. Regards, Hans-Dieter Cordes - 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: How does xmlbeans marshall object graphs
I think you have answered the question yourself. XML in general cannot express object graphs, just tree structures. XMLBeans being a generic XML tool has this constraint too, so you basically need to encode the graph structure inside your app (and maybe use key/keyref constraints if you want to enforce this using validation). Thanks, Radu -Original Message- From: olle pettersson [mailto:[EMAIL PROTECTED] Sent: Sunday, November 20, 2005 3:23 PM To: user@xmlbeans.apache.org Subject: How does xmlbeans marshall object graphs Hi, I have tried to save an xml-document with one Java object occuring in two different places. xmlbeans just copies the object (creates two identical xml tags) rather than using some kind of reference. How does xmlbeans handle whole object graphs? Thanks, - 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: start from both feature
Title: Message This feature I think has been deemed out-of-scope for XmlBeans. The problem isit would make itimpossible to ensure all the XmlBeans features work consistently with generated code and pre-existing code, so it would confuse matters. XmlBeans does the hard job of creating Java types based on the Schema, and then it's user's responsibility to then create the adapters, is pretty much how this goes. Radu -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, December 01, 2005 12:35 AMTo: user@xmlbeans.apache.orgSubject: "start from both" featureHi. Is there a way to start from both Java and schema, and customize the binding rules between Java classes and the schema? I know, that this feature has already been planned, but just haven't seen its current state. Thanks.
RE: problem concerning version number in targetNamespace
Yeah, this is actually true, but not bug. The reason for it is that the rule for transforming URIs into package names says: if the part after the last slash looks like a file with extension, then strip the extension, where file with extension is interpreted as anything + '.' + 3 chars or anything + '.' + 2 chars or anything + '.html'. Your v01.01.00 string triggers this rule. Now I can see what you're saying, but I am reluctant to changing this since I don't know exactly what the new rule would be and also for backwards-compatibility reasons. Radu -Original Message- From: Johannes Echterhoff [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 4:51 AM To: user@xmlbeans.apache.org Subject: problem concerning version number in targetNamespace Hello. For handling different schema versions it could be nice to include the version number in the targetNamespace of a schema (see http://www.devx.com/xml/Article/22553 to get an overview of what I mean). So I tested this a little bit. The following schema is my test schema (I compile it using the xmlbeans ant task): ?xml version=1.0 encoding=UTF-8? xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns=http://foo.bar/v01-01-00; targetNamespace=http://foo.bar/v01-01-00; elementFormDefault=qualified attributeFormDefault=unqualified xs:element name=Root xs:complexType xs:sequence xs:element name=foobar type=xs:string/ /xs:sequence /xs:complexType /xs:element /xs:schema The resulting package for the generated classes is: bar.foo.v010100 - alright. But if I change the targetNamespace to v01.01.00 the resulting package is bar.foo.v0101! If I use v00.01.10 as version number the resulting package is bar.foo.v0001 whereas if i use v00-01-10 it's bar.foo.v000110 Seems to me that if I use a version number like vx.y.z with x, y and z being any number of digits the third part of the version number - z - is completely ignored when using dots to separate version fragments. I compiled with v0123456.1.01 and the result was bar.foo.v01234561 (using hyphens the result is bar.foo.v0123456110). Is this a bug? It would be nice to be able to compile schemas that include the schema version in their targetNamespace correctly even if the version number uses dots. What do you think of this? Regards, Johannes - 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: problem concerning version number in targetNamespace
People do have namespaces like http://www.name.com/foo/schema.xsd;, so that the namespace URI is also the download page for the document. It's hard to make the argument that having something like that is a mistake; and the generated package name for that is currently com.name.foo.schema. In my experience, I have never seen an URI ending in .-separated numbers though (well, until now that is) So in this case, the answer is: no, it's not a bug, it was a design choice, the design could be changed in the future, but I would recommend against doing so, for backwards-compatibility reasons. Radu -Original Message- From: Johannes Echterhoff [mailto:[EMAIL PROTECTED] Sent: Thursday, December 08, 2005 1:08 AM To: user@xmlbeans.apache.org Subject: Re: problem concerning version number in targetNamespace But what meaning would a file with extension in a URI of a targetNamespace have? Would a namespace like http://anything.com/myfault.html; not be a mistake by the user? And if so, shouldn't the user then correct the namespace if he does not like a package like com.anything.myfaulthtml? Backwards-compatibility cannot be abandoned, of course. The question is how many users already have a namespace like the one above and arranged with the existing transformation rule. A workaround could be to include the version number before the last slash, e.g. http://foo.bar/v01.01.00/myconcern; ... or just use version numbers with hyphens instead of dots. However, I just wanted to make sure whether this was a bug and could be fixed in a future version or not. Thanks, Johannes Radu Preotiuc-Pietro wrote: Yeah, this is actually true, but not bug. The reason for it is that the rule for transforming URIs into package names says: if the part after the last slash looks like a file with extension, then strip the extension, where file with extension is interpreted as anything + '.' + 3 chars or anything + '.' + 2 chars or anything + '.html'. Your v01.01.00 string triggers this rule. Now I can see what you're saying, but I am reluctant to changing this since I don't know exactly what the new rule would be and also for backwards-compatibility reasons. Radu -Original Message- From: Johannes Echterhoff [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 4:51 AM To: user@xmlbeans.apache.org Subject: problem concerning version number in targetNamespace Hello. For handling different schema versions it could be nice to include the version number in the targetNamespace of a schema (see http://www.devx.com/xml/Article/22553 to get an overview of what I mean). So I tested this a little bit. The following schema is my test schema (I compile it using the xmlbeans ant task): ?xml version=1.0 encoding=UTF-8? xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns=http://foo.bar/v01-01-00; targetNamespace=http://foo.bar/v01-01-00; elementFormDefault=qualified attributeFormDefault=unqualified xs:element name=Root xs:complexType xs:sequence xs:element name=foobar type=xs:string/ /xs:sequence /xs:complexType /xs:element /xs:schema The resulting package for the generated classes is: bar.foo.v010100 - alright. But if I change the targetNamespace to v01.01.00 the resulting package is bar.foo.v0101! If I use v00.01.10 as version number the resulting package is bar.foo.v0001 whereas if i use v00-01-10 it's bar.foo.v000110 Seems to me that if I use a version number like vx.y.z with x, y and z being any number of digits the third part of the version number - z - is completely ignored when using dots to separate version fragments. I compiled with v0123456.1.01 and the result was bar.foo.v01234561 (using hyphens the result is bar.foo.v0123456110). Is this a bug? It would be nice to be able to compile schemas that include the schema version in their targetNamespace correctly even if the version number uses dots. What do you think of this? Regards, Johannes - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using XML Beans to convert XSD to java classes
Title: Message I think I have answeredthis pretty recently, here it is again: the level of configuration granularity that .xsdconfig supports only goes to the level of class, so you can change names of packages and classes, but not of methods. Why do you need the method name to be specific? You can use the extensibility feature (http://wiki.apache.org/xmlbeans/ExtensionInterfacesFeature) to add new methods in addition to the generated ones... Radu -Original Message-From: Kashyap [mailto:[EMAIL PROTECTED] Sent: Thursday, December 08, 2005 6:52 AMTo: user@xmlbeans.apache.orgSubject: RE: Using XML Beans to convert XSD to java classes Thanks for the reply. But I still have some problems. I have written the .xsdconfig file. Using this I can over ride the name of the class. But I am not able to override the name of the properties in the class. Can you guys please let me know how to do the same. A sample file if any would do a world of good. Thanks again for the reply. Regards Kashyap -Original Message-From: Christophe Bouhier (MC/ECM) [mailto:[EMAIL PROTECTED] Sent: Thursday, December 08, 2005 7:01 PMTo: 'user@xmlbeans.apache.org'Subject: RE: Using XML Beans to convert XSD to java classes I read somewhere it's doing this to "pretty up" theuser defined types. I think you can override this behaviour by hacking the .xsdconfig file. this is explained here: http://dev2dev.bea.com/pub/a/2004/11/Configuring_XMLBeans.html Cheers / Christophep.s. Why is there no document for xsdconfig on the xmlbeans webpage? Took me ages to find the link above. From: Kashyap [mailto:[EMAIL PROTECTED] Sent: 08 Disember 2005 21:07To: user@xmlbeans.apache.orgSubject: Using XML Beans to convert XSD to java classes Hi all, I am using XML Beans to generate java classes from an XSD. I am facing a problem in the same. When ever I generate the java classes, all the element names which have underscore in their name have been changed by removing underscore. For example if there is a Complex element called A_B. Then the java class generated will have the name AB instead of A_B Why is xmlbeans eating up the underscore. Any solution for this. Please help guys. Pretty urgent. Thanks in advance Regards Kashyap CAUTION - Disclaimer *This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.***INFOSYS End of Disclaimer INFOSYS***
RE: Attributes and NameSpaces
Title: Message Well, XmlBeans doesn't really know when you meant to call something else and when you actually need are able to handle null (plus, adding any such code on the critical path for a 'get' would slow things down noticeably). But, what one can do when in doubt is call .validate() on the element that seems to be misbehaving and see if there are any validation errors, this may provide a clue... Radu -Original Message-From: Samuel B. Quiring [mailto:[EMAIL PROTECTED] Sent: Friday, December 09, 2005 9:41 AMTo: user@xmlbeans.apache.orgSubject: Re: Attributes and NameSpaces Lawrence, I ran into this exactproblem when I startedusing xmlBeans and it was baffling and cost me hours of time before you sent a similiar explanation. Isn't there some kind of creative check that xmlBeans could run to detect the possible existence of this problem and alert the user? -Sam - Original Message - From: Lawrence Jones To: user@xmlbeans.apache.org Sent: Friday, December 09, 2005 9:29 AM Subject: RE: Attributes and NameSpaces Hi Richard I think youre running into the infamous elementFormDefault=qualified | unqualified issue. If you dont put an elementFormDefault attribute in the schema element of your schema the default is elementFormDefault=unqualified. This means that when you refer to non-global elements (such as your CustomerNumber, ValidCustomer elements below) you _must_ refer to them _without_ a namespace. Global elements are unaffected by this setting you must always refer to them with a namespace (if one was defined in the original schema). On the other hand if you add the attribute elementFormDefault=qualified to the schema element then all elements (global and local) _must_ be referred to _with_ the namespace. So you have 2 choices: Add elementFormDefault=qualified to your original schema and re-run scomp after which I think your code will work with the XML Instance doc youve provided. Change your XML instance doc so that instead of defining xmlns="http://infor.com/ResponseBatch" in your ResponseBatch element (which also affects the descendants of that element) you define just xmlns:tns="http://infor.com/ResponseBatch" and update your ResponseBatch to be tns:ResponseBatch (you can choose whatever prefix you like). Do _not_ add the same prefix to the children elements. Defining it this way will not affect the descendants of that element which will mean that they will get the no-namespace namespace which is what you want if you dont use elementFormDefault=qualified. Personally I recommend option 1. But thats just me Ive heard people argue it both ways. Cheers, Lawrence From: Butterwood, Richard [mailto:[EMAIL PROTECTED] Sent: Friday, December 09, 2005 8:40 AMTo: user@xmlbeans.apache.orgSubject: Attributes and NameSpaces I can retrieve attributes using a XSD and XML without a name space, but with a namespace the following will not work. I would appreciate any help. XSD (ResponseBatch.xsd) ?xml version="1.0" encoding="utf-8" ? xsd:schema targetNamespace="http://infor.com/ResponseBatch" xmlns="http://infor.com/ResponseBatch" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsd:element name="ResponseBatch" xsd:complexType xsd:sequence xsd:element name="CustomerNumber" type="xsd:string"/ xsd:element name="ValidCustomer" type="xsd:string"/ xsd:element name="CustomerName" type="xsd:string"/ xsd:element name="ListPrice" type="xsd:int"/ /xsd:sequence xsd:attribute ref="ResponseID"/ xsd:attribute ref="ConsumerKey"/ xsd:attribute ref="Language"/ xsd:attribute ref="DateTime"/ xsd:attribute ref="SerialID"/ /xsd:complexType /xsd:element xsd:attribute name="ResponseID" type="xsd:string"/ xsd:attribute name="ConsumerKey" type="xsd:string"/ xsd:attribute name="Language" type="xsd:string"/ xsd:attribute name="DateTime" type="xsd:string"/ xsd:attribute name="SerialID" type="xsd:string"/ /xsd:schema XML (ResponseBatch.xml) ?xml version="1.0" encoding="UTF-8"? !-- Contains weather details of a location.-- ResponseBatch xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ResponseID="ValidateCustomer" ConsumerKey="1234" Language="English" DateTime="today" SerialID="001" xmlns="http://infor.com/ResponseBatch"
RE: XmlEntry filter??
Your use-case is quite particular, there isn't something out-of-the-box that can satisfy it. Fortunately for you, it seems like you should be able to use org.xml.sax.XMLFilter + a little custom code to solve this. Radu -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 13, 2005 7:18 AM To: user@xmlbeans.apache.org Subject: XmlEntry filter?? Hi how can i filter some elements in a XmlEntry?? This is my XmlEntry (only a snapshot): xml-fragment xmlns:xsi=http://whatever; xmlns:xtce=http://something; SequenceContainer name=default_Container shortDescription=This is a default container EntryList ParameterRefEntry parameterRef=parameterOne /ParameterRefEntry /EntryList /SequenceContainer SequenceContainer name=ContainerOne shortDescription=Packet one... EntryList ParameterRefEntry parameterRef=parameterTwo LocationInContainerInBits FixedValue129FixedValue /LocationInContainerInBits /ParameterRefEntry ParameterRefEntry parameterRef=parameterThree LocationInContainerInBits FixedValue132FixedValue /LocationInContainerInBits /ParameterRefEntry /EntryList /SequenceContainer SequenceContainer name=ContainerTwo shortDescription=Packet two... EntryList ParameterRefEntry parameterRef=parameterFour /ParameterRefEntry ParameterRefEntry parameterRef=parameterFive /ParameterRefEntry /EntryList /SequenceContainer /xml-fragment I use this to build a XmlTree. My Problem is that i need only ContainerOne and ContainerTwo. The complete xml-file contains many more container. I need something to ignore all the container which have the word default in the name. Is there a way to do this?? Thanks. Christian - 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: XmlAnyTypeImpl returned instead of expected document
That is very strange, seeing something like this just for a specific load, no more, no less, and very hard to debug. The problem where you would not get the correct types when using XmlBeans V2 with jars compiled with an older version is well understood on the other hand, but seems completely unrelated to what you are seeing. If you are interested in debugging this, let me know, and I can give you some suggestions of things to try off-line. (Then of course, we'll post any results back to the list) Thanks, Radu -Original Message- From: Ruslanas Abdrachimovas [mailto:[EMAIL PROTECTED] Sent: Sunday, December 11, 2005 2:51 PM To: user@xmlbeans.apache.org Subject: XmlAnyTypeImpl returned instead of expected document Hi, I do use XMLBeans and apache Axis in my project. My web application works on WebSphere with IBMs Java2 v1.4. Application does send SOAP requests to backend server and retrieves responses which are processed by frontend web app. This system seems to fail under high load (it works ok with 75 users, but fails completely when I run 100users): XML beans seem to be unable to parse responses and return XmlAnyTypeImpl objects instead of expected document object. In this situation my application is unable to cast XmlAnyTypeImp object to my specific one which ends with fatal error. I was unable to find any issues with responses from backend - they do validate against schema that was compiled with XMLBeans for my application. I could not reproduce such problem with small test case, that sends reauests and parses responses, no similar error were encountered under much higher load (600 parallel threads and more). Lowering amount of available memory caused my test case to throw OutOfMemory error, bu still no XmlAnyTypeImpl objects returned instead of expected document. So it does not seem to be threading or memory insufficiency issue (at leas in they basic formulations). Looking through XmlBeans mailing lists I did find one thread, where similar issue was mentioned: The other guy has compiled schema with one XMLBeans version but in runtime he did use anohter and was getting from XMLBeans XmlAnyTypeImp object instead of expected one (recompiling schema with correct versionsolved this problem for him). However in my case difference is that my app fails only on high load (or some other conditions that are related to high load). Did anybody experiance simlar issues? Does anybody know any solution to this? Thanks in advance for any info, smallest clue or suggestion! RA - 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: Problems with highly recursive schema
I have just added a new entry to the FAQ: http://wiki.apache.org/xmlbeans/XmlBeansV1Faq#scompOutOfMemory Can you please check it out and see if that solves your problem? Thanks, Radu -Original Message- From: Alejandro Escalante Medina [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 28, 2005 5:01 PM To: user@xmlbeans.apache.org Subject: Problems with highly recursive schema Hi to everyone. I'm doing some tests to migrate our current JAXB based serialzer to XMLBeans, but I'm running into a bit of problem. Or actually a lot. We seem to have a very recursive schema, which simply blows scomp away with OutOfMemory errors. It is a complex schema and maybe not extremely well designed since this is its first version. We need XMLBeans for its support of the full infoset (we need to preserve comments when doing round-trip of the xml files). Is there anything you might suggest about this? I'm trying XMLBeans 2.1, BTW. Thanks in advance, -- Alejandro Escalante Medina Visita mi página personal en http://weblocked.blogsome.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: Problems with highly recursive schema
Hm, that's kind of a bug, it should normally support unsigned shorts, I will look into this. In the meantime, you could try and split your Schemas (assuming you have more than one file) and compile them in two separate steps; that should get you past this problem. Radu -Original Message- From: Alejandro Escalante Medina [mailto:[EMAIL PROTECTED] Sent: Monday, January 02, 2006 6:02 PM To: user@xmlbeans.apache.org Subject: Re: Problems with highly recursive schema Well, there's been some advance, but I'm not getting there yet: Time to build schema type system: 20.724 seconds Exception in thread main org.apache.xmlbeans.SchemaTypeLoaderException: Value 37585 out of range: must fit in a 16-bit short. (schemaorg_apache_xmlbeans.system.sF71524545A66AF76743DC06881348376.index) - code 10 at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.writeShort(SchemaTypeSystemImpl.java:1769) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.writeHandlePool(SchemaTypeSystemImpl.java:1705) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.writeIndexData(SchemaTypeSystemImpl.java:1664) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveIndex(SchemaTypeSystemImpl.java:322) at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.save(SchemaTypeSystemImpl.java:1304) at org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java:1098) at org.apache.xmlbeans.impl.tool.SchemaCompiler.main(SchemaCompiler.java:368) Seems like I'm running into a limit here because of the size of my schema. Is there anything to do? Thanks for your help, Alex On 1/2/06, Radu Preotiuc-Pietro [EMAIL PROTECTED] wrote: I have just added a new entry to the FAQ: http://wiki.apache.org/xmlbeans/XmlBeansV1Faq#scompOutOfMemory Can you please check it out and see if that solves your problem? Thanks, Radu -Original Message- From: Alejandro Escalante Medina [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 28, 2005 5:01 PM To: user@xmlbeans.apache.org Subject: Problems with highly recursive schema Hi to everyone. I'm doing some tests to migrate our current JAXB based serialzer to XMLBeans, but I'm running into a bit of problem. Or actually a lot. We seem to have a very recursive schema, which simply blows scomp away with OutOfMemory errors. It is a complex schema and maybe not extremely well designed since this is its first version. We need XMLBeans for its support of the full infoset (we need to preserve comments when doing round-trip of the xml files). Is there anything you might suggest about this? I'm trying XMLBeans 2.1, BTW. Thanks in advance, -- Alejandro Escalante Medina Visita mi página personal en http://weblocked.blogsome.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] - 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 and xml digitail signature
Title: Message I have thought about a feature along those lines. One place it would certainly be useful is when XmlBeans *has* to create prefix declarations because user code is setting a QName value (directly or indirectly) and so it is necessary to ensure that the meaning of that QName is preserved when the surrounding document changes. But beyond this, I have doubts that it would be such a good idea,for example, it is not clear to me how the following scenario would work: Suppose you want to create a document like: ... n:container xmlns:n="urn:test" n:task/ /n:container, bottom up (so first create the children, then the parent). ... You do TaskType task = TaskType.Factory.newInstance(); ContainerType container = ContainerType.Factory.newInstance(); container.setTask(task); At this point, "container" is unattached (so it has no element name), and it contains one "task" element, with an implicitly added "xmlns:n="urn:test"" namespace declaration. Now, "container" gets attached to the larger document: doc.setContainer(container) but there is no declaration for the "urn:test" prefix in scope, so one gets generated "xmlns:n="urn:test"". At this point, you have declarations for the "n" prefix on both the container and task elements, which I don't think most people would expect or want. In order to avoid this, XmlBeans would have to basically change theXML subtreethat gets added and traverse it to search and remove all redundant namespace declarations -on every set(). I think the issue is that what XmlBeans generates is a so-called "synthetic infoset", an XML infoset which is legal, but could not have been generated by parsing a document. Maybe having a method that turns it into a "normal infoset" when you're done changing the document would be useful (which is mostly what you're already doing, but packaged). Or add all xmlns declarations to the root element, if you know a priori what namespaces are used. Radu -Original Message-From: Giedrius Trumpickas [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 04, 2006 7:47 AMTo: user@xmlbeans.apache.orgSubject: Re: XmlBeans and xml digitail signatureActually my solution to this problem was the same(I added namespace declarations with XmlCursor). But it's not elegant and it looks like a hack. I think it would be useful to add following features:1) Specify preferred namespace prefixes for namespace URI in xml beans config file or pass with options when creating xml bean instance2) Have namespace attribute declarations in a new documents created by using XML beans.Giedrius On 1/3/06, Radu Preotiuc-Pietro [EMAIL PROTECTED] wrote: Oh, ok, that actually makes sense, because when you are creating the document from scratch, you arenot creating the namespace attributes, which is why you can then choose what prefixes you want when saving the document (you can even save the same documenttwice with different prefix mappings). I guess I would try adding the namespace attributes "by hand" (using XmlCursor) after finishing creating the document. Radu -Original Message-From: Giedrius Trumpickas [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 03, 2006 7:33 AMTo: user@xmlbeans.apache.org Subject: Re: XmlBeans and xml digitail signature Radu,In your case it works because you are loading existing XML file with namespace prefixes and namespace declaration attributes.Problem happens when you are creating a new XML bean instance and then trying to access DOM nodes.There is no way how to specify namespaceURI to prefix mapping when creating instance of XML bean. Namespace declarations are missing as well.When serializing to xml xmlText you can pass XmlOptions with prefixes but when creating you can't do it. I will send you a test case shortly.Giedrius On 1/2/06, Radu Preotiuc-Pietro [EMAIL PROTECTED] wrote: Are you using XmlBeans V2? Both of those features work as per the DOMspec as far as I know, this is the code I used to test this:XmlObject o = XmlObject.Factory.parse(new File("test.xml"));Document d = (Document) o.getDomNode();org.w3c.dom.Element e = d.getDocumentElement();System.out.println("Tag name: " + e.getTagName());NamedNodeMap atts = e.getAttributes();for (int i = 0; i atts.getLength (); i++)System.out.println("name=" + atts.item(i).getNodeName() + ",value=" + atts.item(i).getNodeValue());Are you sure that these two things are what's causing issues? If you're positive, then it would help if you could submit the particular use-casethat's giving you trouble, because in the general case, it seems to workok.Thanks,Radu-Original Message-From: Giedrius Trumpickas [mai
RE: Html forms - xmlBeans - xml document
A couple of comments: - why do you say that you have to use xget/xset some times and set/get other times? It seems to me you should be able to standardize on one approach, the one that suits you best - we have an example of using Velocity + XmlBeans in the samples section on the website (http://xmlbeans.apache.org/samples/index.html), not sure if you saw that or if it is relevant to you Radu -Original Message- From: Jon Haugsand [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 03, 2006 11:29 PM To: user@xmlbeans.apache.org Subject: Html forms - xmlBeans - xml document I am quite new to XmlBeans, but I have been playing around for some weeks. What I need to do is to produce xml documents by getting users to fill in html forms. Solution is based on Tomcat, Java servlets, Velocity and Spring. My naive approach is to use a simple model-view-controller pattern where the controller takes the HttpRequest.parameterMap and an XmlObject class, use reflection and makes an instance of the XmlObject. This is not hard, but a little bit involved because String properties are handled differently from other properties. (I.e. xsetXXX and xgetXXX to get real XmlSimpleType objects whereas non-String objects use getXXX, setXXX and addNewXXX.) The other way around, i.e. for the model, I have a generic class XmlModel to make it easy for Velocity to extract presentation information and validation information from XmlObjects and into html pages. By the use of reflection my object is populated with all XmlSimpleType properties from an XmlObject object. A few questions: 1. Has anyone here done something similar? 2. Are there any obvious tools I that I have overseen? 2. Is my approach otherwise sensible? -- Jon Haugsand - 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: XmlError.getLine() always returns -1 even withXmlOptions.setLoadLineNumbers() set
One thing I can suggest is double-check that you are indeed using the V2 version, using: scomp -version V2.0 supports line numbers by default, while V2.1 also has column numbers on by default Radu -Original Message- From: Quynh-Anh Nguyen [mailto:[EMAIL PROTECTED] Sent: Friday, January 06, 2006 5:18 AM To: user@xmlbeans.apache.org Subject: XmlError.getLine() always returns -1 even withXmlOptions.setLoadLineNumbers() set Hello, I can't seem to get the line number that is associated with the XmlError that I do get when I validate. Does anybody knows what is wrong, or is this feature not supported. I have also searched the Internet and hunt up on this subject, but I just can't get it to work. I also follow the thread regarding the Piccolo subject for line number as well, but I am using 2.1.0, which should have this feature. Any help is greatly appreciated. I am using XmlBeans 2.1.0 with WebLogic 8.1, jdk142_03. ArrayList validationErrors = new ArrayList(); XmlOptions validationOptions = new XmlOptions(); validationOptions.setLoadLineNumbers(XmlOptions.LOAD_LINE_NUMBERS_END_EL EMENT); validationOptions.setErrorListener(validationErrors); PS81Document ps81Doc; try { ps81Doc = PS81Document.Factory.parse(inputXMLStream); PS81Document.PS81 test = ps81Doc.getPS81(); IdentifyingRecord81 header = test.getHeader(); boolean isValid = header.validate(validationOptions); if (!isValid) { Iterator iter = validationErrors.iterator(); while (iter.hasNext()) { XmlError xmlError = (XmlError) iter.next(); int line = xmlError.getLine(); . . . } . . . - 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: key, keyref with namespace : not working
Title: Message I think this is a mistake in the Schema, but a very easy one to make since, unfortunately, this is a VERY non-intuitive part of the spec (I have seen this situationa few times and it still seems counter-intuitive to me). What basically happens is that the default prefix declaration*is not*taken into account for the XPath expressions describing the keys. (The reason for it is that the XPath expressions appear as attribute text, and arbitrary text and active default prefix declarationdon't mix well). Of course, you *can* describe keys that point to elements in the default namespace and you may want to do just that, so the situation is not detectable at compilation time. And during validation, the only rule for key is that each "instance" of the "selector" has a corresponding instance of the "field" (and that the "field" instances are of course unique), but if there are no instances of the "selector" element, then it's ok, no error. To make a long story short, in your original example, you need to declare a specific prefix for the "test" namespace and use that in you XPath expressions (or use elementFormDefault="unqualified" since this also interacts with the selectors). Thanks, Radu -Original Message-From: Olivier CHAPITEAU [mailto:[EMAIL PROTECTED] Sent: Friday, January 13, 2006 1:02 AMTo: user@xmlbeans.apache.orgSubject: key, keyref with namespace : not workingIf i declare a target namespace in a schema using key and keyref, constraint isn't verified by validate (alwasy tell valid) did i do a mistake in my schemas or is it a bug ? thanks, the details of schema and sample xml : The keyref.xsd with a target namespace declared : ?xml version="1.0" encoding="UTF-8"? xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="test" xmlns="test" elementFormDefault="qualified" xs:element name="root" xs:complexType xs:sequence xs:element name="List" type="ListType"/ xs:element name="Refs" type="RefType"/ /xs:sequence /xs:complexType xs:key name="myId" xs:selector xpath=".//List/a"/ xs:field xpath="./@id"/ /xs:key xs:keyref refer="myId" name="myIdRef" xs:selector xpath=".//Refs/b"/ xs:field xpath="./@idref"/ /xs:keyref /xs:element xs:complexType name="ListType" xs:sequence xs:element name="a" minOccurs="1" maxOccurs="unbounded" xs:complexType xs:attribute name="id" type="xs:NCName" use="required"/ /xs:complexType /xs:element /xs:sequence /xs:complexType xs:complexType name="RefType" xs:sequence xs:element name="b" minOccurs="1" maxOccurs="unbounded" xs:complexType xs:attribute name="idref" type="xs:NCName" use="required"/ /xs:complexType /xs:element /xs:sequence /xs:complexType /xs:schema here's a nonvalid.xml document : ?xml version="1.0" encoding="UTF-8"? root xmlns="test"List a id="x"/a id="y"/ /List Refs b idref="x"/ b idref="y"/ b idref="z"/ /Refs /root if I do "validate keyref.xsd nonvalid.xml" , it tell me that document is valid. Removing any targetnamespace declaration, the key is correctly checked : xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="test" xmlns="test" elementFormDefault="qualified" become xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" root xmlns="test" become root in xml doc then, the validation fail :"key ref "z" not found", as awaited Olivier,
RE: add backtrack ability to SchemaTypeVisitorImpl
You can use SchemaTypeVisitorImpl without using the generated sources, but classes under impl in the xmlbeans package hierarchy are implementation packages, designed to support the functionality of XMLBeans, not for direct use. Check out the (intented for direct use) org.apache.xmlbeans.SchemaTypeElementSequencer which I think will do what you want if I understand the use case correctly. Note that this does not have backtrack capabilities but should be fast enough to basically replay the elements everytime you would want to backtrack. Also, IANAL, but I think your understanding of the Apache license is correct. Radu -Original Message- From: Lendle [mailto:[EMAIL PROTECTED] Sent: Monday, January 16, 2006 8:03 PM To: user@xmlbeans.apache.org Subject: add backtrack ability to SchemaTypeVisitorImpl Hi! May I use SchemaTypeVisitorImpl only without using xmlbean generated sources? This is because I want to give users a hint about what element can be inserted at some location before he/she really insert something. I've noticed that SchemaTypeVisitorImpl already have enough information about the correct element sequence under a schema type. I think I can use SchemaTypeVisitorImpl and possibly add backtrack functionality to this class for convenience. However, since many information needed are stored in private members, I cannot extend this class but have to directly modify the source. Is this a workable choice? Furthermore, if I modified the source code of SchemaTypeVisitorImpl.java and use the modification with other xmlbean source codes in a non-open source, commercial product, what I have to do is to include a file indicating the modification. Is my understanding to the apache style 2.0 license correct? If not, please correct me. Thanks!! Sincerely, Lendle Tseng - 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: Unsetting an array
Try setting the value to an empty array, I think that's what you really want. Radu -Original Message- From: Johannes Echterhoff [mailto:[EMAIL PROTECTED] Sent: Thursday, January 19, 2006 6:39 AM To: user@xmlbeans.apache.org Subject: Unsetting an array Hi. Question: what is the preferred way of unsetting an array of elements (declared in the schema to be optional and unbounded)? Regards, Johannes Echterhoff - 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: Strange Type Resolution Error
This looks like a classloader issue, specifically make sure that all XmlBeans-generated JARs (including the one containing the .xsb files) are on junit's classpath. Radu -Original Message- From: Edward Frederick [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 01, 2006 1:35 PM To: user@xmlbeans.apache.org Subject: Re: Strange Type Resolution Error New development: I tried to instead directly instantiate the document type I want, and a curious error happens in case#2: The document is not a [EMAIL PROTECTED]://my.site/foo: document element namespace mismatch expected http://my.site/foo; got But that's strange, since I never had problems before, and my document clearly uses the NS: foo xmlns=http://my.site/foo; document-namename/document-name /foo XSD specifies element form qualified. But again, I never had problems when inside tomcat. All the elements are there, because if I replace the doc element with a qualified QName it works (well, initially... until it complains about the child elements being unqualified). Damn namespaces. Thanks! Ed On 2/1/06, Edward Frederick [EMAIL PROTECTED] wrote: Hello, XMLBeans is working great for me, thank you to all contributors. I'm having a strange problem: When run within Tomcat (types are within a jar file in WEB-INF/lib): XmlObject enclosure = (XmlObject)XmlObject.Factory.parse(someFooDom); enclosure.getClass().getName() = my.xmlbeans.package.FooDocument (as expected) When run outside of Tomcat (i.e. say when used within a JUnit test, generated JARs are still inside classpath): XmlObject enclosure = (XmlObject)XmlObject.Factory.parse(someFooDom); enclosure.getClass().getName() = org.apache.xmlbeans.impl.values.XmlAnyTypeImpl I verified that the passed documents are exactly the same. Does this mean that in the second scenerio XMLBeans can't 'see' my schemas and corresponding beans? Any ideas on how I can figure out why my document isn't been 'seen' as a FooDocument? I know this is a vague issue, but I'm hoping somewhere out there has an 'aha' moment. Thanks so much, Ed - 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 throws exception, is it right?
I think the Schema is fine and XmlBeans should not error. I have opened issue XMLBEANS-251 to track this. Thank you, Radu -Original Message- From: johnli121 [mailto:[EMAIL PROTECTED] Sent: Friday, March 03, 2006 4:21 AM To: user@xmlbeans.apache.org Subject: xmlbeans throws exception, is it right? Hi, When I XmlBeans.compileXsd below schema, xmlbeans throw exception. But I think this schema is OK, please help to check it. What's wrong? I have tried it under xmlbeans 2.0.0 and 2.1.0. Error message: fixed.xsd:0: error: e-props-correct.2: The '[EMAIL PROTECTED]://www.world.com' element fixed value '' is not a valid value for '[EMAIL PROTECTED]://www.world.com' My test schema: ?xml version=1.0? schema xmlns=http://www.w3.org/2001/XMLSchema; xmlns:self=http://www.world.com; xmlns:xsd=http://www.w3.org/2001/XMLSchema; targetNamespace=http://www.world.com; complexType name=stringItemType final=extension simpleContent extension base=string attribute name=date type=xsd:string use=required/ anyAttribute namespace=##other processContents=lax/ /extension /simpleContent /complexType complexType name=countryItemType simpleContent restriction base=self:stringItemType length value=0 fixed=true/ /restriction /simpleContent /complexType element name=Test type=self:countryItemType fixed= nillable=true id=int-Test/ /schema There are two way to work around it, 1.) attribute name=date type=xsd:string use=required/ change from required to optional. 2.) element name=Test type=self:countryItemType fixed= nillable=true id=int-Test/ delete fixed= But my problem is, this snippet is from a released Schema, so it's difficult(if not impossible) to modify it. And first of all, I want to make sure it's a issue of xmlbeans or that released Schema. Thanks, John Li - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Canonicalization with XMLBeans
XmlBeans doesn't support canonicalization yet, and I am fairly sure we never posted anything on mailing lists or website saying that it does. Where did you get that information from? We were considering it some time ago, while V2 was still in development but we never actually invested enough into it. That being said, I have seen people using digital signatures with XmlBeans successfully, if anyone has any experience with this,any input will certainly be appreciated. Thank you, Radu From: Alex Soto [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 07, 2006 8:11 AMTo: user@xmlbeans.apache.orgSubject: Canonicalization with XMLBeans Hello im developing a xml digital signature module using Xml Beans. I have developed all we need for our project, but i can't find how to canonicalize an element in my case SignedInfo. Can anybody tell me how can i do. I say because i have read in V2Features of XML Beans that i have to be able to do it.Thank you very much. La información contenida en el presente e-mail es confidencial y está reservada para el uso exclusivo de su destinatario. Se prohíbe estrictamente la distribución, copia o utilización de esta información sin el previo permiso de su destinatario. Si usted no fuera el destinatario, por favor notifíquelo inmediatamente al remitente y elimine el presente mensaje de su sistema informático.Information contained in this e-mail is confidential and is intended for the use of the addressee only. Any dissemination, distribution, copying or use of this communication without prior permission of the addressee is strictly prohibited. If you are not the intended addressee, please notify the sender immediately by reply and then delete this message from your computer system. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: accessing key objects via keyrefs
I have been thinking about this, but it is tricky to do: it breaks our "binding should not require validation" rule (it's true that we would only do it if requested), soit felt to me like one of thosebig effort/ not so big reward things, esp since there is the XPath workaround available. Also, no other binding solution, to my knowledge, supports this. Radu From: Alex Soto [mailto:[EMAIL PROTECTED] Sent: Thursday, March 09, 2006 7:47 AMTo: user@xmlbeans.apache.orgSubject: Re: accessing key objects via keyrefs Ok i understand what you means now. I found the same problem some time ago, i because i couldn't find a way, i choose xpath option.I wish someone else could gave his opinion.El dj 09 de 03 del 2006 a les 15:36 +, en/na DM va escriure: Hi, Thanks for your response. I don't see home XPath will help me. I'm really just asking whether XMLBeans contains built-in support for retrieving a referenced object. The reference is defined in the schema using an xs:keyref which refers to an xs:key. Cheers, Don --- Alex Soto [EMAIL PROTECTED] wrote: If i understand your problem you could do using an XPATH _expression_. See xpath tutorial in xmlbeans page. Remeber to add Saxon jar to classpath. El dj 09 de 03 del 2006 a les 15:08 +, en/na DM va escriure: Hi, My XML docs contain a bunch of elements that look like this: mp-group id="cddv" monitored-property key="count" label="count"/ monitored-property key="duration" label="duration"/ /mp-group and another bunch of elements that look like this: service-type mp-group-ref="cddv" The "mp-group-ref" attribute is defined as a keyref, which points to an mp-group (the "id" attribute of the the latter is defined as a key). Is there any way using XMLBeans to retrieve the object pointed to by a keyref? In other words, given a ServiceType, is there any way I can easily retrieve the referenced MpGroup? Of course I could store all the MpGroups in a Map, which I could then lookup using the mp-group-ref value, but is there an easier way? I'm using version 2.1.0. Thanks in Advance, Don ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] La información contenida en el presente e-mail es confidencial y está reservada para el uso exclusivo de su destinatario. Se prohíbe estrictamente la distribución, copia o utilización de esta información sin el previo permiso de su destinatario. Si usted no fuera el destinatario, por favor notifíquelo inmediatamente al remitente y elimine el presente mensaje de su sistema informático. Information contained in this e-mail is confidential and is intended for the use of the addressee only. Any dissemination, distribution, copying or use of this communication without prior permission of the addressee is strictly prohibited. If you are not the intended addressee, please notify the sender immediately by reply and then delete this message from your computer system. ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] La información contenida en el presente e-mail es confidencial y está reservada para el uso exclusivo de su destinatario. Se prohíbe estrictamente la distribución, copia o utilización de esta información sin el previo permiso de su destinatario. Si usted no fuera el destinatario, por favor notifíquelo inmediatamente al remitente y elimine el presente mensaje de su sistema informático.Information contained in this e-mail is confidential and is intended for the use of the addressee only. Any dissemination, distribution, copying or use of this communication without prior permission of the addressee is strictly prohibited. If you are not the intended addressee, please notify the sender immediately by reply and then delete this message from your computer system. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: synchronization in generated code by xmlbeans
Well, in V2 there is actually an option to remove the synchronization at runtime when loading, saving and manipulating documents _except_ when doing so with generated classes, since those are already generated. We probably ought to look at this option at compile-time also and not generate the synchronized blocks... Thanks, Radu From: toadie D [mailto:[EMAIL PROTECTED] Sent: Thursday, March 09, 2006 9:50 AMTo: user@xmlbeans.apache.orgSubject: re: synchronization in generated code by xmlbeans http://mail-archives.apache.org/mod_mbox/xmlbeans-dev/200402.mbox/[EMAIL PROTECTED] I just updated to the latest V2 release and am still seeing synchronized codes being generated e.g. synchronized (monitor()) I am just curious as to how well this performs on the server side application (granted that a new Instance is always created) but does the effect of calling 'synchronized' generate a lot of activities in the JVM? Thanks ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: special character escaping
XmlBeans, by default, escapes the minimum number of characters that are required: - lt; - amp; - quot; (only if inside an attribute value) Other than this, you can use the XmlOptions to turn on escaping for other characters, as you correctly pointed out. If you want to, say, escape every non-ASCII character (by the way, why do you need that?) you would indeed have to fill the map with tens of thousands of entries, which is less than optimal, but possible. I guess we didn't think that someone would want to escape ranges of characters at once, so we tried to keep the XmlOptionCharEscapeMap simple... Radu -Original Message- From: Brian Lee [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 15, 2006 3:05 PM To: user@xmlbeans.apache.org Subject: Re: special character escaping Besides the character does XMLBeans escape any other characters by default? Thanks, Brian Lee - Developer Macys.com Brian Lee [EMAIL PROTECTED] To 03/15/06 01:27 PM user@xmlbeans.apache.org cc Please respond to Subject [EMAIL PROTECTED] special character escaping che.org I've looked at the archived user list and I haven't been able to find any questions or answers regarding character escaping. I was wondering if there's a way to either completely turn it off or to have xmlbeans function like the Jakarta Commons StringEscapeUtils.escapeXml() function? Any info would be much appreciated. Thanks, Brian Lee - Developer Macys.com W: 415-422-1624 C: 415-425-4077 - 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] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: getting the start line and column for attributes
This is a limitation of the fact that we use SAX to communicate with Piccolo so there is no opportunity for it to pass line-column info for attributes. Thanks, Radu -Original Message- From: Lysander David [mailto:[EMAIL PROTECTED] Sent: Saturday, March 18, 2006 6:21 PM To: user@xmlbeans.apache.org Subject: getting the start line and column for attributes Hi, I know it is possible to determine the start line and column for an xml element but I didn't see any way to determine the start line and column of an xml attribute. Is it possible and if so, how can it be done ? Thanks, Lysander - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: special character escaping
Oops, of course, my bad. I got confused by the fact that what .addMappings(char, char, int) really does is call .addMapping(char, int) in a 'for' loop... But yeah, Brian, I think that's exactly what you are looking for. Radu -Original Message- From: Wing Yew Poon Sent: Monday, March 20, 2006 6:40 PM To: user@xmlbeans.apache.org Subject: RE: special character escaping Radu, it is possible to escape a range of characters using the XmlOptionCharEscapeMap: XmlOptionCharEscapeMap charEsc = new XmlOptionCharEscapeMap(); charEsc.addMappings('A', 'Z', XmlOptionCharEscapeMap.HEXADECIMAL); System.out.println(charEsc.getEscapedString('A')); //#x41; System.out.println(charEsc.getEscapedString('B')); //#x42; System.out.println(charEsc.getEscapedString('C')); //#x43; System.out.println(charEsc.getEscapedString('X')); //#x58; System.out.println(charEsc.getEscapedString('Y')); //#x59; System.out.println(charEsc.getEscapedString('Z')); //#x5a; I don't know if this is what Brian is looking for. - Wing Yew -Original Message- From: Radu Preotiuc-Pietro Sent: Monday, March 20, 2006 6:20 PM To: user@xmlbeans.apache.org Subject: RE: special character escaping XmlBeans, by default, escapes the minimum number of characters that are required: - lt; - amp; - quot; (only if inside an attribute value) Other than this, you can use the XmlOptions to turn on escaping for other characters, as you correctly pointed out. If you want to, say, escape every non-ASCII character (by the way, why do you need that?) you would indeed have to fill the map with tens of thousands of entries, which is less than optimal, but possible. I guess we didn't think that someone would want to escape ranges of characters at once, so we tried to keep the XmlOptionCharEscapeMap simple... Radu -Original Message- From: Brian Lee [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 15, 2006 3:05 PM To: user@xmlbeans.apache.org Subject: Re: special character escaping Besides the character does XMLBeans escape any other characters by default? Thanks, Brian Lee - Developer Macys.com Brian Lee [EMAIL PROTECTED] To 03/15/06 01:27 PM user@xmlbeans.apache.org cc Please respond to Subject [EMAIL PROTECTED] special character escaping che.org I've looked at the archived user list and I haven't been able to find any questions or answers regarding character escaping. I was wondering if there's a way to either completely turn it off or to have xmlbeans function like the Jakarta Commons StringEscapeUtils.escapeXml() function? Any info would be much appreciated. Thanks, Brian Lee - Developer Macys.com W: 415-422-1624 C: 415-425-4077 - 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] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended
RE: optimizing memory consumption with XMLBeans
Not sure what you are asking. On one hand, XmlBeans is indeed by default using SAX to interface with the XML parser, but on the other, XmlBeans is an in-memory XML processing tool, so if you need to process a huge XML file, you would need a huge amount of (virtual) memory to do it. Radu From: Mario Rodriguez [mailto:[EMAIL PROTECTED] Sent: Monday, March 20, 2006 12:12 PMTo: user@xmlbeans.apache.orgSubject: optimizing memory consumption with XMLBeans Hi people, there is any way to configure XMLBeans to use SAX in order to feed business objects generated by the scomp tool ? What a I need is to optimizememory consumption because I'm feeding XML beans with huge XML files thanks -- Mario Rodriguez ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: Incorrect mail-archive URL on xmlbeans.apache.org
You are absolutely right, thanks for pointing it out. We have recently changed the links, and this is a fallout from that change. Should be fixed shortly. Radu -Original Message- From: Erik van Zijst [mailto:[EMAIL PROTECTED] Sent: Thursday, March 23, 2006 3:32 PM To: user@xmlbeans.apache.org Subject: Incorrect mail-archive URL on xmlbeans.apache.org staff, It appears that the link to the XMLBeans User List Archive on http://xmlbeans.apache.org/community/index.html is incorrect. It points to http://mail-archives.apache.org/mod_mbox/xml-xmlbeans-user/ while it should point to http://mail-archives.apache.org/mod_mbox/xmlbeans-user/ instead I think. cheers, Erik van Zijst -- Law of Procrastination: Procrastination avoids boredom; one never has the feeling that there is nothing important to do. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can I set noNamespaceSchemaLocation attribute (xmlbeans 1.0.4)
Actually, XmlBeans doesn't have specific APIs to deal with xsi:[noNamespace]schemaLocation attributes (maybe it should) You would have to set it as an ordinary non-Schema declared attribute, like that: XmlCursor c = root.newCursor(); c.insertAttributeWithValue(noNamespaceSchemaLocation, http://www.w3.org/2001/XMLSchema-instance;, yourValue); Radu -Original Message- From: Grant Lewis [mailto:[EMAIL PROTECTED] Sent: Thursday, March 23, 2006 6:46 AM To: XMLBeans List Subject: Can I set noNamespaceSchemaLocation attribute (xmlbeans 1.0.4) I'm actually stuck using version 1.0.3 bundled with weblogic 8.1. I'm calling a cold fusion web service that requires the noNamespaceSchemaLocation attibute be set on the root element of the request xml. Is there a way I can add the attribute to the root element before I call xmlText on the bean. Grant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: selectPath with FilterExpression using $this
Duh, so of course: - . represents the current node that the Xpath evaluator is processing - $this represents the node where the Xpath was started on and is something outside of the Xpath standard So, if you want to get the node having an attribute 'idref' with value equals to that of the 'id' attribute of XmlObject xo, what has been suggested at some point in this thread does in fact work (assuming the latest fixes and updates): xo.selectPath(//[EMAIL PROTECTED]/@id]) Radu -Original Message- From: Radu Preotiuc-Pietro Sent: Thursday, March 30, 2006 1:56 PM To: user@xmlbeans.apache.org Subject: RE: selectPath with FilterExpression using $this I was curious to try this myself with the new Saxon 8.6 integration (available from the SVN head only, for the moment) and what I found is that the path you are suggesting (//[EMAIL PROTECTED]/@id]) works (no exception) but for some reason doesn't return anything. On the other hand, //[EMAIL PROTECTED]'1' returns the expected result, so on one hand I am wondering if this is maybe a bug in the free version of Saxon and on the other you can use this to workaround the problem by doing .selectPath(//[EMAIL PROTECTED]' + node.getId() + '). If anyone else has other insights into why the original path does not work (with more Xpath/Saxon knowledge), I'd also be interested to know. Thanks, Radu -Original Message- From: Cezar Andrei Sent: Wednesday, March 29, 2006 3:30 PM To: user@xmlbeans.apache.org Subject: RE: selectPath with FilterExpression using $this Hi Siegfried, I'm not an expert in xpath/xquery but I'm pretty sure that $this doesn't represent the internal current node that is processed by the engine. So you'll probably want to rewrite the expression to something like this: xo.selectPath(.//[EMAIL PROTECTED]//@id]); As for $this, it's just a variable that is bound to the XmlObject that you are calling the selectPath method from. The '$this' construction is not in the latest XPath/Xquery spec so it was deprecated, instead . should be used. The current XmlObject can be bound to any user specified variable name as in the following example: XmlOptions options = new XmlOptions(); options.setXqueryCurrentNodeVar(myVariable); XmlObject[] res = xo.selectPath(declare variable $myVariable external; $myVariable//el1, options); Which is equivalent to: XmlObject[] res = xo.selectPath(.//el1, options); And to the following (since in the context of the xpath engine the xo is considered the root): XmlObject[] res = xo.selectPath(//el1, options); Since we don't control Saxon, we can't promise that expressions confirming to the spec will work. We can only work on making sure we make the right calls into Saxon. Cezar -Original Message- From: Siegfried Baiz [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 14, 2006 12:11 PM To: user@xmlbeans.apache.org Subject: selectPath with FilterExpression using $this Hello, for a given XmlObject xo with an ID-Attribute 'id', I've tried to launch the following xpath-expression: xo.selectPath(//[EMAIL PROTECTED]/@id]) in order to get all nodes (with idRef-Attribute) refering to my node xo. Unfortunatlly this expression seems not to work. I always get an java.lang.ArrayIndexOutOfBoundsException from the underlying net.sf.saxon.expr.XPathContextMajor.setLocalVariable(XPathContextMajor.j av a:213) At http://xmlbeans.apache.org/docs/2.0.0/guide/conSelectingXMLwithXQueryPat hX Path.html I found the following notice: Notice in the query expression that the variable $this represents the current context node (the XmlObject that you are querying from). In this example you are querying from the document level XmlObject. After reading that sentence I've been thinking, that $this is somehow similar to curent() in XSLT, but maybe a got the meaning wrong. Does anyone know whats the problem here rsp. is there a better way to accomplish the same thing? Thanks a lot, Siggi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice
RE: validation error, but validate line command says it's ok
Hard to say where you are wrong, since you give very little detail of what you are doing ;-) In fact, what the validate implementation does is parse the document provided in an XmlObject, then call .validate() on it (in addition to parsing the Schema files of course). So what I can suggest is make sure that you don't have some older/newer compiled Schemas on your classpath when you execute your java class, since XmlBeans does dynamic lookup of Schema information when validating documents. Radu -Original Message- From: Stefano Peruzzi [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 29, 2006 1:40 AM To: user@xmlbeans.apache.org Subject: validation error, but validate line command says it's ok Hi all, something strange is happening. When I parse my xml file from my java class, I obtain this error: D:\[...]\documenti\sbnmarc_response.xml:0: error: cvc-complex-type.4: Expected attribute: schemaVersion Of course, the file does have the schemaVersion attribute! I also tried the 'validate' line command (specifying the xsd file) and it says: sbnmarc_response.xml valid. Where am I wrong? Maybe I should specify the xsd file to parse() o validate() method in my class? (I don't know how) But the parse method is on a generated factory class, using 'scomp' command on the same xsd. I think XMLBeans should do the magic for me. Thanks for your help, Stefano ___ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Whichs JARs are required?
That can be improved indeed. Currently, the README lists the kit contents starting with two jars, saying clearly that you need them (xbean.jar and jsr173_1.0_api.jar). Then it makes the assumption that it's understood that these are the *only* two you need, but it's not clearly said anywhere what is what. I'll try and address this. Radu From: Wing Yew Poon Sent: Thursday, March 30, 2006 4:06 PMTo: user@xmlbeans.apache.orgSubject: RE: Whichs JARs are required? Hi Dan, You rightly point out a current deficiency in the setup instructions on the website. I hope this will be remedied soon. I think that at a minimum, you should have xbean.jar and jsr173_1.0_api.jar in your classpath. If in addition, you want to use Saxon for XPath/XQuery, you need to have xbean_xpath.jar in your classpath as well. - Wing Yew From: Paquette, Dan [mailto:[EMAIL PROTECTED] Sent: Thursday, March 30, 2006 3:34 PMTo: user@xmlbeans.apache.orgSubject: Whichs JARs are required? Ive been digging through things online and I cant seem to figure out which of the jars that come with XMLBeans 2.1.0 are required. There are five in the lib directory. I seem to run ok with just xbeans.jar but Im not doing too much yet. Which jars are necessary for the runtime user only? -Dan ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: too generic Object returned
Can you call '.validate()' on the root object and see if there are any errors? I suspect this to be the elementFormDefault problem... Radu -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, April 06, 2006 6:09 AM To: user@xmlbeans.apache.org Subject: Re: too generic Object returned Hello, I resolved this problem. In the Schema I had to change the schema tag to xs:schema targetNamespace=http://bookon.de/lmweb/regionlist; xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:bo=http://bookon.de/lmweb/regionlist; adding the namespace http://bookon.de/lmweb/regionlist And originally I did not specify any type for the element ZIEL I changed this to xs:element name=ZIEL type=bo:ZIEL minOccurs=0 maxOccurs=unbounded/ and now this is as expected. The 'ant test' goal runs without any error message. But... the next problem is at hand. The testprogramm (modfied SchemaEnumTest started through 'ant test') reads in a sample xml File with the right namespace. And all getter methods return null. Trying to access the very first element in the document does not throw an exception, but returns a null reference. The 'ant run' goal works perfectly reading in the sample xml File and passing it back out via tostring(). So I assume that the sample xml file is ok. Has anybody encountered something similar? I suspect it to be something really simple, but can't see it. Thanks for your help, Jürgen Jürgen Hoffmann schrieb: Hello, get an incompatible types error which I am now hunting for a few hours, but can't resolve. I installed xmlbeans-2.1.0 and tried the SchemaEnum sample. It works perfectly. Then I copied the SchemaEnum sample to a new folder in the samples folder and started modifying it piece by piece. And now I get this incompatible types error. [javac] C:\Programme\ApacheSoftwareFoundation\xmlbeans-2.1.0\samples\BookonTra velIt\src\de\bookon\travelit\BookonTravelItTest.java:50: incompatible types found : org.apache.xmlbeans.XmlObject[] required: de.bookon.lmweb.regionlist.ZIEL[] ZIEL[] ziele = root.getZIELArray(); I looked in the created sources folder and found that the method getZIELArray() is indeed created returning such a generic object: org.apache.xmlbeans.XmlObject[]. When I compare this to the enumeration sample there a comparable method is the getLineItemArray() which returns a org.apache.xmlbeans.samples.enumeration.schemaenum.easypo.LineItem[] and not such a generic object like org.apache.xmlbeans.XmlObject[] Where can I influence this? The getZIELArray() method should return an object of type de.bookon.lmweb.regionlist.ZIEL[] as the compiler rightful says. The Schema starts with ?xml version=1.0 encoding=ISO-8859-1? xs:schema targetNamespace=http://bookon.de/lmweb/regionlist; xmlns:xs=http://www.w3.org/2001/XMLSchema; Thanks for your help, Jürgen ___ SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192 - 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] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: in a tomcat servlet with error
Hm, is this intermittent, or does it happen consistently? I assume you don't have any modifications to XmlBeans, I am trying to see if this could be a synchronization problem... Thanks, Radu -Original Message- From: Rolf Schumacher [mailto:[EMAIL PROTECTED] Sent: Thursday, April 06, 2006 11:47 AM To: user@xmlbeans.apache.org Subject: in a tomcat servlet with error trying to produce an XML file according to schema. Works fine when I start the generation from within a main method. Fails when I start it from a servlet invoked by Tomcat. Built xmlbeans from svn or cvs 2005-12-30. Linked all jars from build/lib into WEB-INF/lib. The generated jar containing the types is linked as well. I got the error in the first line of my code that touches xmlbeans: MyTypeDocument myTypeDocument = MyTypeDocument.Factory.newInstance(); This is the error: java.lang.NullPointerException ...schema.SchemaTypeImpl.getTypeSystem(SchemaTypeImpl.java:616) ...schema.SchemaTypeImpl.getJavaImplClass(SchemaTypeImpl.java:1708) ...schema.SchemaTypeImpl.getJavaImplConstructor(SchemaTypeImpl.java:1724 ) ...schema.SchemaTypeImpl.createUnattachedNode(SchemaTypeImpl.java:1852) ...schema.SchemaTypeImpl.createTypeStoreUser(SchemaTypeImpl.java:1804) ...store.Xobj.setStableType(Xobj.java:1390) ...store.Cur.setType(Cur.java:2497) ...store.Cur.setType(Cur.java:2482) ...store.Locale.newInstance(Locale.java:630) ...store.Locale.newInstance(Locale.java:606) ...schema.SchemaTypeLoaderBase.newInstance(SchemaTypeLoaderBase.java:198 ) with ... = at org.apache.xmlbeans.impl. How to narrow the cause of this error? Any help welcome. Rolf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: too generic Object returned
Well, since validation is a somewhat expensive operation, parse() doesn't do it by default, that's why you should call validate() explicitly. As far as elementFormDefault is concerned, if your partner's document looks like: ns:root xmlns:ns= child1.../child1 child2.../child2 ... /ns:root then that corresponds to elementFormDefault=unqualified (or no elementFormDefault at all since unqualified is the default) but if the document looks like ns:root xmlns:ns= ns:child1.../ns:child1 ns:child2.../ns:child2 ... /ns:root or, equivalently root xmlns= child1.../child1 child2.../child2 ... /root then you do need the elementFormDefault=qualified, both to validate the document and to make the binding work. Radu -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 11, 2006 2:56 AM To: user@xmlbeans.apache.org Subject: Re: too generic Object returned Hello Radu, root.validate() yields true with elementFormDefault=qualified in the schema. root.validate() yields false without elementFormDefault=qualified. I am not quite sure what this means in respect of the XML documents we get from our partners. They are of very simple structure. When I look at them they seem to be valid XML but maybe not valid according to the schema. But another question arises: Should not the parse() method throw a sort of document-not-valid-exception instead of just giving the impression that everything is allright? Or do I miss something here? Jürgen Radu Preotiuc-Pietro schrieb: Can you call '.validate()' on the root object and see if there are any errors? I suspect this to be the elementFormDefault problem... Radu -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, April 06, 2006 6:09 AM To: user@xmlbeans.apache.org Subject: Re: too generic Object returned Hello, I resolved this problem. In the Schema I had to change the schema tag to xs:schema targetNamespace=http://bookon.de/lmweb/regionlist; xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:bo=http://bookon.de/lmweb/regionlist; adding the namespace http://bookon.de/lmweb/regionlist And originally I did not specify any type for the element ZIEL I changed this to xs:element name=ZIEL type=bo:ZIEL minOccurs=0 maxOccurs=unbounded/ and now this is as expected. The 'ant test' goal runs without any error message. But... the next problem is at hand. The testprogramm (modfied SchemaEnumTest started through 'ant test') reads in a sample xml File with the right namespace. And all getter methods return null. Trying to access the very first element in the document does not throw an exception, but returns a null reference. The 'ant run' goal works perfectly reading in the sample xml File and passing it back out via tostring(). So I assume that the sample xml file is ok. Has anybody encountered something similar? I suspect it to be something really simple, but can't see it. Thanks for your help, Jürgen Jürgen Hoffmann schrieb: Hello, get an incompatible types error which I am now hunting for a few hours, but can't resolve. I installed xmlbeans-2.1.0 and tried the SchemaEnum sample. It works perfectly. Then I copied the SchemaEnum sample to a new folder in the samples folder and started modifying it piece by piece. And now I get this incompatible types error. [javac] C:\Programme\ApacheSoftwareFoundation\xmlbeans-2.1.0\samples\BookonTr a velIt\src\de\bookon\travelit\BookonTravelItTest.java:50: incompatible types found : org.apache.xmlbeans.XmlObject[] required: de.bookon.lmweb.regionlist.ZIEL[] ZIEL[] ziele = root.getZIELArray(); I looked in the created sources folder and found that the method getZIELArray() is indeed created returning such a generic object: org.apache.xmlbeans.XmlObject[]. When I compare this to the enumeration sample there a comparable method is the getLineItemArray() which returns a org.apache.xmlbeans.samples.enumeration.schemaenum.easypo.LineItem[] and not such a generic object like org.apache.xmlbeans.XmlObject[] Where can I influence this? The getZIELArray() method should return an object of type de.bookon.lmweb.regionlist.ZIEL[] as the compiler rightful says. The Schema starts with ?xml version=1.0 encoding=ISO-8859-1? xs:schema targetNamespace=http://bookon.de/lmweb/regionlist; xmlns:xs=http://www.w3.org/2001/XMLSchema; Thanks for your help, Jürgen ___ SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail
RE: Updating Target Namespace and xmlns:tns
Well, these relationships between xmlns:tns and targetNamespace and import namespace are all conventions, they are not in the spec. So while they may be common, we cannot necessarily assume that what you want is exactly the behavior that anyone else would want. But you can implement your own helper methods to set up the 'xmlns' declarations at the same time you are editing the other values. See XmlCursor.insertNamespace(). Radu -Original Message- From: sirkware [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 11, 2006 1:41 AM To: user@xmlbeans.apache.org Subject: Updating Target Namespace and xmlns:tns As a follow-up question, is it also possible to update the namespace related to the import? For example I have these declarations: xml-fragment targetNamespace=urn:myTargetnamespace elementFormDefault=qualified attributeFormDefault=unqualified version=01.03 xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:tns=urn:myTargetnamespace xmlns:ssdh=urn:myDocument xs:import namespace=urn:myDocument schemaLocation=../MyDocument.xsd/ and so on.. Here, I would also like to update xmlns:ssdh namespace whenever I update my import namespace? Is it possible with xmlbeans? I can only see the imports and targetnamespace in my binding and I dont see the namespaces with the prefixes. Any help would deeply be appreciated. Thanks. Regards, Elvin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: New release: v2.2
It's working for me on Linux, Thanks, Radu From: Cezar Andrei Sent: Monday, June 12, 2006 12:45 PMTo: dev@xmlbeans.apache.orgCc: user@xmlbeans.apache.orgSubject: RE: New release: v2.2 Here are the files for XMLBeans v2.2.0-RC1: http://xmlbeans.apache.org/dist/ Please give them a try and let me know is something is missing or not working properly. If somebody can try them in a UNIX environment and let us know would be very helpful. Thank you, Cezar From: Cezar Andrei Sent: Wednesday, June 07, 2006 5:11 PMTo: dev@xmlbeans.apache.orgSubject: New release: v2.2 Hi all, Its been a while since last release, there have been quite a few bug fixes and some new features in the meantime. If there are no objections in the next few days Ill make the release candidate files and publish them on the website. New jars will be made if changes are need, when theyll be ok Ill call for a vote. Thanks, Cezar___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: Parsing of data containing entity references
Actually there is a JIRA talking about this: http://issues.apache.org/jira/browse/XMLBEANS-176 (whose priority I have just updated). I would want to point out though that conversion is not the right way to think about it, since XmlBeans doesn't 'remember' whether originally the text was encoded using a CDATA or not (this is not part of the XML infoset), so the problem the code is trying to solve is: given a String containing characters that need 'special' handling, should CDATA be used or character references? (both being equivalent, from an XML point of view) Currently, the answer is this: if the length of the string to be encoded is at least 32 characters _and_ there are at least 5 characters that need encoding _and_ at least 1% of the characters need encoding, then a CDATA is used. (see org.apache.xmlbeans.impl.store.Saver.java:1282) Radu -Original Message- From: Coolbergen, Christopher [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 07, 2006 12:14 AM To: user@xmlbeans.apache.org Subject: Parsing of data containing entity references Hi, I have an XML document with an element containing a large amount of text that includes entity references eg: descriptionThere are 2 ADRapos;S/description Whenever I parse the XML as an InputStream it places the text within a ![CDATA[ section and resolves the entity references thus: description![CDATA[ There are 2 ADR'S]]/description I do not wish this to happen, and would like the string to remain as it originally was with the entity references before being parsed. Is there some setting that I can use to stop the conversion to CDATA etc happening? Thanks in advance, Chris -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: passing xml as a string to XML Beans
You can't alter this limit currently, I'm attaching my reply to a different thread, I think it also makes sense in this thread. Thanks, Radu From: Larner, Ross S [mailto:[EMAIL PROTECTED] Sent: Thursday, June 08, 2006 10:41 AMTo: user@xmlbeans.apache.orgSubject: RE: passing xml as a string to XML Beans Jacob, Thanks for the reply. Actually, I don't want to change the schema, I just want to be able to provide structured data in the statusMessage element. I think I may have found the solution, referenced in the thread: http://www.mail-archive.com/user@xmlbeans.apache.org/msg00789.html wherein all the tags are converted to their entity equivalents, e.g. becomes lt; Does anyone know of a way to set the limit at which XMLBeans switches to CDATA to be unlimited? Thanks, Ross 858-831-2456 From: Jacob Danner [mailto:[EMAIL PROTECTED] Sent: Thursday, June 08, 2006 10:22 AMTo: user@xmlbeans.apache.orgSubject: RE: passing xml as a string to XML Beans Hi Ross, It appears as though you are trying to add elements to Status message. Is this correct? Since you have already compiled the schema and are creating XML for the type docAckHdr, I believe what you are trying to do in this code fragment will cause your xml instance to fail validation. If you wish to have elements in your Status Message type, they should be defined in the schema. I think your schema probably looks something like: xs:element name="StatusMessage" type="xs:string"/ you may want to consider changing it to xs:element name="StatusMessage" type="tns:errorType" or something to this affect where you are going to define the shape of the XML you are expecting. But in answer to your query, you are seeing this because you are setting the value for an xs:string type. Strings should follow entitization rules and that is why you are seeing what you are seeing below. My suggestion is to modify your schema, but if you wish to add true elements inStatusMessage (and failxsd validation) you can do soeasily via the XmlCursorand/or DOM APIs. For example, DocAckHdr.newDomNode(); Good luck, -Jacobd From: Larner, Ross S [mailto:[EMAIL PROTECTED] Sent: Thursday, June 08, 2006 9:51 AMTo: user@xmlbeans.apache.orgSubject: passing xml as a string to XML Beans I am a new user of XMLBeans, previously having used XMLSpy to build Java to XML helper classes.. I am having trouble passing XML strings to XMLBeans. When I try to set a string field (statusMessage)to: docAckHdr.addStatusMessage("errortypeBadSku/type/error"); the output is: statusMessagelt;errorlt;typeBadSkult;/typelt;/error/statusMessage the first weird thing is that the is not converted to gt; , but it gets weirder. When I try to add a third xml element: docAckHdr.addStatusMessage("errortypeBadSku/typemessAbadskunumber/mess/error"); the output is: statusMessage![CDATA[errortypeBadSku/typemessAbadskunumber/mess/error]]/statusMessage I don't want the CDATA tag. Is there a way to turn it off? And how do I get the greater than symbol to convert? This same statement worked well in XMLSpy. Thanks, Ross ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. -- this email delivered by hermes ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. ---BeginMessage--- Title: RE: Parsing of data containing entity references Actually there is a JIRA talking about this: http://issues.apache.org/jira/browse/XMLBEANS-176 (whose priority I have just updated). I would want to point out though that conversion is not the right way to think about it, since XmlBeans doesn't 'remember' whether originally the text was encoded using a CDATA or not (this is not part of the XML infoset), so the problem the code is trying to solve is: given a String containing characters that need 'special' handling, should CDATA be used or character references? (both being equivalent, from an XML point of view) Currently, the answer is this: if the length of the string to be encoded is at least 32 characters _and_ there are at least 5 characters
RE: Default value support in java classes supported?
You are very close. Keep in mind that defaults are not associated with types, but with elements/attributes. Other than that, once you use it in the context of an enclosing element, it should work like you expect. If you're still having trouble, could you post a code sample and we'll go from there? Radu From: Paul Grillo [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 13, 2006 3:04 PMTo: user@xmlbeans.apache.orgSubject: Default value support in java classes supported? I'm adding a field to a previous schema and am adding an element to an existing ComplexType at then end. What i would like is that any code that begins using the generated classes will automatically generate the this ComplexType with the added simple element defaulting to a certain value. That is, i don't want all previous users to have to go and change their code when i know what the default should be. I figured i'd add the element in the following way. I assumed that the default="E" would, in some way, get me what i want. Well, if i instantiate the object and read the type, it is, of course null. So, is there any way i can accomplish this? Is there any way that i can add an element to a complex type and have the xmlbeans generated classes handle a default value for it? thanks for any help. xs:element name="Type" default="E" minOccurs="1" maxOccurs="1" xs:annotation xs:documentationError Type, must be (E)rror, (I)nformational, (W)arning/xs:documentation /xs:annotation xs:simpleType xs:restriction base="xs:string" xs:enumeration value="I"/ xs:enumeration value="E"/ xs:enumeration value="W"/ /xs:restriction /xs:simpleType /xs:element ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: [VOTE] Release of XMLBeans 2.2.0
+1 from me. Radu -Original Message- From: Cezar Andrei Sent: Monday, June 19, 2006 10:12 PM To: dev@xmlbeans.apache.org; user@xmlbeans.apache.org; XML-Beans PMC Subject: [VOTE] Release of XMLBeans 2.2.0 Please send your vote for the release of XMLBeans version 2.2.0, as it currently exists on http://xmlbeans.apache.org/dist/ (xmlbeans-2.2.0-RC1*). The files have been available for the last few days, they have been checked and tried out on different environments. If the vote closes positive the files will be renamed, digitally signed and uploaded on the distribution sites. This vote will close on end of Thursday, June 22 '06 (approx 72 hours). For the vote to pass, we must reach majority approval, which requires at least 3 binding +1 votes and more +1 votes than -1 votes. Binding votes are those cast by XMLBeans committers or members of the PPMC, but everyone is encouraged to vote their opinion. Please respond with: [ ] +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 +1! Cezar ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Dynamically generating java classes from XSD file using XmlBeans
Also XmlBeans.compileXmlBeans() is a good place to look at because, unlike the script, is part of the public API which means backards-compatbility and better documentation. Radu -Original Message- From: Arif Shaon [mailto:[EMAIL PROTECTED] Sent: Friday, June 30, 2006 5:09 PM To: user@xmlbeans.apache.org Subject: RE: Dynamically generating java classes from XSD file using XmlBeans Thank you very much both. Its really helpful. Cheers Arif On Jul 1 2006, Wing Yew Poon wrote: Arif, Nathan is right. If you look at the scomp script, it basically calls java on org.apache.xmlbeans.impl.tool.SchemaCompiler with your arguments. Look at the xmlbeans source in the svn repository. SchemaCompiler.java is under the src/xmlcomp/ hierarchy. SchemaCompiler has a static nested class SchemaCompiler.Parameters. What you need to do is to create a SchemaCompiler.Parameters instance, set its fields appropriately, and then call compile() with your parameters. Good luck. - Wing Yew -Original Message- From: Nathan Sowatskey [mailto:[EMAIL PROTECTED] Sent: Friday, June 30, 2006 3:57 AM To: user@xmlbeans.apache.org Subject: Re: Dynamically generating java classes from XSD file using XmlBeans Hi Imagine that the CLI tool you use is really just a shell script calling java on a java class file which has a main that takes the arguments of the file that you want to compile, and then reads and compiles it. So, what you want to do is find the java class that is invoked by the script, and replicate what its main() does. You can also invoke the java compiler as a call to it's main, and then use reflection to invoke your new class. The rest is an exercise for the reader :-) Regards Nathan Nathan Sowatskey - Technical Leader, NMTG CTO Engineering - +34-638-083-675, +34-91-201-2139 - AIM NathanCisco - [EMAIL PROTECTED] On 30 Jun 2006, at 12:46, Arif Shaon wrote: Hi, I am fairly new to XMLBEans. I know one can generate java classes from xsd (XML SChema) file using scomp. But I was wondering if there is any way it would be done on the fly. For Example, the user would be able to specify the file path for the XSD file to the program, and the program would then load the file, compile it, generate the java classes and manipulate the classes as required. Could this be done? Any help would be greatly appreciated. Best Regards Arif - 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] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Arif Shaon Long-term Metadata Management Computer Science University of Reading - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: New to xmlbeans - please help me!
How about posting the error that you're getting or looking it up in the FAQ? If you weren't able to get the examples on the site to work (they *do* work), it's unlikely that sending a new example will make the difference. Radu From: Loiane [mailto:[EMAIL PROTECTED] Sent: Friday, June 30, 2006 12:22 PMTo: user@xmlbeans.apache.orgSubject: New to xmlbeans - please help me! Hi everyone!I'm new to xmlbeans and i'm having some problems here.I found some examples how to use xml beans but no one is working.Can anyone please send me a working example how to use xmlbeans?greetings,Loiane ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: the difference between xmlbeans and xbean?
Hm, it's the first time I hear about this, it looks like it's a new Codehaus project and it has nothing to do with Apache XMLBeans. What made you think they do the same things? Radu -Original Message- From: SP Liu [mailto:[EMAIL PROTECTED] Sent: Sunday, July 02, 2006 10:43 PM To: user@xmlbeans.apache.org Subject: the difference between xmlbeans and xbean? Hullo!can anyone tell me what is the difference between xmlbeans and codehaus' XBean project? It seems that they do the same things. -- View this message in context: http://www.nabble.com/the-difference-between-xmlbeans-and-xbean--tf18827 82.html#a5146785 Sent from the Xml Beans - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XMLBeans 2.2.0 and SaxonB8.6.1 - selectPath() nol longer working?
The documentation lags behind. I'll make sure it gets fixed. Radu -Original Message- From: Baker, Jon [mailto:[EMAIL PROTECTED] Sent: Monday, July 03, 2006 5:40 PM To: user@xmlbeans.apache.org Subject: RE: XMLBeans 2.2.0 and SaxonB8.6.1 - selectPath() nol longer working? Wing Yew, Thanks for our help. Adding the saxon8-dom.jar to my classpath fixed it. Is this documented somewhere? Or is the documentation just a bit behind version 2.2.0 of XmlBeans? Thanks, Jon Jon Baker INFOSEC Eng/Scientist, Sr. The MITRE Corporation [EMAIL PROTECTED] -Original Message- From: Wing Yew Poon [mailto:[EMAIL PROTECTED] Sent: Monday, July 03, 2006 8:15 PM To: user@xmlbeans.apache.org Subject: RE: XMLBeans 2.2.0 and SaxonB8.6.1 - selectPath() nol longer working? Jon, since you were using xmlbeans 2.1 before, presumably you have xbean.jar and jsr173_1.0_api.jar in your classpath, together with xbean_xpath.jar and saxon8.jar; now you need saxon8-dom.jar as well. If you have all the jars in your classpath and are experiencing your problem, then I don't know what else to tell you. It may be a problem with saxon rather than xmlbeans, but I know rather little about xpath and saxon and I can't say. - Wing Yew -Original Message- From: Baker, Jon [mailto:[EMAIL PROTECTED] Sent: Monday, July 03, 2006 9:44 AM To: user@xmlbeans.apache.org Subject: XMLBeans 2.2.0 and SaxonB8.6.1 - selectPath() nol longer working? I just upgraded to XmlBeans 2.2.0 from XmlBeans 2.1.0. My code that used the XmlObject.selectPath(String path) method no longer works. Is there an additional step I need to take to use selectPath in XmeBeans 2.2.0 with saxonb8.6.1? In the past I have simply built a jar of XmlBeans classes for our schema using the scomp utility and then included this in my projects. Our schema is quite large so I have not attached it. I will gladly do so if you are interested. here is the bit of code that is causing the trouble: -begin code String xpath = ./[EMAIL PROTECTED]' + id + \']; XmlObject[] objs = doc.getOvalDefinitions().getDefinitions().selectPath(xpath); -end code Here is error I get: java.lang.RuntimeException: net.sf.saxon.trans.DynamicError: The context item for axis step descendant::element() is undefined at org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectNodes(XBeansXPa t h.java:102) at org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectPath(XBeansXPat h .java:108) at org.apache.xmlbeans.impl.store.Path$SaxonPathImpl$SaxonPathEngine.next ( Path.java:496) at org.apache.xmlbeans.impl.store.Cursor._toSelection(Cursor.java:931) at org.apache.xmlbeans.impl.store.Cursor._toNextSelection(Cursor.java:920 ) at org.apache.xmlbeans.impl.store.Cursor._hasNextSelection(Cursor.java:91 2 ) at org.apache.xmlbeans.impl.store.Cursor.hasNextSelection(Cursor.java:265 2 ) at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase . java:433) at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase . java:415) at org.mitre.oval.xmlapi.DefinitionApi.updateXml(DefinitionApi.java:565) Thanks for any help, Jon Jon Baker INFOSEC Eng/Scientist, Sr. The MITRE Corporation [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ _ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - 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] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. -
RE: XPath and Namespace
See my previous post (7/21) for an example provided by Tony Dean with namespaces in XPaths. Here is the relevant code: Sring ns = "declare namespace ns='http://tempuri.org/myService';"; String xpath = ns + "$this/ns:copyintoout/ns:[EMAIL PROTECTED]'Tony']"; XmlObject[] selections = soapBody.selectPath(xpath); There is nothing for that in XmlOptions because there is a "semi-standard" way of doing it by using 'declare namespace pipeline="http://nrg.wustl.edu/pipeline"' and we stick to that. Hope this helps, Radu From: Mohana Ramaratnam [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 18, 2006 8:06 AMTo: user@xmlbeans.apache.orgSubject: XPath and Namespace If I have an instance document like so: Pipeline xmlns="http://nrg.wustl.edu/pipeline" xmlns:prov="http://www.nbirn.net/prov" xmlns:xdat="http://nrg.wustl.edu/xdat" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nrg.wustl.edu/xnat C:\\schema\pipeline.xsd" parameters parameter namefidldir/name value/fidl/fidl_2.60/bin/value /parameter parameter namerlbdir/name value/Pipeline/parameters/parameter[name='fidldir']/value/text() /value /parameter /parameters /Pipeline And I want to evaluate the xpath _expression_: /Pipeline/parameters/parameter[name='fidldir']/value/text() Is it necessary for the namespace prefix of pipeline: to be present in the _expression_ /Pipeline/parameters/parameter[name='fidldir']/value/text() for xpath to be evaluated correctly? Ie should the _expression_ be: /pipeline:Pipeline/pipeline:parameters/pipeline:parameter[pipeline:name='fidldir']/pipeline:value/text() (as in the samples) How do I set the namespace so that the instance document xpath _expression_ need not have the namespace prefixed. I have looked into XmlOptions and didnt find anything useful. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: XMLBeans DOM Document
Mohana, I would look in the "out" byte array and see what it looks like. By doing xo.save(...) (by the way, who is "xo"?) you completely bypass XmlBeans, so it's a matter of whatdocument are you really loading. It would be more interesting, from an XmlBeans perspective,to know what results you get from XmlObject.getDomNode() and XmlObject.newDomNode() Radu From: Mohana Ramaratnam [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 18, 2006 12:59 PMTo: user@xmlbeans.apache.orgSubject: XMLBeans DOM Document I am trying to get a DOM document to be then used with Xalans XPathAPI. This is the code that I have: String xmlFile = "dom.xml"; XmlObject xmlObject = new XmlReader().read(xmlFile); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); // MUST be TRUE or can't get back to bean land factory.setNamespaceAware(true); DocumentBuilder builder = factory.newDocumentBuilder(); // Switch to org.w3c.dom.Document - xmlbeans.getDomNode() doesn't // really seem to give you this ByteArrayOutputStream out = new ByteArrayOutputStream(); xo.save(out,new XmlOptions().setSavePrettyPrint()); Document doc = builder.parse(new InputSource(new ByteArrayInputStream(out.toByteArray(; NodeList nodes = XPathAPI.selectNodeList(doc,"/Pipeline"); System.out.println("Number of nodes is " + nodes.getLength()); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = dbf.newDocumentBuilder(); Document doc1 = builder.parse( new File(xmlFile)); NodeList nodes1 = XPathAPI.selectNodeList(doc1,"/Pipeline"); System.out.println("Number of nodes is " + nodes1.getLength()); I get two different answers in the system out. Any ideas as to what could be wrong in creating a DOM document from a XMLBeans object? ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: Help with xmlbeans 2.2.0
Title: RE: Help with xmlbeans 2.2.0 I am using JDK1.4.2_03, myself. Radu From: Tony Dean [mailto:[EMAIL PROTECTED] Sent: Monday, July 24, 2006 3:30 PMTo: user@xmlbeans.apache.orgSubject: RE: Help with xmlbeans 2.2.0 Wing Yew, Are you using 1.4.x or 1.5 jre? Maybe that makes a difference. From: Wing Yew Poon [mailto:[EMAIL PROTECTED] Sent: Monday, July 24, 2006 1:24 PMTo: user@xmlbeans.apache.orgSubject: RE: Help with xmlbeans 2.2.0 Mikael, if you are using XMLBeans 2.1, then you should use Saxon 8.1.1; but if you are using XMLBeans 2.2, then you should use Saxon 8.6.1 (or later - although I haven't tried anything later). Some Saxon classes changed packages between 8.1 and 8.6, and so it's not possible to maintain compatibility. -WingYew From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 24, 2006 7:55 AMTo: user@xmlbeans.apache.orgSubject: SV: Help with xmlbeans 2.2.0 Hi, did you try using Saxon 8.1.1 instead? Regards, Mikael Från: Tony Dean [mailto:[EMAIL PROTECTED]Skickat: må 2006-07-24 14:02Till: user@xmlbeans.apache.orgÄmne: RE: Help with xmlbeans 2.2.0 yes, I didn't have sasxon-dom.jar at first, but added it and it still fails with classcast exception.-Original Message-From: Wing Yew Poon [mailto:[EMAIL PROTECTED]]Sent: Sunday, July 23, 2006 5:52 PMTo: user@xmlbeans.apache.orgSubject: RE: Help with xmlbeans 2.2.0Tony,do you have both saxon8.jar and saxon8-dom.jar in your classpath?- Wing Yew-Original Message-From: Tony Dean [mailto:[EMAIL PROTECTED]]Sent: Saturday, July 22, 2006 5:00 PMTo: dev@xmlbeans.apache.org; user@xmlbeans.apache.orgSubject: RE: Help with xmlbeans 2.2.0Radu,Thanks for the response!On item #2, you are right. I should have read deeper into my options on inserting element content.On item #1, I tried using the exact same jars as you by subsetting my list. I am using jars from xmlbeans 2.2.0 and saxon 8.6.1 as the documentation suggests. What verson of saxon jars are you using?In any event I'm getting a classcast exception:Caused by: java.lang.ClassCastException:org.apache.xmlbeans.impl.store.Xobj$DocumentFragXobj atorg.apache.xmlbeans.impl.store.DomImpl._node_getOwnerDocument(DomImpl.java:1180) atorg.apache.xmlbeans.impl.store.Xobj$NodeXobj.getOwnerDocument(Xobj.java:2568) atnet.sf.saxon.dom.DOMObjectModel.unravel(DOMObjectModel.java:137) at net.sf.saxon.Controller.unravel(Controller.java:1291) at net.sf.saxon.value.Value.convertToBestFit(Value.java:1025) atnet.sf.saxon.value.Value.convertJavaObjectToXPath(Value.java:865) at net.sf.saxon.trans.Variable.setValue(Variable.java:119) atorg.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectNodes(XBeansXPath.java:95) atorg.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectPath(XBeansXPath.java:108) atorg.apache.xmlbeans.impl.store.Path$SaxonPathImpl$SaxonPathEngine.next(Path.java:496) atorg.apache.xmlbeans.impl.store.Cursor._toSelection(Cursor.java:931) atorg.apache.xmlbeans.impl.store.Cursor._toNextSelection(Cursor.java:920) atorg.apache.xmlbeans.impl.store.Cursor._hasNextSelection(Cursor.java:912) atorg.apache.xmlbeans.impl.store.Cursor.hasNextSelection(Cursor.java:2652) atorg.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:433) atorg.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:415) atcom.sas.soa.wsdl.impl.RequestImpl.update(RequestImpl.java:244) ... 16 moreAny ideas?Thank you very much.-Tony-Original Message-From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED]]Sent: Friday, July 21, 2006 11:11 PMTo: dev@xmlbeans.apache.org; user@xmlbeans.apache.orgSubject: RE: Help with xmlbeans 2.2.0No, it's not dead, as you can see, but yeah sometimes an answer may take longer to come by...1. This should work, and in fact I can get the exact code that you are providing to work on my box. I am using XmlBeans 2.2.0 and this is myclasspath:$XMLBEANS_HOME/build/lib/xbean.jar:$XMLBEANS_HOME/build/lib/jsr173_1.0_api.jar:xmltypes.jar:.:$XMLBEANS_HOME/external/lib/saxon8.jar:$XMLBEANS_HOME/external/lib/saxon8-dom.jar:$XMLBEANS_HOME/build/lib/xbean_xpath.jar2. According to XmlCursor.setTextValue(String) JavaDoc"For elements that have nested children this first removes all the content of the element and replaces it with the given text."So based on that I would say it is not a bug. If you want to insert text, take a look atXmlCursor.insertChars(String)Radu-Original Message-From: Tony Dean [mailto:[EMAIL PROTECTED]]Sent: Wednesday, July 19, 2006 2:22 PMTo: Tony Dean; dev@xmlbeans.apache.org; user@xmlbeans.apache.orgCc: [EMAIL PROTECTED]Subject: RE: Help with xmlbeans 2.2.0Is this listserve dead? Where do you get help with xmlbeans these days?thanks. _ From: Tony Dean Sent: Friday, July 14, 2006 9:05 PM To: 'dev@xmlbeans.apache.org'; 'user@xmlbeans.apache.org' Subject: Help with xmlbeans 2.2.0 Hi, Could some
RE: Saxon Download link on install instructions page
I have updated this. Also, I wanted to remind people that there are a few interesting examples on the website [http://xmlbeans.apache.org/samples/index.html] including an XPath/XQuery one; these are very useful to get started. Radu -Original Message- From: Baker, Jon [mailto:[EMAIL PROTECTED] Sent: Monday, July 03, 2006 10:19 AM To: user@xmlbeans.apache.org Subject: Saxon Download link on install instructions page It looks like the link to download Saxon needs to be updated on the installation instructions page. http://xmlbeans.apache.org/documentation/conInstallGuide.html The link points to Saxonb 8.1.1 I assume it should point to saxonb8.6.1 Sorry I was not sure who to send this too... Jon Jon Baker INFOSEC Eng/Scientist, Sr. The MITRE Corporation [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XPath returns XMLObject instead of the actual Type
Well, Rao, looks like you are a "victim" of the elementFormDefault. In XmlSchema, by default, when you declare a localelement "Server" (like in your Schema) it goes into the "default namespace" rather than the "target namespace". You can do two things: 1. if you want to keep the Schema unmodified, then you need to change your document from iw:Server to Server and your XPath correspondingly 2. if you want to keep the document and the XPath the same, then you need to change your Schema to either make "Server" a global element and then use element ref="tns:Server" instead of element name="Server". OR put elementFormDefault="qualified", either on the declaration of the element or on the top-level schema In general, validating the document upon loading (via iwf.validate()) is a good idea in case you think something is amiss. Validation is not done by default by XmlBeans but it is easy to do it, and has the benefitof providingdetailed error messages with line and column numbers to help you figure out what's wrong. Radu From: Rama Mohan Rao Peruri [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 26, 2006 9:15 PMTo: user@xmlbeans.apache.orgSubject: XPath returns XMLObject instead of the actual Type Hi, I am new to XmlBeans. I like what I see so far. I am having a problem getting XmlBeans to return the actual type (ServerType) for my XPath query. What I get is XmlObject. Obviously, I am making some mistake. But what is it? Please help J J 1. My Code: String queryExpression = "declare namespace iw='http://www.rao.com/iwf/xml-config';" + "./iw:iwf/iw:Server"; XmlOptions xopt = new XmlOptions(); xopt.setSaveOuter(); xopt.setSaveUseOpenFrag(); xopt.setUseDefaultNamespace(); XmlObject[] xo = idoc.selectPath(queryExpression, xopt); System.out.println(xo.getClass().getName()); System.out.println(xo[0].toString()); 2. Output: When querying for the IW:IWF elements, the output is [Lcom.rao.iwf.xmlConfig.IwfType; xml-fragment xsi:schemaLocation="http://www.dbs.com/iwf/xml-config IwfConfigXml.xsd" xmlns:iw="http://www.dbs.com/iwf/xml-config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude" . More lines deleted When querying for the IW:IWF / IW:Server elements, the output is [Lorg.apache.xmlbeans.XmlObject; xml-fragment id="datadb" provider="oracle-db" host="localhost" port="1521" instance="ora92" user-id="swpro" password="swpro" xmlns:iw="http://www.dbs.com/iwf/xml-config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude"/ Notice that the ClassName is XmlObject and not ServerType (which I expect). 3. XSD ?xml version = "1.0" encoding = "UTF-8"? xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.rao.com/iwf/xml-config" xmlns:iwf="http://www.rao.com/iwf/xml-config" xsd:element name="iwf" type="iwf:IwfType" / xsd:complexType name="IwfType" xsd:sequence xsd:element name="Server" type="iwf:ServerType" minOccurs="0" maxOccurs="unbounded"/ /xsd:sequence /xsd:complexType xsd:complexType name="ServerType" xsd:attribute name="id" type="xsd:string" / xsd:attribute name="provider" type="xsd:string" / /xsd:complexType /xsd:schema 4. XML ?xml version="1.0" encoding="UTF-8"? iw:iwf xmlns:iw="http://www.dbs.com/iwf/xml-config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude" xsi:schemaLocation="http://www.dbs.com/iwf/xml-config IwfConfigXml.xsd" !-- SERVERS -- iw:Server id="datadb" provider="oracle-db"/ /iw:iwf Best Regards Rao (Peruri Rama Mohan Rao) CONFIDENTIAL NOTE: The information contained in this email is intended only for the use of the individual or entity named above and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete the mail. Thank you. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: why are and apostroph not escaped in attributes ?
Hm, I think you mean XMLBeans is not doing the MUST, for compatibility, be escaped using either gt; or a character reference when it appears in the string ]] in content, when that string is not marking the end of a CDATA section part, right? But the rest is done as per spec. Radu -Original Message- From: Maarten Bosteels [mailto:[EMAIL PROTECTED] Sent: Thursday, July 27, 2006 4:20 AM To: user@xmlbeans.apache.org Subject: Re: why are and apostroph not escaped in attributes ? From http://www.w3.org/TR/REC-xml/ The ampersand character () and the left angle bracket () MUST NOT appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they MUST be escaped using either numeric character references or the strings amp; and lt; respectively. The right angle bracket () MAY be represented using the string gt;, and MUST, for compatibility, be escaped using either gt; or a character reference when it appears in the string ]] in content, when that string is not marking the end of a CDATA section. In the content of elements, character data is any string of characters which does not contain the start-delimiter of any markup and does not include the CDATA-section-close delimiter, ]]. In a CDATA section, character data is any string of characters not including the CDATA-section-close delimiter, ]]. To allow attribute values to contain both single and double quotes, the apostrophe or single-quote character (') MAY be represented as apos;, and the double-quote character () as quot;. -- It seems that xmlbeans 2.0.0 does not escape when it appears in the string ]] I haven't tested it with later versions. Maarten On 7/27/06, Weiler, Frank (KBV) [EMAIL PROTECTED] wrote: Hello from Berlin ! I just wonder, why the code of Saver.entitizeAttrValue() contains escaping for to lt; but not to gt;. Is the use of and apostroph restricted in attribute values ? And next question: Has someone use sucessfull the XMLOptions.setSaveSubstituteCcharacters() -method ? Regards ? - 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] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Getting VerifyError: TypeStore.find_element_user (need help)
Steven, java.lang.VerifyError indicates that the representation of the class does not correspond to the constraints in the Java spec, so basically your .class or .jar file is corrupt. Try re-downloading (or re-building) XmlBeans and maybe use the md5 sum to verify your download. Radu From: Steven Murphy [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 01, 2006 2:46 PMTo: XMLBeans User ListSubject: Getting VerifyError: TypeStore.find_element_user (need help) Hi, I'm very new to XMLBeans. I've been through the docs, FAQs, etc., but I'm stuck on a problem.I'm trying to parse the national weather service XML feed. The following URL points to the XSD file: http://www.weather.gov/data/current_obs/current_observation.xsd I've successfully used scomp to generate the JAR file. And I changed theclasspath ordered for the JAR files (websphere 5.1) for my local server (inRSA).The following lines seem to work (no errors at least): URL url = "" URL("http://www.nws.noaa.gov/data/current_obs/KMSP.xml");CurrentObservationDocument document = CurrentObservationDocument.Factory.parse (url); The following line doesn't:CurrentObservationDocument.CurrentObservation observation = document.getCurrentObservation();It produced the following Exception:java.lang.VerifyError:org/apache/xmlbeans/impl/values/TypeStore.find_element_user(Ljavax/xml/namespace/QName;I)Lorg/apache/xmlbeans/impl/values/TypeStoreUser;I'm not sure what to do at this point. I've search the Internet for info but found little that helped.Any help would be appreciated. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: Declaring DTD From API
Looking at the workaround that you say works, I am assuming that your document is using some entities that are declared in another document. If that's the case, then what you need to do is use your own XMLReader and try setting to false the SAX features http://xml.org/sax/features/external-general-entities and http://xml.org/sax/features/external-parameter-entities Then again, without seeing your documents or the error message, it's hard to say if that's the real problem Radu -Original Message- From: Kaan Yamanyar [mailto:[EMAIL PROTECTED] Sent: Friday, August 04, 2006 1:42 AM To: user@xmlbeans.apache.org Subject: Declaring DTD From API Dear all, In the xml's I parsed I recieve some errors due to entities declared in dtd. In the mail list i found the solution and it really works. It works if i add !DOCTYPE csf-inputs SYSTEM \C:\projects\odabul\odabul-web\WEB-INF\src\cities\WTGData.dtd to the XML file. But i can not add this to all xml files, i do not want to modify xml files. One solution is to add this at runtime with manipulating the stream given to the XXXDocument.Factory.parse(...,...) method. But I wonder If i can achieve this with using XmlOptions or some other way? Maybe xmlOptions.setDocumentType(..) is for this reason. But i really could not find a good documentation about this. Looking forward to hear a solution. Regards, Kaan Yamanyar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: AbstractTypes problem
Not sure what you are looking for. If you have an XmlObject o and you don't know what type it is, do SchemaType type = o.schemaType(); Does your Schema have 200 types that are all extending a base type such as Shape in the example below? Can all of those types result from the xquery? Do you need specific processing for each of them? Radu -Original Message- From: Christian Kaiser [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 02, 2006 11:42 AM To: user@xmlbeans.apache.org Subject: Re: RE: AbstractTypes problem Hello, i am new to xmlbeans and got stuck with the same problem. my schema consists of 200 types I dont want to compare all types with the xquery result. *** final Shape shape = Shape.Factory.parse(someShapteInput); if(shape instanceof Circle) { final Circle = (Circle) shape; // do whatever you want with a circle } else if(shape instanceof Square) { final Square square = (Square)shape; . . . } i dont see how andrejs way could work for me. (SchemaType instanceType = xo.type) Does it work? Is there another solution? Thanks, Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Unable to create a soap message using xmlbeans [2.1.0]
Title: Unable to create a soap message using xmlbeans [2.1.0] I think this question would be more appropriate for the xfire mailing list, I don't know whatthe answer is Radu From: FERRERO Olivier [mailto:[EMAIL PROTECTED] Sent: Monday, August 07, 2006 8:26 AMTo: user@xmlbeans.apache.orgSubject: RE: Unable to create a soap message using xmlbeans [2.1.0] Hi all, I have a question for you radu. How do you specify xmlbeans xml options (XmlOptions) with xfire ? I need to set some options relating to CDATA. Thanks for your help, Olivier. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: lundi 7 août 2006 17:12To: user@xmlbeans.apache.org; [EMAIL PROTECTED]Subject: RE: Unable to create a soap message using xmlbeans [2.1.0] Thanks very much for getting back to me. This is really good to know. Andy This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] Sent: Friday, August 04, 2006 5:12 PMTo: user@xmlbeans.apache.orgSubject: RE: Unable to create a soap message using xmlbeans [2.1.0] Andrew, We have done some experimental work on SOAP some time ago (before the 2.0.0 release) but decided to not pursue it in the end. So I would say that code is completely unsupported. The mainreason it's still there isin casesomeone is interested enough to work on it and make it usable. You can still use XmlBeans to populate data in a SOAP body, but not use it for SAAJ functionality. Radu From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 01, 2006 12:30 PMTo: user@xmlbeans.apache.orgSubject: RE: Unable to create a soap message using xmlbeans [2.1.0] It looks like theremay bean issue (bug)with the DEFAULT_MESSAGE_FACTORY. In the MessageFactory.java source (thecode below),the FactoryFinder.find() returns an org.apache.axis.soap.MessageFactoryImpl and then the code is attempting to cast it to a org.apache.xmlbeans.impl.soap.MessageFactory. This results in a ClassCastException. This appears to be a bug. Is this the correct list to be posting this item on or should I post this on the developer list? Any recommendations? Thanks! public static MessageFactory newInstance() throws SOAPException { try { return (MessageFactory) FactoryFinder.find(MESSAGE_FACTORY_PROPERTY, DEFAULT_MESSAGE_FACTORY); } catch (Exception exception) { throw new SOAPException( "Unable to create message factory for SOAP: " + exception.getMessage()); } }= This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From: Hahn, Andrew Sent: Tuesday, August 01, 2006 12:57 PMTo: 'user@xmlbeans.apache.org'Subject: RE: Unable to create a soap message using xmlbeans [2.1.0] I have just added the following jars to my classpath (from the apache axis 1_2RC2 distribution) and I am still getting the same exception: axis-ant.jaraxis.jarcommons-discovery.jarcommons-logging.jarjaxrpc.jarlog4j-1.2.8.jarlog4j.propertiessaaj.jarwsdl4j.jar The exception is occurring on this line: MessageFactory messageFactory = MessageFactory.newInstance(); Here are my imports: import org.apache.xmlbeans.XmlObject;import org.apache.xmlbeans.impl.soap.*; This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From: Jacob Danner [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 01, 2006 12:52 PMTo: user@xmlbeans.apache.orgSubject: RE: Unable to create a soap message using xmlbeans [2.1.0] at quick glance, it looks like you might want to add the SAAJ jars to your classpath From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 01, 2006 10:38 AMTo: user@xmlbeans.apache.orgSubject: Unable to create a soap message using xmlbeans [2.1.0] Hi, I am trying to create a simple SOAP message using the XML beans 2.1.0 library. The
RE: Missing addFoo() method
Were you able to resolve this? I don't really see what you mean, can you be more specific? Radu -Original Message- From: Michael Fieseler [mailto:[EMAIL PROTECTED] Sent: Friday, August 04, 2006 4:41 AM To: user@xmlbeans.apache.org Subject: Missing addFoo() method Hi, for an element Foo in my xml schema that allows multiple occurrences the methods addFoo and insertFoo are missing in the generated types. The remaining methods such as addNewFoo, insertNewFoo, setFooArray are available. What's the reason for the missing addFoo? I compiled the types using xmlbeans 2.1.0 and tried 2.2.0 as well. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Arrary or List in the getter and setter
In XmlBeans "Array" gets always appended to the name. If you need it for a special type, then you can use the extension feature to add new methods to the generated classes that would be named "getFoo" and delegate to "getFooArray" but if you need that for every type you are generating, then there is no way to do it Radu From: ramanan sathyanarayanan [mailto:[EMAIL PROTECTED] Sent: Monday, August 07, 2006 2:07 PMTo: user@xmlbeans.apache.orgSubject: Arrary or List in the getter and setter Hello,I did a scomp in Java 1.4 version for a xsd and got the java files successfully. But when i see the code, i was able to see "Array" is added to all getter and setter methods of list type objects. When i did in Java 1.5 version, i am seeing "List" in the end of all getter and setter methods. I think this is not a part of JavaBeans specification. For example, if i have,List abc;I should get the following getter and setter methods getAbc() and setAbc();Is there a way to achieve this.-- Regards,Ramanan ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: Xml Popultating Generated objects so deep
That is also a question for Xfire. One test you can try is extract the body of the soap message to a separate file. Parse the message from that file using XmlBeans directly and see what you get. Run validation on the parsed object and see if returns true. It could be that one of your elements is missing a namespace. In any case, I can't imagine any reason that being x levels deep would have something to do with it. Radu -Original Message- From: Ben Nice [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 15, 2006 2:32 AM To: user@xmlbeans.apache.org Subject: Xml Popultating Generated objects so deep Hi, I am a newbie to XMLBeans and have been using in conjunction with XFire (Web Service Framework). I am finding it only populating our generated objects three deep. If I do a xmlText() on the root object or even the object three down I see what I expect. But if I try a mehtod on a deeper level they all seem to return null. I can't see anything obvious, so asking here if anyone has any ideas or can assist. Regards, Ben. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Allowed attributes
Say you have an element as 'XmlObject element' and you are interested in finding out if attribute 'att' is allowed or not. SchemaType type = element.schemaType(); boolean isAttAllowed = type.getAttributeProperty(new QName(, att)) != null; Note that this will not handle the case in which there are attribute wildcards, if you have that (anyAttribute) then also take a look at SchemaType.qnameSetForWildcardAttributes(). Radu -Original Message- From: zas [mailto:[EMAIL PROTECTED] Sent: Monday, August 28, 2006 2:21 AM To: user@xmlbeans.apache.org Subject: Allowed attributes I need to find out whether it is allowed adding a certain attribute. I compare XMLs and need to flag changed elements with an attribute. Unfortunately some elements can have this change attribute and some cannot. Can anybody help me. Thanks -- View this message in context: http://www.nabble.com/Allowed-attributes-tf2176156.html#a6016873 Sent from the Xml Beans - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Abstract Types
First, let me assume that your Schema declares AbstractClass as the substitutionGroup for classA and classB and not AbstractElement like stated in your message. Then, you would write the following code: RootDocument doc = RootDocument.Factory.newInstance(); RootDocument.Root root = doc.addNewRoot(); XmlObject xmlObject = root.addNewAbstractClass(); xmlObject = xmlObject.substitute( ClassADocument.type.getDocumentElementName(), ClassAType.type); // You can now add stuff to xmlObject Now the doc object will contain the document in the format you want. The idea is that you need to use the method .substitute() to create a document that uses substitution groups. XmlBeans doesn't look at the fact that the element is abstract or that it has substitutions but instead uses the simpler rule that you need to call .substitute() if you want to enable substitutions. Radu Hi, Need some help in solving problems of abstract types. I have the following elements: xs:element name=Root xs:complexType xs:sequence xs:element ref=AbstractClass/ /xs:sequence /xs:complexType /xs:element element name=AbstractClass abstract=true element name=classA type=ClassAType substitutionGroup=AbstractElement element name=classB type=ClassBType substitutionGroup=AbstractElement I need an output XML of the form root classA.../classA /root but i get the following: root AbstractClass classA.../classA /AbstractClass /root In the java code i have the following options a) root.addNewAbstractClass(); b) root.setAbstractClass(XmlObject xmlObject); I want to get only the implementation of the AbstractClass as the sub-element of the Root element, how is it possible to achieve this. Thanks in advance, Cheers, Satish ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: source and target namespace mismatch
You can't fix this by using .xsdconfig, you need to get a new Schema file. If you look carefully at the "include" statement, you can notice that Liberty-metadata.xsd is asking for the version 2.0 of the included file, while that file is saying that its version is "2.0-02". My guess is that the Schema author didn't want one version of one file to be used with another version of the second file,probably for a good reason. Radu From: Mani Balasubramani [mailto:[EMAIL PROTECTED] Sent: Saturday, August 19, 2006 12:47 AMTo: user@xmlbeans.apache.orgSubject: source and target namespace mismatch Hi, Im trying to generate xmlbeans out of liberty schema files. One of the liberty schema has the following in it. Liberty-metadata.xsd ?xml version="1.0" encoding="UTF-8"? xs:schema targetNamespace="urn:liberty:metadata:2004-12" xmlns="urn:liberty:metadata:2004-12" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0" xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/ xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/ xs:include schemaLocation="liberty-idwsf-utility-v2.0.xsd"/ Liberty-idwsf-utility.xsd ?xml version="1.0" encoding="UTF-8"? xs:schema targetNamespace="urn:liberty:util:2005-11" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:liberty:util:2005-11" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.0-02" When I try to compile I get this error liberty-metadata-v2.0.xsd:12:3: error: Included schema has a target namespace "urn:liberty:util:2005-11" that does not match the source namespace "urn:liberty:metadata:2004-12" What should my .xsdconfig file look like, so that I can generate xmlbeans out of liberty-metadata.xsd? Thanks, Mani This email and any attachment(s) thereto, are intended for the use of the addressee(s) named herein and may contain legally privileged and or confidential information under applicable law. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email, and any attachment(s) thereto, is strictly prohibited. If you have received this communication in error, please notify the sender at 415-281-2200 or via return e-mail at [EMAIL PROTECTED] and permanently delete the original copy and any copy of any e-mail, and any printout thereof. Thank you for your cooperation. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: Cannot encode my XML document output into UTF-8
I couldn't find the time to look at this in detail, but here's a suggestion that may help: TextPad (like Notepad) I think looks at the first bytes in the file and if it sees something like FF FE decides that the encoding is unicode. But your file being XML, it relies on the encoding="UTF-8" part to set the encoding to UTF-8 and doesn't use the bytes, which TextPad doesn't pick up. So in other words, I think you're fine. Try putting some non-ASCII chars in your file, open it in TextPad and then set the encoding manually to UTF-8 and check if the characters are the same. The main idea in this story is that there is no "standard" mechanism to decide if a set of bytes are text in UTF-8 encoding or in ASCII encoding or a JPEG image (that's why XML needed an "encoding" attribute by the way). So as long as you have rules and mechanisms to ensure that the same encoding is used throughout your system, you are ok . Radu From: Michael White [mailto:[EMAIL PROTECTED] Sent: Friday, August 18, 2006 2:52 PMTo: user@xmlbeans.apache.orgSubject: Cannot encode my XML document output into UTF-8 I can't properly encode my XML output file and would appreciate any help you could offer!For example, if I do the following: ByteArrayOutputStream bos = new ByteArrayOutputStream(); FileOutputStream fos = new FileOutputStream("C:/test.xml"); PrintStream xmlStream = new PrintStream(fos, false, "UTF-8"); XmlOptions printOptions = new XmlOptions(); printOptions.setSavePrettyPrint(); printOptions.setSavePrettyPrintIndent (2); printOptions.setUseDefaultNamespace(); printOptions.setCharacterEncoding("UTF-8"); paymentDoc.save(bos,printOptions); xmlStream.print(bos); //xmlStream.print(bos.toString("UTF-8")); xmlStream.close();I receive a properly formatted file, with all of the data I require. However, per textpad, the encoding is set to ANSI. I've tried numerous combinations of writers and encoding and can't seem to get the output into UTF-8! I'll be dealing with Japanese and Korean characters so it is a necessity. The crazy part is that if I perform the following:ByteArrayOutputStream bos = new ByteArrayOutputStream();FileOutputStream fos = new FileOutputStream("C:/test.xml");PrintStream xmlStream = new PrintStream(fos, false, "UTF-8"); bos.write("A?u$(He933u3'u(BaÌ3̇".getBytes("UTF-8"));xmlStream.print(bos);xmlStream.close();The resulting file is listed as properly encoded in UTF-8 format!?I'm at my wits end. I'm using the latest XmlBeans release as of today and JDK 1.4.2_12. I set the documentProperties encoding to UTF-8 as well and it just doesn't want to play nice.Help!Thanks, Mike ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: How to use XmlObject.valueEquals
The JavaDoc for .valueEquals() is fairly detailed but forgets to mention one thing: that .valueEquals() is only implemented for simple type values. Actually, Schema-aware comparison is something that a lot of people find valuable and XmlBeans has all the foundation work done to support something like that, unfortunately we weren't able to find an interested person that could contribute the code to do it. This is my way of saying basically that this would be a great project for someone who is looking to get involved in XmlBeans and in Apache and open-source in general. Radu -Original Message- From: Bailey, Brian P [mailto:[EMAIL PROTECTED] Sent: Thursday, August 17, 2006 3:35 PM To: user@xmlbeans.apache.org Subject: How to use XmlObject.valueEquals Hi, I'm using xmlbeans 2.1.0 and have a question about comparing XmlObjects for equivalency. I have the following schema: schema xmlns=http://www.w3.org/2001/XMLSchema; xmlns:tns=http://myself.com/data; targetNamespace=http://myself.com/data; complexType name=location2DType sequence element name=latitude type=double/ element name=longitude type=double/ /sequence /complexType element name=Location2D type=tns:location2DType/ /schema I would like to compare two documents based on this schema and see if they are equivalent (ignoring element prefixes, attribute ordering, etc.). I thought I might use XmlObject.valueEquals(), but that doesn't seem to work. For example, when running the following code, I see valueEquals: true even though the latitude value is different: Location2DDocument doc1 = Location2DDocument.Factory.newInstance(); doc1.addNewLocation2D(); doc1.getLocation2D().setLatitude(34.2); doc1.getLocation2D().setLongitude(84.8); Location2DDocument doc2 = Location2DDocument.Factory.newInstance(); doc2.addNewLocation2D(); doc2.getLocation2D().setLatitude(95.2); doc2.getLocation2D().setLongitude(84.8); System.out.println(valueEquals: + doc1.valueEquals(doc2)); What should I use to compare two xml beans for equivalency? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: problem getting annotation on refed element
This is one of the things that's up in the air in XMLSchema, as far as I'm aware, what happens with annotations on refs to elements/attributes. Because of that we just picked one approach until this becomes clearer. The approach that we picked was that the annotation be part of the reference and not an addition to the reference (hope you understand what I mean). So I guess you could modify your Schema, if that's an option, to use local elements instead of refs or you can use the XmlBeans for Schema4Schemas (the org.apache.xmlbeans.impl.xb.xsdschema package) to get the Schema as XML or, well, patch the code to do what you want ;-)! Radu -Original Message- From: Pavel Kryl [mailto:[EMAIL PROTECTED] Sent: Friday, September 01, 2006 12:20 AM To: user@xmlbeans.apache.org Subject: problem getting annotation on refed element I am using your framework for examining XML schema structure. When I want to get an annotation of refed element, I do not get it. Instead I get the annotation of referenced element. Here is the annotation I want to get (using SchemaLocalElement.getAnnotation()): xsd:element ref=tns:imports xsd:annotation xsd:appinfoblabalbal/xsd:appinfo /xsd:annotation /xsd:element But instead it returns: xsd:element name=imports xsd:annotation xsd:appinfoblebelbel/xsd:appinfo /xsd:annotation /xsd:element I cannot find a way to get the former annotation, can you help me? Thanks, pavel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xmlbeans with hr-xml DateTime's
What's happening most likely is that you have defined the approvedDateTime attribute in your Schema as having type xs:date which means a date _without_ time. As a result, when you set your calendar using approval.setApprovedDateTime() it only sets the date, and it loses the time. To fix it, simply change your attribute's type from xs:date to xs:dateTime. Radu On Wed, 2006-09-13 at 07:22 -0700, Craig Fordham wrote: Hi User, I am using xmlbeans to compile my xml with includes mostly hr-xml with a few tags of my own. But i am having problems setting the DateTime fields in hr-xml. In java I convert a java.util.Date (with time) to a xmlbeans GDDate and then from that get the XMLCalendar object from that. code snippet and output:- GDate approved = new GDate(time.getApproved()); logger.info(Millis from ts going into hrxml+time.getApproved().getTime()); logger.info(Date from ts going into hrxml+time.getApproved()); logger.info(GDdate seconds going into hrxml+approved.getSecond()); logger.info(Date GDdate going into hrxml+approved); logger.info(Calendar from GDdate going into hrxml+approved.getCalendar()); approval.setApprovedDateTime(approved.getCalendar()); logger.info(Calendar from GDdate after setter+approval.getApprovedDateTime()); logger.info(Calendar from GDdate after setter+approval.getApprovedDateTime().getTimeInMillis()); logger output follows:- Millis from ts going into hrxml115632975 Date from ts going into hrxml2006-08-23 11:42:30.0 GDdate seconds going into hrxml30 Date GDdate going into hrxml2006-08-23T11:42:30+01:00 Calendar from GDdate going into hrxml2006-08-23T11:42:30+01:00 Calendar from GDdate after setter2006-08-23+01:00 Calendar from GDdate after setter115628760 Can you give me any pointers on why this may be and what i may be doing wrong? Cheers Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XML Schema evolution forward and backwards compatibility
Hi Ruben, I think this is handled quite nicely by XmlBeans, within the context set by the XMLSchema spec. Assuming you have a backwards-compatible Schema on the server and an older version of that on the client you can either have extra elements sent by the server, which will of course be inaccessible via the generated APIs that the client uses, but they will be accessible by the XmlCursor API. Or you could have restriction, when the server will stop sending elements/attributes that were optional anyway. The client still works. On the server, it's a little trickier but still works and the server may even choose to support clients with older Schemas specifically, for instance by using XmlCursor to get to information that was removed from the most current version of the Schema using restriction, but the clients are still sending. Onto the problem of discovery, XmlBeans saves Schema information along with generated classes in the jar. So if a client will call validate for instance, it will validate against the version of Schema that the client has, even though the document may be generated using a different version of the Schema. I am not sure I understand what you mean by Ignore everything you know!: as long as the client uses at runtime the same version of the Schema that the client code was written against, the server does the same, the two Schemas are backwards-compatible and the message on the wire is pure XML if you will, then everything should hang together. Hope this helps, Radu -Original Message- From: Ruben Verlinden [mailto:[EMAIL PROTECTED] Sent: Thursday, October 05, 2006 9:05 AM To: user@xmlbeans.apache.org Subject: Re: XML Schema evolution forward and backwards compatibility On Thu, 2006-10-05 at 08:33 -0700, Martin Wegner wrote: The issue has less to do with XMLBeans and more with the XML Schema standard itself. It is hard to do. I would suggest you start reading here: http://www.pacificspirit.com/Authoring/Compatibility/ProvidingCompatib leSchemaEvolution.html I already had a look at this article. The problem is how to support XML schema discovery (which is the XML schema for a certain document) and doing the projection if possible with XMLBeans. kind regards, Ruben - Original Message From: Ruben Verlinden [EMAIL PROTECTED] To: user@xmlbeans.apache.org Sent: Wednesday, October 4, 2006 10:42:35 AM Subject: XML Schema evolution forward and backwards compatibility Hello, I am new to using XMLBeans and I wonder if somebody can provide me with some insights on supporting backward/forward compatibility after the XML Schema for a certain document type evolves using XMLBeans. The general idea was to have clients which only support an older version of the schema than the documents sent by the server to do a projection of the XML document to their known schema. Which comes down to: Ignore everything you know! Possibly a must not ignore could be built into some elements later on. The server should also be able to receive XML documents that follow an older schema than the one used on the server. When receiving such a XML document the server should parse it an decide if it can find enough information in the document or not. Can anyone provide me some insight on how to do this using XMLBeans? Or if XMLBeans is even suited for this kind of task? kind regards, Ruben Verlinden - 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] ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Xmlbeans and Xinclude
Well, it looks to me that this is a little beyond XMLBeans. Can you try just using Xerces without XMLBeans to parse the same document? If you have the same error, then you'll obviously have to fix that before you can expect that it will work with XMLBeans, if not, then we have to figure out how do you set up Xerces that's different than how XMLBeans does it. Radu From: Rama Mohan Rao Peruri [mailto:[EMAIL PROTECTED] Sent: Sunday, October 01, 2006 5:42 PMTo: user@xmlbeans.apache.orgSubject: Xmlbeans and Xinclude Hi There are a few people who raised this topic but no solutions were given. After some digging around, I found the following solution. However when tested it fails at the xinclude line in the xml file. Could somebody point me to my mistake? ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = ""> XMLReader reader = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser"); reader.setFeature("http://apache.org/xml/features/xinclude", true); XmlOptions xopt = new XmlOptions(); xopt.setLoadUseXMLReader(reader); IwfDocument idoc = IwfDocument.Factory.parse(url, xopt); /* fails with a Xerces fatal error at the xinclude line in the xml file */ Best Regards Rao (Peruri Rama Mohan Rao) TO-ES-Imaging Workflow Tel: 65- 6878 2071 Mobile: 65-9389 7141 CONFIDENTIAL NOTE: The information contained in this email is intended only for the use of the individual or entity named above and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete the mail. Thank you. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
RE: XMLBeans generated inner class names too long for Windows platforms.
We have a JIRA issue opened on this, XMLBEANS-282. I have added a comment on that, the fact that more and more people are hitting this ismotivation forus to give it higher priority. Radu From: Vines, Herbert [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 26, 2006 11:37 AMTo: user@xmlbeans.apache.orgSubject: XMLBeans generated inner class names too long for Windows platforms. Ive run into the problem with XMLBeans generating names that are too long for Windows due to a deep schema. >From my google searches, Ive seen at least three posts with questions about it, but no replies. I need to find out if there are any plans to fix this or if there is something already in place. If there are plans, is there a development version out there can be tested with? Thanks in advance for your help, H3 ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.