RE: good way of writing xs:any
XmlCursor's copy and move methods can be used for this. -Original Message- From: Ali, Haneef [mailto:[EMAIL PROTECTED] Sent: Monday, May 23, 2005 5:38 PM To: user@xmlbeans.apache.org Subject: RE: good way of writing xs:any Hi Steven, This is one area where the functionality of xmlbeans is limited Assume statusDetail is a complex element, in that case it is very difficult to insert the object. Idealy it would make life simpler if xmlcustor had insertXMLObject() besides insertChars(). Eg: status xmlns=http://openuri.org; statusdetail s1 s2text of status detail/s2 /s1 /statusDetail /status Though it can be done via xmlcursor , it is not trivial to create the above xml fragment if status is defiend to have xsd:any. Regards, Haneef From: Steven Traut [mailto:[EMAIL PROTECTED] Sent: Monday, May 23, 2005 2:05 PM To: user@xmlbeans.apache.org Subject: RE: good way of writing xs:any Hello Argyn -- This is an area where you have to bypass the JavaBeans-style accessors generated by XMLBeans. Try using an XmlCursor instance to insert the element. So, let's assume your schema defines a status element of StatusType that has a statusdetail element of type StatusDetailType as a child, and you want to insert a new statusdetail child. You might have something like this (er, roughly -- others jump in if I've got it wrong): StatusType status = StatusType.Factory.newInstance(); XmlCursor cursor = status.newCursor(); cursor.toLastAttribute(); cursor.toNextToken(); // Begin a new statusdetail element whose namespace URI is the target URI of your schema (let's say http://openuri.org/). cursor.beginElement(statusdetail, http://openuri.org/;); // Insert text of status detail as an element value. cursor.insertChars(text of status detail); cursor.dispose(); This should give you something like: status xmlns=http://openuri.org; statusdetailtext of status detail/statusdetail /status You might search the archives of this mailing list -- this question has been asked a few times, and you may find an answer in one of the other responses. Also, see these topics in the docs for more on the cursor: http://xmlbeans.apache.org/docs/2.0.0/guide/conNavigatingXMLwithCursors. html http://xmlbeans.apache.org/documentation/tutorial_getstarted.html (under Getting Started with the XML Cursor) http://wiki.apache.org/xmlbeans/XmlBeansTutorial/MixedContent Steve -Original Message- From: Kuketayev, Argyn (Contractor) [mailto:[EMAIL PROTECTED] Sent: Monday, May 23, 2005 12:25 PM To: user@xmlbeans.apache.org Subject: good way of writing xs:any Here's a snippet of schema with xs:any element: xs:complexType name=StatusDetailType xs:sequence xs:any namespace=##any processContents=lax minOccurs=0 maxOccurs=unbounded/ /xs:sequence /xs:complexType XMLBeans generates StatusDetailType without any any children manipulation methods. What's the right way of adding a child element to this element? My child element has Java class generated by XMLBeans too. thanks, Argyn - 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]
XMLBeans Survey
We are surveying XMLBeans users to help us decide what to focus on for v3. Here's a chance to tell us whats important to you. Please help us improve XMLBeans by answer the following questions: 1) How did you hear about XMLBeans? [ ] conference [ ] internet articles or web logs [ ] friend or coworker [ ] other (please specify) 2) What version of XMLBeans are you using? [ ] v1.0.3 [ ] v1.0.4 [ ] v1.0.4-jdk13 [ ] v2.0.0-beta1 [ ] v2.0.0 [ ] XMLBeans bundled with other product (please specify) [ ] latest SVN snapshot 3) Which of the following do you find most valuable in your version of XMLBeans? (use numbers: 1 most valuable to 9 least valuable) [ ] strongly typed interfaces (the Java binding) [ ] 100% XMLSchema support [ ] full XML info set access (through DOM and XmlCursor) [ ] XPath and XQuery support [ ] XMLSchema validation coverage [ ] ease of use [ ] schema type system API [ ] all the above in one integrated package [ ] other (please specify) 4) From your point of view, what should be the focus in XMLBeans v3? (use numbers: 1 - most valuable to 7 - least valuable) [ ] performance [ ] smaller memory footprint [ ] SAAJ support [ ] JAXB2 support [ ] SDO support [ ] support of large XML messages through streaming [ ] other (please specify) By default replies will go to the mailing list. If you wish, please feel free to send your response to cezar (at) apache.org instead. Thanks for your support! XMLBeans team - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Creating complexType objects...
Kent, The XmlObject interface always represents the content, it does not represent the node itself as in DOM. There are three different types of XmlObject: 1) content of an element: i.e. attributes, inner elements and inner text, without the element name. 2) simple type content: i.e. text, can be the content of an attribute, or a text only element. The java objects representing this type of content will implement SimpleValue interface. 3) content of a document: i.e. only one root element. The corresponding java type will have the suffix 'Document' in the name. For 3) XmlObject.toString() will return the entire document representation. But for 1) and 2), because they represent inner parts of a document, XmlObject.toString() will insert the representation of the content inside an xml-fragment element, so it can be parsed by any xml parser. There are options to change the name of the 'xml-fragment' name: XmlOptions.setSaveSyntheticDocumentElement(QName name) and XmlOptions.setSaveOuter(). I hope this helps you. Cezar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 27, 2005 10:06 AM To: user@xmlbeans.apache.org Subject: Re: Creating complexType objects... Thanks for the replies - I'll try to address both in this message. 1) I was just using print(foo) as short-hand. The xmlText is still xml-fragment.../xml-fragment ( I was really doing System.out.println(footext = + foo) ) 2) In xmlbeans 2.0.0 there is no FooDocument.Foo.Factory chain of objects; at least not for these schemas. (You can find the schema I'm using at OASIS for DSML - http://www.oasis-open.org/committees/dsml/docs/DSMLv2.xsd) Basically, a DsmlAttr is used in a number of different Request objects, e.g. AddRequest. So we have AddRequestDocument, and AddRequest, as Java types, but no DsmlAttrDocument. Further, there is no AddRequestDocument.AddRequest.Factory chain in 2.0.0. Is there an API changes document from 1.0 to 2.0 document somewhere? Thanks again - I really do appreciate the replies. --Kent Caroline Wood wrote: I think what you need to do is: FooDocument fooDocument = FooDocument.Factory.newInstance(); FooDocument.Foo foo = FooDocument.Foo.Factory.newInstance(); foo.setName(blah blah); fooDocument.setFoo(foo); print(fooDocument); Give at a go and let us know what happens! Best, Caroline. -Original Message- From: Don Stewart [mailto:[EMAIL PROTECTED] Sent: 27 July 2005 09:59 To: user@xmlbeans.apache.org Subject: RE: Creating complexType objects... Kent, In the first example replace print(foo); with print(foo.xmlText()); Regards Don -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 26 July 2005 19:48 To: user@xmlbeans.apache.org Subject: Creating complexType objects... I've looked over all the doc, and archives, and haven't found if there's an easier to do what I'd like in XmlBeans 2.0.0. It looks like to create an XmlObject that has a name other than xml-fragment in the first element, you need to go through an object type that contains that type. i.e. If I have Foo defined as a type with just a name attribute: Foo foo = Foo.Factory.newInstance(); foo.setName(name); print(foo); gives: xml-fragment name=name/ If I want foo name=name/ as the xml - I need to find a type (let's call it Bar) that encloses the Foo type and do: Bar bar = Bar.Factory.newInstance(); Foo foo = bar.addNewFoo(); foo.setName(name); foo.set(bar); now foo is: foo name=name/ Is this really what's required? If this made no sense; I can send a more concrete example. Thanks for the help, --Kent - 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] This is an email from the CPP Group Plc, Holgate Park, York, YO26 4GA; telephone 01904 544500. This message may contain information that is confidential. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and either return or destroy the original message. The CPP Group Plc accepts no responsibility for any changes made to this message after it has been sent by the original author. This email has been scanned for all viruses by the MessageLabs Email Security System. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Creating complexType objects...
I agree that handling wildcards is very useful, it's already on our list of features. Cezar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 27, 2005 1:45 PM To: user@xmlbeans.apache.org Subject: Re: Creating complexType objects... That Cezar - This definately helps me understand what is going on. I still find it a little frustrating that I cannot construct a 3) from an 'interior' type (i.e. no *Document class); without knowing either an enclosing element name from some doc-type that uses these; or the QName to use. I don't care if they parse right away (and besides, I can make them parse with the right namespace decl) - I want to do this so I can place these in a parent node/element that is typed as xs:any. Anything XmlBeans could do to make xs:any support easier, even if it is just through convienence classes that assume some pattern of xs:any usage would be very helpful. As an example of a pattern, all the objects in a schema that have an xs:any element inherit from a base type like: complexType name=ExtensibleType sequence any namespace=##other minOccurs=0 maxOccurs=unbounded processContents=lax/ /sequence anyAttribute namespace=##other processContents=lax/ /complexType which means that xs:any elements are always the first elements in any type that extends. This makes it deterministic as to where to insert and where to read these 'extrinsically' typed elements. One could imagine an extension to support this idiom - sort of like JAXB's support. Thanks for listening, and helping, --Kent Cezar Andrei wrote: Kent, The XmlObject interface always represents the content, it does not represent the node itself as in DOM. There are three different types of XmlObject: 1) content of an element: i.e. attributes, inner elements and inner text, without the element name. 2) simple type content: i.e. text, can be the content of an attribute, or a text only element. The java objects representing this type of content will implement SimpleValue interface. 3) content of a document: i.e. only one root element. The corresponding java type will have the suffix 'Document' in the name. For 3) XmlObject.toString() will return the entire document representation. But for 1) and 2), because they represent inner parts of a document, XmlObject.toString() will insert the representation of the content inside an xml-fragment element, so it can be parsed by any xml parser. There are options to change the name of the 'xml-fragment' name: XmlOptions.setSaveSyntheticDocumentElement(QName name) and XmlOptions.setSaveOuter(). I hope this helps you. Cezar - 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: Jar file internals?
The directory schema/src is not needed for validation or parsing, but the .xsb files are needed. The src is included because there are applications that need the source file of a given schema type. If you don't use SchemaComponent.getSourceName() you probably don't use the files in schema\src. But remember, all the info from the schema files is still in the xsb files in a binary form and it's not impossible to infer an equivalent schema file. Cezar -Original Message- From: Steve Davis [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 02, 2005 11:09 AM To: user@xmlbeans.apache.org Subject: RE: Jar file internals? I would hope the schema\src directory is not needed for validation or parsing. We will try deleting the src and see what happens. -Original Message- From: Jacob Danner [mailto:[EMAIL PROTECTED] Sent: Monday, August 01, 2005 6:38 PM To: user@xmlbeans.apache.org Subject: RE: Jar file internals? I don't think any. All of the files beginning with schema contain the .xsb files that maintain sync with the xml infoset. I'm not sure what would happen if you deleted those, but I'm sure things like validate and parse would fail. -Original Message- From: Steve Davis [mailto:[EMAIL PROTECTED] Sent: Monday, August 01, 2005 3:28 PM To: user@xmlbeans.apache.org Subject: Jar file internals? Which parts of the jar file generated by scomp are needed for runtime execution? I am seeing directories: com\... META-INF\... schema\element\... schema\javaname\... schema\namespace\... schema\src\... schema\system\... schema\type\... Which of these directories can be safely removed without impacting the application at runtime? - 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 V2 and Piccolo
Title: Message By default, XMLBeans synchronizes all required entrances per store, unless you use XmlOptions.setUnsynchronized() when creating a new store with Factory.parse() or Factory.newIstance(). Cezar From: Radu Preotiuc-Pietro Sent: Friday, August 19, 2005 3:15 PM To: user@xmlbeans.apache.org Subject: RE: XmlBeans V2 and Piccolo 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: pretty print and ampersands
This sure seems like a bug, would you open up a bug in JIRA so we can track it. Also if you have a patch for it, it would be very much appreciated. Cezar -Original Message- From: Christopher Lamey [mailto:[EMAIL PROTECTED] Sent: Friday, September 02, 2005 2:19 PM To: user@xmlbeans.apache.org Subject: pretty print and ampersands Hello, The following elements in our xml cause a java.lang.ArrayIndexOutOfBoundsException in Document.save(StringWriter, XmlOptions) in xmlbeans when we first call setSavePrettyPrint() on the XmlOptions object we pass into the Document.save(StringWriter, XmlOptions) method: valueuranium miner amp;/value valueuranium miner amp; s/value valueuranium miner amp;/value These do not: valueuranium miner amp; s/value valueamp;/value Basically, we're seeing that any amp at the end of an element value needs to have a non-whitespace character at least three characters from the right of it in order to avoid the problem. If setSavePrettyPrint() is not called, everything works. Here's the stack against the 2.0.0 xmlbeans release: java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at org.apache.xmlbeans.impl.store.Saver $TextSaver.replace(Saver.java:1438) at org.apache.xmlbeans.impl.store.Saver $TextSaver.entitizeContent(Saver.java:1269) at org.apache.xmlbeans.impl.store.Saver $TextSaver.emitText(Saver.java:966) at org.apache.xmlbeans.impl.store.Saver.process(Saver.java:288) at org.apache.xmlbeans.impl.store.Saver $TextSaver.ensure(Saver.java:1466) at org.apache.xmlbeans.impl.store.Saver$TextSaver.read(Saver.java:1553) at org.apache.xmlbeans.impl.store.Saver $TextReader.read(Saver.java:1680) at org.apache.xmlbeans.impl.store.Cursor._save(Cursor.java:609) at org.apache.xmlbeans.impl.store.Cursor.save(Cursor.java:2554) at org.apache.xmlbeans.impl.values.XmlObjectBase.save(XmlObjectBase.java:18 6) Is this expected behavior? Cheers, topher - 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
Actually there is a nicer way to get to the schema source: SchemaType type = GeneratedXMLBean.type; InputStream is = type.getTypeSystem(). getSourceAsStream(type.getSourceName()); Cezar -Original Message- From: Cezar Andrei Sent: Tuesday, October 04, 2005 12:36 PM To: user@xmlbeans.apache.org; [EMAIL PROTECTED] Subject: RE: Re-Generating schema from the generated code Scomp 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 AM To: user@xmlbeans.apache.org Subject: Re-Generating schema from the generated code Hi, I'm from Apache Axis2 team. I need a help in generating schema using XMLBeans. 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 classes generated 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 could find all the generated codes which are global elements. How can I recreate 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FW: Legal issue: jsr173 API jar licensing
Since revision 312915, XMLBeans uses a new jsr173 bundle containing only the jsr173 API, this bundle is licensed under an Apache ASF license. In order to pick up and build with the new bundle, please execute: ant clean.jars clean deploy Many thanks to Lawrence Jones and Cliff Schmidt, who put a lot of their time into solving this issue. Cezar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: nilable and validate()
There is an earlier discussion on this topic, please see: http://www.mail-archive.com/user@xmlbeans.apache.org/msg00512.html Cezar From: Samuel B. Quiring [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 25, 2005 3:10 PM To: user@xmlbeans.apache.org Subject: nilable and validate() Greetings, I have a schema fragment that looks like this: xs:complexType name=HumanNameDataType xs:sequence xs:element name=PrefixName type=glob:StringMin1Max10Type minOccurs=0/ xs:element name=FirstName type=glob:StringMin1Max35Type/ xs:element name=MiddleName type=glob:StringMin1Max25Type minOccurs=0/ xs:element name=LastName type=glob:StringMin1Max60Type/ xs:element name=SuffixName type=glob:StringMin1Max10Type minOccurs=0/ /xs:sequence /xs:complexType I'm calling validate() to verify the java object after I fill it with values. For the three fields with minOccurs=0, if I set value to null validate returns this error: validation error: xml-fragment xmlns:glob=http://apply.grants.gov/system/GlobalLibrary-V1.0 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance glob:PrefixNameDr./glob:PrefixName glob:FirstNameEmmet/glob:FirstName glob:MiddleNameT/glob:MiddleName glob:LastNameBrown/glob:LastName glob:SuffixName xsi:nil=true/ /xml-fragment,[EMAIL PROTECTED] [EMAIL PROTECTED] validationerror: error: cvc-elt.3.1: Element has xsi:nil attribute but is not nillable To deal with this I tried setting the value 3 different ways: name.setSuffixName(null); -- see above error name.setSuffixName(); -- min string length must be 1 do nothing-- this works. Only if I did nothing did validate() report no errors. What is the difference between setting a value to null and not setting a value at all? Is there a configuration parameter I can use to say setting a value to null is the same as not setting it? Is this behavior documented somewhere? I searched the docs but couldn't find anything, but I probably missed it. -Sam
RE: enumeration values that begin with X
Looks like a bug, will you file a JIRA bug? Please attach a small example if you have one. Cezar -Original Message- From: Cory Bestgen [mailto:[EMAIL PROTECTED] Sent: Monday, November 07, 2005 9:33 AM To: user@xmlbeans.apache.org Subject: enumeration values that begin with X Hello All, I have an enumeration that contains values that begin with X. After compiling the schema all of the enumeration values that began with X are nowhere to be found in the resulting xmlbeans enumeration. I am using xmlbeans 2.0, is there any way to make the missing values show in the enumeration? Thanks, Cory - 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: Jar Naming
You're right, we should move to xmlbeans-xxx.jar naming in the next release. Also the xbean_xpath.jar should be renamed to xmlbeans_xpath.jar. It would avoid any naming confusion. Cezar -Original Message- From: Dan Diephouse [mailto:[EMAIL PROTECTED] Sent: Monday, December 05, 2005 1:02 PM To: user@xmlbeans.apache.org Subject: Jar Naming Hiya, Can the jar naming on xmlbeans be changed in the future? In the maven repo they're called xbean-xxx.jar. With the XBean project coming to geronimo this can be really confusing. I'd like to see xmlbeans-xxx.jar. Cheers, - Dan -- Dan Diephouse Envoi Solutions LLC http://netzooid.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XmlCursor - equivalent setObject() method?
Title: XmlCursor - equivalent setObject() method? The equivalent of XmlObject setXXX method in the XmlCursor world is copy/moveXmlContents(). From: Jones, Damon [mailto:[EMAIL PROTECTED] Sent: Monday, December 05, 2005 1:27 PM To: user@xmlbeans.apache.org Subject: XmlCursor - equivalent setObject() method? Hello, I am trying to figure out the best way to place a newly created XmlObject anywhere in my existing XML document. I understand that you can use the XmlCursor to move to a certain position in the XML document. Then I would like to add the new XmlObject into that position. Is there a way to do this. Thanks, Damon Jones
RE: Saxon 8.1.1 dependency saxon namespaces
Marius, See a previous answer on this topic: http://www.mail-archive.com/user@xmlbeans.apache.org/msg00836.html We're still committed to have XMLBeans working with a 1.4 JDK, so we cannot apply your patch right now. But starting with v3 we'll most probably drop this requirement and your patch will come handy. Cezar -Original Message- From: Marius Gleeson [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 28, 2005 9:03 PM To: dev@xmlbeans.apache.org; user@xmlbeans.apache.org Subject: Saxon 8.1.1 dependency saxon namespaces I am using a later version of saxon by making a simple change to the following classes and rebuilding the xbean_xpath.jar File:org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.java Change import net.sf.saxon.xpath.XPathException to import net.sf.saxon.trans.XPathException File:org.apache.xmlbeans.impl.xpath.saxon.XBeansXQuery.java Change import net.sf.saxon.xpath.XPathException import net.sf.saxon.xpath.StaticError to import net.sf.saxon.trans.XPathException import net.sf.saxon.trans.StaticError This will allow you to use the new versions of Saxon as the only problem is a package name change. It would be good to maybe replace the explicit catching of these exceptions with more generic ones so that any version of Saxon can be used without the need to have a different xbean_xpath.jar. While on the topic, I have needed to pass namespaces to the Saxon engine for xpath processing. However this is not possible through the xmlbeans interfaces because it creates a new (empty) Map and hands this to saxon as its namespace list. I have however made a simple change to org.apache.xmlbeans.impl.store.Path to allow it to use the namespace map in the XmlOptions instance that is passed on the call to selectPath. The following snipit from my org.apache.xmlbeans.impl.store.Path.java shows the changes, From Line 78 public static Path getCompiledPath(String pathExpr, XmlOptions options) { options = XmlOptions.maskNull(options); int force = options.hasOption(_useXqrlForXpath) ? USE_XQRL : options.hasOption(_useXbeanForXpath) ? USE_XBEAN : USE_XBEAN|USE_XQRL|USE_SAXON; //set all bits //*** passing options parameter return getCompiledPath(pathExpr, force, getCurrentNodeVar(options),options); } //*** added options parameter to this method static synchronized Path getCompiledPath(String pathExpr, int force, String currentVar,XmlOptions options) { Path path = null; Map namespaces = null; //*** If there are suggested namespaces then use them instead of just creating an empty map. if ((options != null) (options.hasOption(XmlOptions.SAVE_SUGGESTED_PREFIXES)) ) { namespaces = (Map) options.get(XmlOptions.SAVE_SUGGESTED_PREFIXES); } else { namespaces = (force USE_SAXON) != 0 ? new HashMap() : null; } . . . It would be really great to have this functionality back in the main branch. Thanks, Marius. - 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: Change generated XSB files with xsdconfig
Use the xsdconfig file to change package names. See the following: http://wiki.apache.org/xmlbeans/XmlBeansFaq#configPackageName . But keep in mind that XmlBeans doesnt support using two or more sets of java classes (in different packages) mapped to schema type/elements that have the same names and target namespaces, using all in the same class loader. Depending on the direction you are using for the java classes to schema types mapping, some features might not work correctly. This is because even though the package names for the java classes are different, the schema location for the schema metadata (.xsb files) is the same and contains the corresponding implementing java class, so the JVM will always pick up the first on the classpath. This can be avoided if multiple class loaders are used. Cezar From: ian tabangay [mailto:[EMAIL PROTECTED] Sent: Monday, January 16, 2006 2:49 AM To: user@xmlbeans.apache.org Subject: Change generated XSB files with xsdconfig Hi. Im new at using XMLBeans and ran into a bit of a problem. I have 2 schemas which are almost identical except for a few elements that have been removed/added since one is a revision of the other. I need to maintain both schemas for a while until all of the users have finally migrated to the newly revised schema. My problem is that both schemas dont have any specified targetNamespaces so all generated xsb files are found in **/_nons directory. Is there a way to change this location possibly with the xsdconfig file? Ian Tabangay Supply Chain Networks, inc [EMAIL PROTECTED]
RE: Extending generated XMLBeans classes without 'Extensions'
You should be using the Interface Extension Feature: http://wiki.apache.org/xmlbeans/ExtensionInterfacesFeature This way the custom code lives in a separate file that will not be lost when you regenerate the sources when you change the schema. Cezar -Original Message- From: Edward Frederick [mailto:[EMAIL PROTECTED] Sent: Friday, January 20, 2006 10:32 AM To: user@xmlbeans.apache.org Subject: Extending generated XMLBeans classes without 'Extensions' Hello, First, let me say that XMLBeans is pretty fantastic. It just works. I have a problem, though. I need to add methods to my objects--and they must be added directly to the types, as I'm using polymorphism extensively. However, this is a problem in terms of rapid development. There's no way to quickly change the schema and regenerate source without overwriting my 'additions'. How are you folks doing this? 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: Help in Converting JAXB schema to XMLBeans schema
Im not an expert in JAXB but here it is my take on it: 1) When compiling with XMLBeans the schema files, one can customize the package names and the class names through .xsdconfig file, but it doesnt allow changing the property name. If you really care about the property name you can use Interface Extensions and delegate to the real method (go here for more details: http://wiki.apache.org/xmlbeans/ExtensionInterfacesFeature ) 2) XMLBeans always generates isSet methods. 3) For properties that have maxOccurs bigger than 1, XMLBeans generates the following setters and getters: java.util.ListLineItem getLineItemList(); //generics are used when javaversion 1.5 switch is used LineItem[] getLineItemArray(); LineItem getLineItemArray(int i); int sizeOfLineItemArray(); void setLineItemArray(LineItem[] lineItemArray); void setLineItemArray(int i, LineItem lineItem); LineItem insertNewLineItem(int i); LineItem addNewLineItem(); void removeLineItem(int i); 4) XMLBeans always generates type-safe Enumeration like types for schema enumeration types. 5) I dont understand exactly the problem here, but it seems to me that it should at least be solvable using the Interface Extension. And through the type variable on every generated type you can get to _all_ of the XML info set information on that and other types including any default/fixed values etc. 6) XMLBeans will automatically generate a type for schema type CustomDate that will allow one to play with instances of that type. Also one can verify the validity of an instance of this type at any time and can have access to the raw string. Specifically for dates, XMLBeans contains classes that follow exactly the semantics of XMLSchema date types. I hope this helps, Cezar, Radu, Lawrence From: Jun Victorio [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 31, 2006 1:21 PM To: user@xmlbeans.apache.org Cc: [EMAIL PROTECTED] Subject: Help in Converting JAXB schema to XMLBeans schema Hi there, Im new in using xmlbeans and xml schema. We are trying to migrate an existing application that uses jaxb to xmlbeans. The current application uses jaxb 1.6 version. I have several questions regarding specific jaxb custom binding extensions that are used and try converting this to xmlbeans standard. JAXB version: xsd:element name=AvailabilityResponse xsd:complexType xsd:sequence xsd:element ref=ResponseItem minOccurs=0 maxOccurs=unbounded xsd:annotation xsd:appinfo jxb:property name=responseItems/ /xsd:appinfo /xsd:annotation /xsd:element /xsd:sequence /xsd:complexType /xsd:element How would you define this is xmlbeans schema format. Since I can not use the jxb:property name= JAXB version: xsd:element name=Day type=xsd:date minOccurs=0 xsd:annotation xsd:appinfo jxb:property generateIsSetMethod=true/ /xsd:appinfo /xsd:annotation /xsd:element Is there any corresponding xmlbeans extension for jxb:property generateIsSetMethod=true/ or attributes? JAXB version: xsd:element name=BrandID type=xsd:int minOccurs=0 maxOccurs=unbounded xsd:annotation xsd:appinfo jxb:property name=brandIDs collectionType=indexed/ /xsd:appinfo /xsd:annotation /xsd:element Again is there any corresponding xmlbeans extension for: jxb:property name=brandIDs collectionType=indexed/ JAXB version: xsd:simpleType name=PartNumberConstants xsd:annotation xsd:appinfo jxb:typesafeEnumClass/ /xsd:appinfo /xsd:annotation xsd:restriction base=xsd:string xsd:enumeration value=INTERNAL/ xsd:enumeration value=SKU/ xsd:enumeration value=UPC/ /xsd:restriction /xsd:simpleType Whats the correponding xmlbeans extensions for: jxb:typesafeEnumClass/ or is xmlbeans already has type safe enumeration build-in when you define an enumeration? JAXB version: xsd:annotation xsd:appinfo jxb:globalBindings fixedAttributeAsConstantProperty=true collectionType=java.util.ArrayList/ jxb:schemaBindings jxb:package name=com.starcomsoft.growernetwork.binding.availability/ /jxb:schemaBindings /xsd:appinfo /xsd:annotation I dont understand the meaning of jxb:globalBindings fixedAttributeAsConstantProperty=true collectionType=java.util.ArrayList/. Ive read the JAXB tutorial and still dont fully grasp the meaning of this one. From what I know it looks like when an element is an enumeration/sets the generated Java classes will return an instance of ArrayList instead of array[]. Is there any corresponding xmlbean extension/attributes or custom binding for it? JAXB version: xsd:simpleType name=CustomDate xsd:annotation xsd:appinfo jxb:javaType name=com.starcomsoft.growernetwork.connect.messaging.CustomDate parseMethod=fromString printMethod=toString/ /xsd:appinfo /xsd:annotation xsd:restriction base=xsd:string xsd:length value=10/ xsd:pattern
RE: off-topic: substitutiongroups and inheritance
No problem, I'm sure it will be quite useful for other readers. Will you post the working schema? Thanks, Cezar -Original Message- From: Erik van Zijst [mailto:[EMAIL PROTECTED] Sent: Friday, March 10, 2006 11:06 AM To: user@xmlbeans.apache.org Subject: Re: off-topic: substitutiongroups and inheritance Nevermind, I think I solved it. I missed the substitution group relation between the abstract types and the head. I just added substitutionGroup=shape to fgshape and bgshape and now it works. I guess I just missed it as I was relying too much on inheritance. I probably figured the hierarchy alone was enough for eraseShape to accept cloud, as you would expect in OOP, so I didn't bother to apply them to the abstract types. Thanks for being my rubber duck ;) Erik Erik van Zijst wrote: Let me apologize in advance for the fact that this question is not directly a xmlbeans issue. Instead, it's something I ran into several times while using xmlbeans. I know I'd better take it to a decent xml forum, but with all the expertise here, let me give it a try nevertheless. I'm having trouble translating my object inheritance models to xmlschema and have illustrated this in the attached example xsd and xml. In my example I have a canvas for drawing a new painting and the xsd contains the instructions for drawing this painting. According to instructor Bob, a painting constists of two basic parts: background and foreground. An object is either a background or foreground object. In the final stage, Bob removes objects that turned out ugly. This can be any type of object. The schema defines an abstract type shape which fgshape and gbshape inherit from. It uses substitutiongroups with head shape. drawBackground only accepts background shapes, drawForeground only accepts foreground shapes, while eraseShapes accepts everything. The problem is that the painting as defined in painting.xml is not valid according to the schema, because eraseShapes expects an element of type shape, rather than cloud or its substitutiongroup fgshape. The error xmlbeans gives is: Validation error at line: 12: Expected element '[EMAIL PROTECTED]://prutser.cx/schemas/painting' instead of '[EMAIL PROTECTED]://prutser.cx/schemas/painting' here in element [EMAIL PROTECTED]://prutser.cx/schemas/painting In an OO programming language this is not a problem. Cloud extends fgshape, while fgshape extends shape, so you'll have no problem passing a cloud instance to eraseShapes. How does one tackle this problem? Am I using substitutionGroups incorrectly? I do want to be able to use the names of the concrete elements, rather than shape type=cloud color=white cloudtype=cumulunimbus/ if that's possible. Erik van Zijst ?xml version=1.0 encoding=UTF-8? xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; targetNamespace=http://prutser.cx/schemas/painting; xmlns=http://prutser.cx/schemas/painting; xmlns:tns=http://prutser.cx/schemas/painting; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xs:element name=painting xs:complexType xs:sequence xs:element ref=drawBackground/ xs:element ref=drawForeground/ xs:element ref=eraseShapes/ /xs:sequence /xs:complexType /xs:element xs:element name=drawBackground xs:complexType xs:sequence xs:element ref=bgshape minOccurs=1 maxOccurs=unbounded/ /xs:sequence /xs:complexType /xs:element xs:element name=drawForeground xs:complexType xs:sequence xs:element ref=fgshape minOccurs=1 maxOccurs=unbounded/ /xs:sequence /xs:complexType /xs:element xs:element name=eraseShapes xs:complexType xs:sequence xs:element ref=shape minOccurs=1 maxOccurs=unbounded/ /xs:sequence /xs:complexType /xs:element xs:element name=shape type=shape-type abstract=true/ xs:complexType name=shape-type abstract=true xs:attribute name=color type=xs:string use=required/ xs:attribute name=preferredBrush type=xs:string use=optional/ /xs:complexType xs:element name=bgshape type=bgshape-type abstract=true/ xs:complexType name=bgshape-type abstract=true xs:complexContent xs:extension base=shape-type/ /xs:complexContent /xs:complexType xs:element name=cloud type=cloud-type substitutionGroup=bgshape/
RE: QName to package
Pat, I'm assuming you want to find out the java name for a corresponding to the top level element name of a document, if that is the case first you have to find the SchemaType describing that document type XMLBeans.findDocumentType(QName topLevelElementName) (or XMLBeans.findType(QName) if you have the qname of a type), and than call sType.getJavaName() to find out the name of the interface. Cezar -Original Message- From: pat [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 22, 2006 5:49 AM To: user@xmlbeans.apache.org Subject: QName to package Hi, I need to convert QName to java package name. I've go through the classes, but I cannot find some conversion method. Is there a such method for conversion QName to java package ??? Thanks Pat - 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: alternate representations of collections in XMLBeans??
Tim, I would recommend using the extensions, otherwise modifying the generated code is definitely possible but missing even a small thing would break the code. Back to using extensions, if one wants to store a state he can do it by using XmlBookmark which stays with the xml entity even if moved. In your case the hash map should be stored on metadata element. Also the pre/post Set methods are called every time the document is about to change, so youll get calls for all creation/modification/deletion events, made through XmlObject interfaces. Modification through other interfaces like XmlCursor or DOM will not trigger the calls to the pre/post Set methods. Cezar From: Tim Parker [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 1:11 PM To: user@xmlbeans.apache.org Subject: alternate representations of collections in XMLBeans?? The XMLBeans representation of a collection (for something with a maxOccurs GT 1) is a bit limiting... I'm looking to extend it to look more like a Map interface... and I'm hitting some brick walls... For discussion sake, I'll use a structure with three fields: struct foo { int ID; String name; HashMap metadata; } The 'metadata' field contains arbitrary name/value pairs - for simplicity we'll say 'name' and 'value' fields in the hashmap are always strings... The obvious (to me, at least)schema for this is something like: xs:complexType name=NVP xs:sequence xs:element name=Value type=xs:string/ /xs:sequence xs:attribute name=Name type=xs:string/ /xs:complexType xs:complexType name=NVPCollection xs:sequence xs:element name=Entry type=my:NVP minOccurs=0 maxOccurs=unbounded/ /xs:sequence /xs:complexType xs:complexType name=testCase xs:sequence xs:element name=ID type=xs:int/ xs:element name=name type=xs:string/ xs:element name=metadata type=my:NVPCollection/ /xs:sequence /xs:complexType I could build another layer on top of this, butthis could get ugly- What I really need is a way to extend NVPCollection so I can address items by name (like in a HashMap) rather than by position... The ideal would be something like (assuming that we have a mechanism to bind the 'name' field to the map key and the 'value' field to be the one of interest)... NVPCollection thisCollection; // some magic here to get the collection populated... someValue = thisCollection.GetByMap(someArbitraryName); Or we could save some binding complexity by doing ...GetByMap(someArbitraryName,value), saying get the field 'value' from the collection member whose key fieldcontains 'someArbitraryName' (The presumption is that the binding to the key field 'name' would need to be established earlier so the map can be maintained) As I read the documentation, I could build an extension like this, but I'm hosed if I want to do anything more sophisticated than a linear search through the collection on each 'get' call - Unless I'm missing something, I need a place to put an instance-specific HashMap object to maintain mapping between the key field ('name') and the array index... more than a little difficult with the 'static method' requirement for the extension (Not to mention the population problem for the HashMap object itself, but a preSet or postSet implementation would work as long as I never try to delete anything).. Presumably I could also build an 'extendedNVPCollection' class, based on the NVPCollection class generated by XMLBeans, but how would I wire that back into my (XMLBeans-generated) 'testCase' class? I don't want to get into creating wrapper classes for every layer... I tried ignoring thedon't touch - generated code warningsand added some stuff directly to the generated classes for the NVPCollection object, but things started breaking- I'm not sure if the problem is a flaw in my hacking or a fundamental problem I won't solve, so I'm seeking advice -am I tilting at windmills here? Does anyone have ideas as to better ways to do this? === Tim Parker Senior Developer PaperThin, Inc. 617-471-4440 x 203 [EMAIL PROTECTED] www.paperthin.com === PaperThin, Inc. was recently named to KMWorlds 100 Companies that Matter in Knowledge Management. Find out more at www.paperthin.com. ___ 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
RE: alternate representations of collections in XMLBeans??
That is a good article to read, also check out the tests under test\cases\xbean\extensions. Cezar From: Tim Parker [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 3:08 PM To: user@xmlbeans.apache.org Subject: RE: alternate representations of collections in XMLBeans?? Thank you for the quick reply - I'll look into the XMLBookmark idea... Is there anything else I need to know about the preSet and postSet methods? I found documentation (including the operationType values) at http://dev2dev.bea.com/pub/a/2004/11/Configuring_XMLBeans.html- is this the latest-and-greatest, or is there a better and/or more current reference available? Tim From: Cezar Andrei [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 2:29 PM To: user@xmlbeans.apache.org Subject: RE: alternate representations of collections in XMLBeans?? Tim, I would recommend using the extensions, otherwise modifying the generated code is definitely possible but missing even a small thing would break the code. Back to using extensions, if one wants to store a state he can do it by using XmlBookmark which stays with the xml entity even if moved. In your case the hash map should be stored on metadata element. Also the pre/post Set methods are called every time the document is about to change, so youll get calls for all creation/modification/deletion events, made through XmlObject interfaces. Modification through other interfaces like XmlCursor or DOM will not trigger the calls to the pre/post Set methods. Cezar From: Tim Parker [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 1:11 PM To: user@xmlbeans.apache.org Subject: alternate representations of collections in XMLBeans?? The XMLBeans representation of a collection (for something with a maxOccurs GT 1) is a bit limiting... I'm looking to extend it to look more like a Map interface... and I'm hitting some brick walls... For discussion sake, I'll use a structure with three fields: struct foo { int ID; String name; HashMap metadata; } The 'metadata' field contains arbitrary name/value pairs - for simplicity we'll say 'name' and 'value' fields in the hashmap are always strings... The obvious (to me, at least)schema for this is something like: xs:complexType name=NVP xs:sequence xs:element name=Value type=xs:string/ /xs:sequence xs:attribute name=Name type=xs:string/ /xs:complexType xs:complexType name=NVPCollection xs:sequence xs:element name=Entry type=my:NVP minOccurs=0 maxOccurs=unbounded/ /xs:sequence /xs:complexType xs:complexType name=testCase xs:sequence xs:element name=ID type=xs:int/ xs:element name=name type=xs:string/ xs:element name=metadata type=my:NVPCollection/ /xs:sequence /xs:complexType I could build another layer on top of this, butthis could get ugly- What I really need is a way to extend NVPCollection so I can address items by name (like in a HashMap) rather than by position... The ideal would be something like (assuming that we have a mechanism to bind the 'name' field to the map key and the 'value' field to be the one of interest)... NVPCollection thisCollection; // some magic here to get the collection populated... someValue = thisCollection.GetByMap(someArbitraryName); Or we could save some binding complexity by doing ...GetByMap(someArbitraryName,value), saying get the field 'value' from the collection member whose key fieldcontains 'someArbitraryName' (The presumption is that the binding to the key field 'name' would need to be established earlier so the map can be maintained) As I read the documentation, I could build an extension like this, but I'm hosed if I want to do anything more sophisticated than a linear search through the collection on each 'get' call - Unless I'm missing something, I need a place to put an instance-specific HashMap object to maintain mapping between the key field ('name') and the array index... more than a little difficult with the 'static method' requirement for the extension (Not to mention the population problem for the HashMap object itself, but a preSet or postSet implementation would work as long as I never try to delete anything).. Presumably I could also build an 'extendedNVPCollection' class, based on the NVPCollection class generated by XMLBeans, but how would I wire that back into my (XMLBeans-generated) 'testCase' class? I don't want to get into creating wrapper classes for every layer... I tried ignoring thedon't touch - generated code warningsand added some stuff directly to the generated classes for the NVPCollection object, but things started breaking- I'm not sure if the problem is a flaw in my hacking or a fundamental problem I won't solve, so I'm seeking advice -am I
RE: XMLBookmark question...
The rule is to call xmlCursor.dispose() after you finished the work with a cursor. Cezar From: Tim Parker [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 4:00 PM To: user@xmlbeans.apache.org Subject: XMLBookmark question... As a follow-on to the HashMap implementation questions... I feel like I may be missing something but... I'm looking at creating an extension methodfor my NVPCollection class something like: public String getValueByMap(String keyName) If I hang the hashmap on a bookmark, how do I get the bookmark without having to do a newCursor() every time? Or is it OK to run newCursor() dozens or hundreds of times without risk of performance or memory problems? Am I missing something? Tim From: Cezar Andrei [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 4:33 PM To: user@xmlbeans.apache.org Subject: RE: alternate representations of collections in XMLBeans?? That is a good article to read, also check out the tests under test\cases\xbean\extensions. Cezar From: Tim Parker [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 3:08 PM To: user@xmlbeans.apache.org Subject: RE: alternate representations of collections in XMLBeans?? Thank you for the quick reply - I'll look into the XMLBookmark idea... Is there anything else I need to know about the preSet and postSet methods? I found documentation (including the operationType values) at http://dev2dev.bea.com/pub/a/2004/11/Configuring_XMLBeans.html- is this the latest-and-greatest, or is there a better and/or more current reference available? Tim From: Cezar Andrei [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 2:29 PM To: user@xmlbeans.apache.org Subject: RE: alternate representations of collections in XMLBeans?? Tim, I would recommend using the extensions, otherwise modifying the generated code is definitely possible but missing even a small thing would break the code. Back to using extensions, if one wants to store a state he can do it by using XmlBookmark which stays with the xml entity even if moved. In your case the hash map should be stored on metadata element. Also the pre/post Set methods are called every time the document is about to change, so youll get calls for all creation/modification/deletion events, made through XmlObject interfaces. Modification through other interfaces like XmlCursor or DOM will not trigger the calls to the pre/post Set methods. Cezar From: Tim Parker [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 1:11 PM To: user@xmlbeans.apache.org Subject: alternate representations of collections in XMLBeans?? The XMLBeans representation of a collection (for something with a maxOccurs GT 1) is a bit limiting... I'm looking to extend it to look more like a Map interface... and I'm hitting some brick walls... For discussion sake, I'll use a structure with three fields: struct foo { int ID; String name; HashMap metadata; } The 'metadata' field contains arbitrary name/value pairs - for simplicity we'll say 'name' and 'value' fields in the hashmap are always strings... The obvious (to me, at least)schema for this is something like: xs:complexType name=NVP xs:sequence xs:element name=Value type=xs:string/ /xs:sequence xs:attribute name=Name type=xs:string/ /xs:complexType xs:complexType name=NVPCollection xs:sequence xs:element name=Entry type=my:NVP minOccurs=0 maxOccurs=unbounded/ /xs:sequence /xs:complexType xs:complexType name=testCase xs:sequence xs:element name=ID type=xs:int/ xs:element name=name type=xs:string/ xs:element name=metadata type=my:NVPCollection/ /xs:sequence /xs:complexType I could build another layer on top of this, butthis could get ugly- What I really need is a way to extend NVPCollection so I can address items by name (like in a HashMap) rather than by position... The ideal would be something like (assuming that we have a mechanism to bind the 'name' field to the map key and the 'value' field to be the one of interest)... NVPCollection thisCollection; // some magic here to get the collection populated... someValue = thisCollection.GetByMap(someArbitraryName); Or we could save some binding complexity by doing ...GetByMap(someArbitraryName,value), saying get the field 'value' from the collection member whose key fieldcontains 'someArbitraryName' (The presumption is that the binding to the key field 'name' would need to be established earlier so the map can be maintained) As I read the documentation, I could build an extension like this, but I'm hosed if I want to do anything more sophisticated than a linear search through the collection on each 'get' call - Unless I'm missing something, I need a place to put
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]
RE: inheritance: I m I allowed to subClass an XmlMyGeneratedObjectImpl
Ben, Take a look at extensions, it's probably what you're looking for: http://wiki.apache.org/xmlbeans/ExtensionInterfacesFeature Cezar -Original Message- From: Ben Jelloul Marouane [mailto:[EMAIL PROTECTED] Sent: Friday, April 28, 2006 7:32 AM To: xmlbeans user mailing list Subject: inheritance: I m I allowed to subClass an XmlMyGeneratedObjectImpl Hi, my problem is this: I have a generated with scomp: Public Interface XmlHolderTypeLib Public Class XmlHolderTypeLibImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements HolderTypeLib I need a Class HolderTypeLib that I can load with an xml file but that have also a lot of other methods that I will add. The problem is that the XmlHolderTypeLib.Factory.parse(file) will create a instance of XmlHolderTypeLibImpl. Is it correct to do (I m not sure because XmlHolderTypeLibImpl is in an impl package): Class HolderTypeLib extends XmlHolderTypeLibImpl and even if it is correct how I will create an instance of HolderTypeLib. Thanks, Marouane - 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: SV: xml-fragment containing well formed XML Documents
This is a case where you have to use the XmlCursor API to copy/move the two documents into the right place. Cezar -Original Message- From: jadiyo [mailto:[EMAIL PROTECTED] Sent: Friday, April 28, 2006 3:34 AM To: user@xmlbeans.apache.org Subject: Re: SV: xml-fragment containing well formed XML Documents Hi again, What approach would be best to create this particular part of the document. As mentioned before, the element will contain any number of well formed documents. In my case, I have 2 documents to add to the MessageText.These documents are created independently. Any attempt to add the 2 documents to the MessageText, results in them being wrapped in a CDATA. Ideally, what I would like is something like this. MessageText ah:AppHdr xmlns:ah=urn:swift:xsd:$ahV10 ah:From ah:Typeei Type From/ah:Type ah:Idei ID From/ah:Id /ah:From /ah:AppHdr Doc:Document xmlns:Doc=urn:swift:xsd:swift.if.ia$setr.010.001.02 Doc:MstrRefthe Master Reference/Doc:MstrRef /Doc:Document /MessageText Again, many thanks in advance. Nirmal -- View this message in context: http://www.nabble.com/%3Cxml-fragment%3E- containing-well-formed-XML-Documents-t1480526.html#a4136239 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: Replacement for QNameHelper.updateWellKnownPrefixes?
Did you try XmlOptions setSaveSuggestedPrefixes() ? From: Pantvaidya, Vishwajit [mailto:[EMAIL PROTECTED] Sent: Friday, April 28, 2006 1:30 PM To: user@xmlbeans.apache.org Subject: Replacement for QNameHelper.updateWellKnownPrefixes? I have some old code that uses 1.0.2 xmlbeans it has a call to QNameHelper.updateWellKnownPrefixes to update some prefixes. I see that the call updates the prefixes into the WELL_KNOWN_PREFIXES map. But this method no longer exists is there another suggested way to achieve the same goal? - Vish. ___ 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: inheritance: I m I allowed to subClass anXmlMyGeneratedObjectImpl
In the early days of XMLBeans we implemented something very similar to what you describe, but it was failing to work when schema types where using inheritance. The solution implemented today even if less nice, is working in those cases and allows the runtime to use the memory more efficiently when extensions are both used or not. Another option, which I don't recommend since I think is way worse than using extensions - but you might want to consider it, is to generate the sources and than explicitly modify and package them. Cezar -Original Message- From: Ben Jelloul Marouane [mailto:[EMAIL PROTECTED] Sent: Monday, May 01, 2006 11:06 AM To: xmlbeans user mailing list Subject: RE: inheritance: I m I allowed to subClass anXmlMyGeneratedObjectImpl Thanks for the link But still some questions remains. I m playing with ExtensionInterfacesFeature it but it is not very user friendly because of the FooHandler that must have a static methode foo(xmlObject xo, String s). and also because every code change means regenerate XmlBeanGeneratedInterface. What I m looking for would lot more easy to handle: I want to do something like this. XmlBeanGeneratedInterface.Factory.parse(file, MyClass) that would return an instance of MyClass (of course MyClass extends The class XmlBeanGeneratedInterfaceImpl) For the case described before it would be: XmlHolderTypeLib.Factory.parse(file, HolderTypeLib) that would return an instance of HolderTypeLib. And then whatever I add to HolderTypeLib I will not need to regenerate xmlBeans interface. Or even if I subclass it again (HolderTypeLibSub extends HolderTypeLib) I want to be able to do also XmlHolderTypeLib.Factory.parse(file, HolderTypeLibSub) Does someone have an idea, I m sure it should be possible. If some of the developer of xmlBeans see this can you tell me if there is a chance to do that (or not at all). Thanks, Marouane On Fri, 2006-04-28 at 18:51, Cezar Andrei wrote: Ben, Take a look at extensions, it's probably what you're looking for: http://wiki.apache.org/xmlbeans/ExtensionInterfacesFeature Cezar -Original Message- From: Ben Jelloul Marouane [mailto:[EMAIL PROTECTED] Sent: Friday, April 28, 2006 7:32 AM To: xmlbeans user mailing list Subject: inheritance: I m I allowed to subClass an XmlMyGeneratedObjectImpl Hi, my problem is this: I have a generated with scomp: Public Interface XmlHolderTypeLib Public Class XmlHolderTypeLibImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements HolderTypeLib I need a Class HolderTypeLib that I can load with an xml file but that have also a lot of other methods that I will add. The problem is that the XmlHolderTypeLib.Factory.parse(file) will create a instance of XmlHolderTypeLibImpl. Is it correct to do (I m not sure because XmlHolderTypeLibImpl is in an impl package): Class HolderTypeLib extends XmlHolderTypeLibImpl and even if it is correct how I will create an instance of HolderTypeLib. Thanks, Marouane - 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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: inheritance: I m I allowed to subClassanXmlMyGeneratedObjectImpl
Is by any chance one complex schema type extending the other? If not it should work, or it's a bug. In this case, will you file it in JIRA with the repro files? Cezar -Original Message- From: Ben Jelloul Marouane [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 02, 2006 3:51 AM To: xmlbeans user mailing list Subject: RE: inheritance: I m I allowed to subClassanXmlMyGeneratedObjectImpl I tried the ExtensionInterfacesFeature But I reach this problem: (info so you do not get lost: I added prefix Xml in schema.xsdconf) if in my schema.xsd (and schema.xsdconf) 1 of my complexTypes extends MyInterface It Works OK. But if in my schema.xsd I have 2 complexTypes and I want that both extends IAdapter then when a generate the second time (using schema.xsdconf with interface) XmlHolderType extends IAdaptable XmlHolderTypeLib extends IAdaptable I have this error: error: Colliding methods 'getAdapter(java.lang.Class)' in interfaces org.myhandler.IAdaptableHandler and org.myhandler.IAdaptableHandler And yes it is twice the same object org.myhandler.IAdaptableHandler and org.myhandler.IAdaptableHandler. And the Handler IAdaptableHandler is used twice in schema.xsdconf. Is it the problem ? Here is my schema.xsdconf - xb:config xmlns:xb=http://xml.apache.org/xmlbeans/2004/02/xbean/config; xb:namespace uri=##any xb:prefixXml/xb:prefix /xb:namespace xb:extension for=org.eclipsage.xtecan.XmlHolderTypeLib xb:interface name=org.eclipse.core.runtime.IAdaptable xb:staticHandlerorg.myhandler.IAdaptableHandler/xb:staticHandler /xb:interface /xb:extension xb:extension for=org.eclipsage.xtecan.XmlHolderType xb:interface name=org.eclipse.core.runtime.IAdaptable xb:staticHandlerorg.myhandler.IAdaptableHandler/xb:staticHandler /xb:interface /xb:extension /xb:config -- do you think it can be a bug ? Other discussion: you say In the early days of XMLBeans we implemented something very similar to what you describe, but it was failing to work when schema types where using inheritance. but if I can create an instance of whatever class (that extends BaseImpl or extends someclass that extends BaseImpl), then I can add whatever to that class and my xmlBeans Interfaces does not need to inherit at all. Thanks for the answers. Marouane On Mon, 2006-05-01 at 21:03, Cezar Andrei wrote: In the early days of XMLBeans we implemented something very similar to what you describe, but it was failing to work when schema types where using inheritance. The solution implemented today even if less nice, is working in those cases and allows the runtime to use the memory more efficiently when extensions are both used or not. Another option, which I don't recommend since I think is way worse than using extensions - but you might want to consider it, is to generate the sources and than explicitly modify and package them. Cezar -Original Message- From: Ben Jelloul Marouane [mailto:[EMAIL PROTECTED] Sent: Monday, May 01, 2006 11:06 AM To: xmlbeans user mailing list Subject: RE: inheritance: I m I allowed to subClass anXmlMyGeneratedObjectImpl Thanks for the link But still some questions remains. I m playing with ExtensionInterfacesFeature it but it is not very user friendly because of the FooHandler that must have a static methode foo(xmlObject xo, String s). and also because every code change means regenerate XmlBeanGeneratedInterface. What I m looking for would lot more easy to handle: I want to do something like this. XmlBeanGeneratedInterface.Factory.parse(file, MyClass) that would return an instance of MyClass (of course MyClass extends The class XmlBeanGeneratedInterfaceImpl) For the case described before it would be: XmlHolderTypeLib.Factory.parse(file, HolderTypeLib) that would return an instance of HolderTypeLib. And then whatever I add to HolderTypeLib I will not need to regenerate xmlBeans interface. Or even if I subclass it again (HolderTypeLibSub extends HolderTypeLib) I want to be able to do also XmlHolderTypeLib.Factory.parse(file, HolderTypeLibSub) Does someone have an idea, I m sure it should be possible. If some of the developer of xmlBeans see this can you tell me if there is a chance to do that (or not at all). Thanks, Marouane On Fri, 2006-04-28 at 18:51, Cezar Andrei wrote: Ben, Take a look at extensions, it's probably what you're looking for: http://wiki.apache.org/xmlbeans/ExtensionInterfacesFeature Cezar -Original Message- From: Ben Jelloul Marouane [mailto:[EMAIL PROTECTED] Sent: Friday, April 28, 2006 7:32 AM To: xmlbeans user mailing list Subject: inheritance: I m I allowed to subClass
RE: SV: xml-fragment containing well formed XML Documents
In my example the namespaces seem to work: XmlObject xo = XmlObject.Factory.parse(r:a xmlns:r='a_uri'r:bsome text/r:b/r:a); XmlCursor xc = xo.newCursor(); xc.toFirstChild(); XmlObject aContent = xc.getObject(); System.out.println(aContent: + aContent); XmlOptions xmlOpts = new XmlOptions().setSaveSyntheticDocumentElement(new QName(uri, local, prefix)); System.out.println(aContent saveSyntheticDocElem: + aContent.xmlText(xmlOpts)); Cezar -Original Message- From: jadiyo [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 02, 2006 12:09 PM To: user@xmlbeans.apache.org Subject: RE: SV: xml-fragment containing well formed XML Documents Thanks Cezar. I tried this and it worked. The only problem I found is that the xmlns attribute is lost. So, instead of seeing AppHdr xmlns=urn:swift:xsd:$ahV10 I only see urn:AppHdr Any ideas? Thanks again Nirmal -- View this message in context: http://www.nabble.com/%3Cxml-fragment%3E- containing-well-formed-XML-Documents-t1480526.html#a4185490 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: Question concerning advanced XPath support
There isn't a way currently to bind other variables except for the current node, but this is something that we'll be looking into. As for the XPath extension functions, I'm not familiar how they work. Do you have a use case? Do you know if and how Saxon is supporting them? Cezar -Original Message- From: cbryant [mailto:[EMAIL PROTECTED] Sent: Thursday, May 04, 2006 11:56 AM To: user@xmlbeans.apache.org Subject: Question concerning advanced XPath support Hi All, After much perusal, I have yet to find documentation concerning whether or not XMLBeans supports the following two advanced XPath features: 1) XPath variables 2) XPath extension functions If these is supported, can you direct me to documentation describing how to implement them? Thanks, Coram -- View this message in context: http://www.nabble.com/Question-concerning- advanced-XPath-support-t1558466.html#a4233199 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]
SVN service
In case youre using the SVN service and you didnt know already the service is down at the moment. The guys from infrastructure are working on it, rebuilding the server. The status can be found here: http://monitoring.apache.org/status/ . 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.
RE: SOAP encoding question
I believe you need to include the SOAP schema file when compiling it, or at least have a previously compiled jar on the classpath. The xsd should be found at the following location: http://schemas.xmlsoap.org/soap/encoding/ . Cezar From: Maya Dahan [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 07, 2006 7:07 AM To: user@xmlbeans.apache.org Subject: SOAP encoding question Hi all, In the list of changes for XmlBeans v2.0.0-beta1they specified: Added ability to compile Schemas containing references to SOAP11 encoded arrays I have a WSDL that contains severalSOAP arrays; while trying to compile it using Scomp I am getting several errors: C:\Tools\XBean\2.1\xmlbeans-2.1.0\Test..\bin\scomp GlobalWeather.wsdl C:\Tools\XBean\2.1\xmlbeans-2.1.0\Test\GlobalWeather.wsdl:0: warning: The WSDL GlobalWeather.wsdl uses SOAP encoding. SOAP encoding is not compatible with literal XML Schema. C:\Tools\XBean\2.1\xmlbeans-2.1.0\Test\GlobalWeather.wsdl:15:6: error: src-resolve: type '[EMAIL PROTECTED]://schemas.xmlsoap.org/soap/encoding/' not found. C:\Tools\XBean\2.1\xmlbeans-2.1.0\Test\GlobalWeather.wsdl:19:7: error: src-resolve: attribute '[EMAIL PROTECTED]://schemas.xmlsoap.org/soap/encoding/' not found. C:\Tools\XBean\2.1\xmlbeans-2.1.0\Test\GlobalWeather.wsdl:25:6: error: src-resolve: type '[EMAIL PROTECTED]://schemas.xmlsoap.org/soap/encoding/' not found. C:\Tools\XBean\2.1\xmlbeans-2.1.0\Test\GlobalWeather.wsdl:29:7: error: src-resolve: attribute '[EMAIL PROTECTED]://schemas.xmlsoap.org/soap/encoding/' not found. C:\Tools\XBean\2.1\xmlbeans-2.1.0\Test\GlobalWeather.wsdl:51:6: error: src-resolve: type '[EMAIL PROTECTED]://schemas.xmlsoap.org/soap/encoding/' not found. C:\Tools\XBean\2.1\xmlbeans-2.1.0\Test\GlobalWeather.wsdl:55:7: error: src-resolve: attribute '[EMAIL PROTECTED]://schemas.xmlsoap.org/soap/encoding/' not found. C:\Tools\XBean\2.1\xmlbeans-2.1.0\Test\GlobalWeather.wsdl:68:6: error: src-resolve: type '[EMAIL PROTECTED]://schemas.xmlsoap.org/soap/encoding/' not found. C:\Tools\XBean\2.1\xmlbeans-2.1.0\Test\GlobalWeather.wsdl:72:7: error: src-resolve: attribute '[EMAIL PROTECTED]://schemas.xmlsoap.org/soap/encoding/' not found. C:\Tools\XBean\2.1\xmlbeans-2.1.0\Test\GlobalWeather.wsdl:126:6: error: src-resolve: type '[EMAIL PROTECTED]://schemas.xmlsoap.org/soap/encoding/' not found. C:\Tools\XBean\2.1\xmlbeans-2.1.0\Test\GlobalWeather.wsdl:130:7: error: src-resolve: attribute '[EMAIL PROTECTED]://schemas.xmlsoap.org/soap/encoding/' not found. C:\Tools\XBean\2.1\xmlbeans-2.1.0\Test\GlobalWeather.wsdl:150:6: error: src-resolve: type '[EMAIL PROTECTED]://schemas.xmlsoap.org/soap/encoding/' not found. C:\Tools\XBean\2.1\xmlbeans-2.1.0\Test\GlobalWeather.wsdl:154:7: error: src-resolve: attribute '[EMAIL PROTECTED]://schemas.xmlsoap.org/soap/encoding/' not found. Time to build schema type system: 1.262 seconds BUILD FAILED What am I doing wrong? Many thanks -- Maya ___ 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 2.1.0 NOT WORKING!!! on windows ?
Make sure you have javac on the path and JAVA_HOME is pointing to its jdk install dir. Cezar From: Ziv Zeira [mailto:[EMAIL PROTECTED] Sent: Monday, June 12, 2006 1:59 PM To: user@xmlbeans.apache.org Subject: xmlbeans 2.1.0 NOT WORKING!!! on windows ? Hi everybody, xmlbeans 2.1.0 on windows NOT WORKING!!!??? I went through all the instructions and filled each one of them However, for some reason I'm constantly getting the following error: C:\Documents and Settings\ziv.zeirascomp -out asaf.jar C:\XMLbeans\xmlbeans-current\xmlbeans-2.1.0\samples\MixedContent\schemas\inventory.xsd Time to build schema type system: 0.935 seconds Time to generate code: 0.218 seconds java.io.IOException: CreateProcess: C:\Documents and Settings\ziv.zeira\javac@C:\DOCUME~1\ZIV~1.ZEI\LOCALS~1\Temp\javac5736 error=2null java.io.IOException: CreateProcess: C:\Documents and Settings\ziv.zeira\javac@C:\DOCUME~1\ZIV~1.ZEI\LOCALS~1\Temp\javac5736 error=2 at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.init(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at org.apache.xmlbeans.impl.tool.CodeGenUtil.externalCompile(CodeGenUtil.java:231) at org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java:1126) at org.apache.xmlbeans.impl.tool.SchemaCompiler.main(SchemaCompiler.java:368) BUILD FAILED C:\Documents and Settings\ziv.zeira I can't find anything wrong with environment variables or any other environment problems for that matter. I also went through a suggested solution on the FAQ page which is suggesting moving the JDK files one level up: http://wiki.apache.org/xmlbeans/XmlBeansFaq#scompFindingJavac ___ 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: 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 PM To: dev@xmlbeans.apache.org Subject: 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.
RE: New release: v2.2
If you find issues with the release candidate bits please send them to the dev@xmlbeans.apache.org list. For other kind of bugs, please file them under JIRA. (I just added version 2.2). Cezar -Original Message- From: cbryant [mailto:[EMAIL PROTECTED] Sent: Monday, June 12, 2006 5:47 PM To: user@xmlbeans.apache.org Subject: RE: New release: v2.2 Is there a circulating list of the bug fixes and enhancements for v2.2? Thanks, Coram -- View this message in context: http://www.nabble.com/RE%3A-New-release%3A- v2.2-t1776047.html#a4837993 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: Can I stream XMLBeans to disk in a way that saves memory?
Hi Brian, We've been thinking of adding something on these lines to XMLBeans but I couldn't find the time for it. We've been thinking to use the pull parser model of Stax and to be able to filter (custom or XPath) small pieces in and out of an XmlObject. This should be working for both reading and writing of large messages. This seems to be something that other users asked for, we should consider adding it to the package. Please let me if I can help you with more info on how XMLBeans work. Cezar -Original Message- From: Hartin, Brian [mailto:[EMAIL PROTECTED] Sent: Thursday, June 15, 2006 4:42 PM To: 'user@xmlbeans.apache.org' Cc: Hartin, Brian Subject: Can I stream XMLBeans to disk in a way that saves memory? Hello, Is anyone aware of a way to write an XML document, using XMLBeans, without materializing the entire document in memory? Perhaps using a companion API such as XStream or StAX? Our application communicates with other apps via XML messages. We've written schemas to define the messages, and used XMLBeans to generate java classes for manipulation of that data on the way in and out. Now we've encountered a need to send very large messages, which is causing memory problems since we must first construct the entire XMLBeans document before calling save(). I'm aware that I can manipulate the XmlOptions so that I can write the elements out bit by bit, i.e. I can write code such as: write A open tag write B open tag write B simple element B1 write B simple element B2 write B close tag write A simple element A1 write A close tag I'll get: ABB1B2/B/A1/A But...I'll have hard coded the knowledge of the order in which the elements appear in the schema. I don't want to do that, since that is the value provided by XmlBeans' save() method - it writes things appropriately according to the schema. I'm considering writing my own implementation of this, so that as I assemble the document, elements are written to disk 'on-the-fly' as appropriate, and pruned from memory when their close tag is written. However, before I trudge down that road, I'd like to know if I'm reinventing the wheel. Has anyone got any ideas? Thanks a lot, Brian ** ** This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. ** ** - 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: Feature request: Array Reordering
This is already possible using the XmlCursor API. Check out XmlCursor's moveXml() and moveXmlContents() methods. Cezar -Original Message- From: Ole Matzura [mailto:[EMAIL PROTECTED] Sent: Monday, June 19, 2006 5:53 PM To: user@xmlbeans.apache.org Subject: Feature request: Array Reordering Hi all! this may be a little late for the upcoming release, but it would be great if a future release had support for reordering the contents of List (as generated for a sequence) without requiring to recreate affected element(s); today if I want to reorder the contents of a List I need to create copies of the existing XmlObjects instead of just being able to move them, for example: FooType[] array = t.getFooArray(); // array.length == 4 FooType f = (FooType) array[3].copy(); // you need to do a copy here, otherwise the next statement will obliterate array[3] t.setFooArray(3, array[1]); t.setFooArray(1, f); should be replaced by something like t.moveFooArrayItem( int sourceIndex, int targetIndex ); ie t.moveFooArrayItem( 3, 1 ); understandable? Maybe this is already possible in some other way? best regards! /Ole eviware.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]
[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]
RE: Base64 Decoding
Did you try using XmlCursor? Cezar -Original Message- From: Satish Kumar [mailto:[EMAIL PROTECTED] Sent: Thursday, July 06, 2006 12:42 AM To: user@xmlbeans.apache.org Subject: Base64 Decoding Hi, Need some clarifactions ! XSD contains an element whcih is of type base64Binary. After unmarshlling the XML, i use the method getByteArrayValue() to fecth the value. XML beans automatically invokes its Base64 and decodes my object value, and returns me the decoded value. I dont want this to happen, i would like to get the encoded value as it is. I even tried using the method getStringValue(), this returns me the encoded value only, but internally XMLBeans decodes it to check whether the value is a valid Base64. I dont want this to happen, how can it be done. I need this in a case where an external application fisrt encodes a value and then sends it in small chunks by multiple xml's to our application. Our application will receive all the XML then concatenate the received bytes of this element and then only decode it. Thanks !!! Rgds, Satish http://adworks.rediff.com/cgi- bin/AdWorks/sigclick.cgi/www.rediff.com/signature- home.htm/[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: schema jars
You have to compile base.xsd alone first, than compile schema1.xsd having the first generated jar on classpath. scomp out base.jar base.xsd scomp cp base.jar out schema1.jar schema1.xsd scomp cp base.jar;schema1.jar out schema2.jar schema2.xsd Cezar From: sri [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 18, 2006 9:09 AM To: user@xmlbeans.apache.org Subject: schema jars I have a base schema base.xsd. there are two schemas schema1.xsd and schema2.xsd that import this base schema. Is there a way to create the base jar first using the schema compiler and then include this in the class path so that the schema1.jar produced when compiling schema1.xsd or schema2.jar produced when compiling schema2.xsd do not contain the base classes 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: Parsing problem
If your message is indeed the one expected, this seems to be a bug in AXIS2. The error is quite clear, in order for XMLBeans to instantiate an object of this type com.example.transfer_xsd.AnyXmlTypeInputParamDocument it has to have an xml that has a top level element called [EMAIL PROTECTED]://example.com/transfer.xsd . But it seems that it receives an element called essai instead, hence the error. Cezar From: Fabien Couble [mailto:[EMAIL PROTECTED] Sent: Friday, July 28, 2006 4:54 AM To: user@xmlbeans.apache.org Subject: Parsing problem Hi all, I'm a new user of xmlbeans. Actually, I'm using xmlbeans with AXIS2 and i have a parsing problem. I have generated all the schemas needed by xmlbeans (a directory schemaorg_apache_xmlbeans was created ). I have no problem to send a request. the problem is located when I receive a SOAP message. Actually, an exeption is raised. this exception tells me that it is not a correct type but my client sends the good type actually. This is the types I declare in my wsdl file: complexType name=AnyXmlType sequence xs:any namespace=##other processContents=lax / /sequence /complexType complexType name=AnyXmlOptionalType sequence xs:any minOccurs=0 namespace=##other processContents=lax / /sequence /complexType This is my client code: AnyXmlTypeInputParamDocument any = AnyXmlTypeInputParamDocument.Factory.newInstance(); XmlCursor anycursor = any.newCursor(); anycursor.toNextToken(); anycursor.beginElement(new QName(essai)); anycursor.insertChars(Et ta race!); //anycursor.toEndToken(); //Sending AnyXmlOptionalParamDocument doc = stub.Put(any); And this is the Exception raised: java.lang.RuntimeException: Data binding error#13; at org.apache.axis2.AxisFault.makeFault(AxisFault.java:318)#13; at com.example.transfer_wsdl.WSTransferServiceMessageReceiverInOut.invokeBusinessLogic(WSTransferServiceMessageReceiverInOut.java:88)#13; at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:37)#13; at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:503)#13; at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:284)#13; at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:144)#13; at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)#13; at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)#13; at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)#13; at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)#13; at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve..java:213)#13; at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve..java:178)#13; at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)#13; at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)#13; at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)#13; at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)#13; at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)#13; at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)#13; at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)#13; at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)#13; at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)#13; at java.lang.Thread.run(Unknown Source)#13; Caused by: java.lang.RuntimeException: Data binding error#13; at com.example.transfer_wsdl.WSTransferServiceMessageReceiverInOut.fromOM(WSTransferServiceMessageReceiverInOut.java:204)#13; at com.example.transfer_wsdl.WSTransferServiceMessageReceiverInOut.invokeBusinessLogic(WSTransferServiceMessageReceiverInOut.java:48)#13; ... 20 more#13; Caused by: org.apache.xmlbeans.XmlException: error: The document is not a [EMAIL PROTECTED]://example.com/transfer.xsd: document element mismatch got essai#13; at org.apache.xmlbeans.impl.store.Locale.verifyDocumentType(Locale.java:452)#13; at org.apache.xmlbeans.impl.store.Locale.autoTypeDocument(Locale.java:357)#13; at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:850)#13; at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:826)#13; at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:231)#13; at com.example.transfer_xsd.AnyXmlTypeInputParamDocument$Factory.parse(AnyXmlTypeInputParamDocument.java:86)#13; at com.example.transfer_wsdl.WSTransferServiceMessageReceiverInOut.fromOM(WSTransferServiceMessageReceiverInOut.java:167)#13; ... 21 more#13; I
RE: Fatal errors with the Piccolo parser and invalid xml header
Ken, There isn't a public API to reset the context piccolo instance. Please do file a bug with a repro in the JIRA so we can take a look at it. In the meantime, you can use XmlOptions setLoadUseXMLReader (XMLReader xmlReader) to use your own instance of Piccolo or any other SAX parser. Cezar -Original Message- From: Ken Robinson [mailto:[EMAIL PROTECTED] Sent: Thursday, August 03, 2006 5:31 PM To: user@xmlbeans.apache.org Subject: Fatal errors with the Piccolo parser and invalid xml header We've encountered a particularly nasty problem with the default piccolo parser and invalid xml headers. If the xml being parsed (via XmlObject.Factory.parse()) has a bad header (like ?xml encoding=UTF-8), a reasonable exception is thrown. This particular exception also appears to leave the piccolo instance in some sort of invalid state. Unfortunately, the instance also remains in the tl_saxLoaders ThreadLocal inside SystemCache, causing all subsequent parses in the same thread to fail with NullPointerExceptions inside the piccolo code. We've been able to replicate this issue with every version of XmlBeans from 2.0.0-beta1 through 2.2.0. Is there any likelyhood of getting this fixed, or barring that, is there any public API for forcing the bad parser out of the ThreadLocal? Thanks, Ken - 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: Parsing large file
There isnt a chunking mechanism in XMLBeans, but I pretty sure you can write a Stax or SAX wrapper (Stax should be easier) to split the big stream into smaller ones, and you can load a small subtree into an XMLBean, one at a time. Would this work for you? What kind of operations do you need to do on the huge file? Can they be made sequentially? Cezar From: John Harrison [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 09, 2006 1:34 AM To: user@xmlbeans.apache.org Subject: Parsing large file Hi, I am investigating XML parsers for parsing huge(around 2GB XML file). Each file can have around 500,00-750,000 objects. Due to theses numbers it is not practicle to store everything in memory. Does XMLBeans provides any facilities to parse such huge files? Is there any thing that XMLBean provides to parse file in stages from IOStream? Any input on this is much appreciated. Regards John. ___ 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: JDK 1.5 Generics rsp. Enumerations in generated java-code?
Did you try using scomp script directly; it might be a bug in the ant task implementation. Cezar From: Siegfried Baiz [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 10, 2006 10:54 AM To: user@xmlbeans.apache.org Subject: Re: JDK 1.5 Generics rsp. Enumerations in generated java-code? Hallo, I really would be thankful for any comments. Is this below a stupid question? If not, I wonder why nobody pays any attention on this? Thank in advance Siggi Siegfried Baiz schrieb: Hallo All, I' m using XmlBeans 2.2.0 for compiling XSD-Files to Java-Classes. I've read about possibilities to take advantage of JDK 1.5 Generics and/or Enumerations in XMLBeans generated classes? In my ANT-build-File I' ve tried several Options like ... xmlbean schema=schemas destfile=build/lib/schemas.jar srcgendir=src javasource=1.5 classpathref=xmlbeans.path debug=on / ... javac srcdir=src destdir=build/classes classpathref=Any.path debug=on source=1.5 target=1.5 / ... but in the generated java-files I cannot see any difference to Java 1.4. Has anyone any suggestions? - Siggi ___ 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: Updating source doc after XPath search
Robert, .selectPath returns live objects from the original tree which was executed on. .execPath will always return new documents, sometimes copies of the original. In order to avoid loosing the results once you modify the document you should: 1. run select path with a cursor: XmlCursor.selectPath() 2. iterate through results hasNextSelection(), toNextSelection() 3. put bookmarks on selected places 4. move cursor to first bookmark 5. iterate through saved bookmarks 6. modify xml Cezar -Original Message- From: Robert W. Wade [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 10:48 PM To: user@xmlbeans.apache.org Subject: Updating source doc after XPath search I am trying to figure out if a way exists for me to accomplish the following: - perform an XPath search against my main doc (xml doc A) - iterate through the results - periodically modify the xml values within the results - when i view xml doc A (that I performed the search on) I would like to see the data that I modified. Reading the javadocs (and playing with the code), there are two ways to do XPath searches: .selectPath() : performs the search OK, but when you modify the data it is not persisted, so when I view xml doc A I do not see the updated data .execQuery() : (according to the docs) it appears that the query would work, but the results would be copies of the data elements within my xml doc A. This means that if I update the results they won't be persisted in xml doc A. If I am wrong about these two methods please let me know. My fallback option is to manually iterate through my xml doc A and find the results myself. Not too cool. Thanks __ 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] ___ 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:
Anshul, The latest release compatible with JDK1.3.1 is xmlbeans-1.0.4-jdk1.3. You can find it in the download section of the project: http://xmlbeans.apache.org/sourceAndBinaries/index.html#Current+Release Since v2, XMLBeans is only compatible with jdk1.4 or higher. Cezar From: Bhatnagar, Anshul [mailto:[EMAIL PROTECTED] Sent: Thursday, November 16, 2006 6:18 AM To: Bhatnagar, Anshul Subject: Hi, I am using XMLBeans Development Kit Version 2.2.0 to parse xml. Does XMLBeans Development Kit Version 2.2.0 will work on JDK 1.3.1_06? If not, then please suggest which version of XMLBean will work on JDK 1.3.1_06? Your quick help will be appreciated. my email Id is [EMAIL PROTECTED] Thanks in advance. Regards, Anshul Disclaimer : This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. ___ 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 define an interface extension for all created java-Types rsp. all schema-elements
Have you tried using: xb:extension for=* ? Cezar -Original Message- From: Siegfried Baiz [mailto:[EMAIL PROTECTED] Sent: Friday, December 08, 2006 4:07 PM To: user@xmlbeans.apache.org Subject: how to define an interface extension for all created java-Types rsp. all schema-elements Hi All, I'd need some help for Interface Extensions via .xsdconfig: For a given xsd-file I want to create XmlBeans with the following Property: *each created class should implement an given Interface, say IAdaptable* I wonder if it's possible to custumize .xsdconfig in order to get an Interface Extensions for all created java-Types i.e. for all nodes of in the given schema-file? Some months ago I tried something like this: xb:extension for=org.apache.xmlbeans.XmlObject xb:interface name=org.xxx.runtime.IAdaptable xb:staticHandlerde.baiz.beanex.aptableHandler/xb:staticHandler /xb:interface /xb:extension unfortunatally without succes. Maybe that was a stupid approch as XmlObject is not created by scomp. But I hope at least it shows what im looking for. Thanks for any help Siegfried - 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: Error Duplicate attribute group
There is a -cp switch for this. If a schema is split in two: s1 and s2, where s1 is stand alone (i.e. doesn't have references to items in s2) and s2 uses item from s1 by reference so that there will not be multiple definitions of the same name in the s1 + s2 union, they can be compiled separately using the classpath for compiled references. Compile s1 first as usual, and than compile only s2 putting s1.jar on the classpath. scomp -out s1.jar s1.xsd scomp -out s2.jar -cp [path_to]xbeans.jar;s1.jar s2.xsd In your case you might find it useful to split it in three: base, get, list, following the same idea. Cezar -Original Message- From: kris16 [mailto:[EMAIL PROTECTED] Sent: Thursday, December 14, 2006 6:58 AM To: user@xmlbeans.apache.org Subject: Re: Error Duplicate attribute group Hi again, I tried to solve this problem by running the scomp command twice. Generating two different jar files, one for getitemmaster and one for listitemmaster, and it seems to work. The common parts like codelists, currencycode etc. are included in both jarfiles and thats not so nice. I noticed that it is possible to use a xsdconfig file and i have managed to place GetItemMaster and ListItemMaster in different packages. It has to be a better solution then the one i have come up with ? Is there a solution to the Duplicate attribute group error ? /Regards Krister kris16 wrote: Hi, im trying to use xmlbeans together with OAGS 9.0 and their XSD files. It seems to work fine when I generate the java code for one XSD file, GetItemMaster.xsd. scomp -verbose -src D:\java\src -out itemmaster.jar D:\temp\oagis-release-9_0-XSD- GA\OAGIS\9.0\BODs\Standalone\GetItemMaster.xsd When I try to generate java code from more than one XSD file then I run into trubble. If I add the xsd file ListItemMaster.xsd to the command line for scomp the Java code generation fails. Probably because both XSD files,GetItemMaster.xsd and ListItemMaster.xsd, uses the same include files. scomp -verbose -src D:\java\src2 -out itemmaster.jar D:\temp\oagis-release-9_0-XSD- GA\OAGIS\9.0\BODs\Standalone\GetItemMaster.xsd D:\temp\oagis-release-9_0-XSD- GA\OAGIS\9.0\BODs\Standalone\ListItemMaster.xsd I get the following error when I use: ListItemMaster.xsd:22:9: error: sch-props-correct.2: Duplicate attribute group: [EMAIL PROTECTED]://www.openapplications.org/oagis/9 (Original attribute group found in file: GetItemMaster.xsd) How can I solve this problem ? Is there a workaround ? /Regards Krister -- View this message in context: http://www.nabble.com/Error-Duplicate- attribute-group-tf2818956.html#a7871978 Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ 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: Missing the XML header
The xml declaration is not used when saving to a text or Writer, but it will be used when saving into an OutputStream. Cezar -Original Message- From: kris16 [mailto:[EMAIL PROTECTED] Sent: Thursday, December 14, 2006 7:07 AM To: user@xmlbeans.apache.org Subject: Missing the XML header Hi, when i print out my XMK document the xml header is not shown (?xml version=1.0 encoding=UTF-8?). I use the command : String xmlStr = newListItem.xmlText(opts); System.out.println(xmlStr); The result: ListItemMaster releaseID=test languageCode=sv xmlns=http://www.openapplications.org/oagis/9; ApplicationArea CreationDateTime2006-12-14+01:00/CreationDateTime /ApplicationArea DataArea List/ ItemMaster/ /DataArea /ListItemMaster It prints the whole document but not the first line, ?xml version=1.0 encoding=UTF-8? Any hints ? /Regards Krister -- View this message in context: http://www.nabble.com/Missing-the-XML- header-tf2820453.html#a7872077 Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ 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: namespace problem
Assuming that all your schema that you used to generate these Xbeans from is in urn:xsd:$pacs.002.002.02 namespace, it is strange that this happens. But there is MsgIdDoc:MsgId/MsgId in both messages, which looks like a QName. Maybe the schema you're using isn't free of namespace xml.staqs.nba.com. Cezar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 24, 2007 5:47 AM To: user@xmlbeans.apache.org Subject: namespace problem Hi, I am working with some xml def standards that are not so well defined (life is hard sometimes). So to be able to accept several messages coming in different namespaces (they should be in the name ideally for the process I have to do, like automatic comparison to each other), I use the XmlOptions.setLoadSubstituteNamespaces method to put them all in a common namespaces. It works very well. In my processing I generate some output messages. Those messages are defined in my common namespace, but I have to substitute them to another namepace (to respect those damn standards). I have seen on some threads already a suggestion of parsing with an XmlCursor the xml tree and setting new Qname (keeping the local part but changing the prefix). It works very well, but for some reason I do not understand I get additional namespace declaration inside the xml. Here is an example: ?xml version=1.0 encoding=UTF-8? Document xmlns=urn:xsd:$pacs.002.002.02 pacs.002.002.02 GrpHdr MsgIdDoc:MsgId/MsgId CreDtTm2001-12-31T12:00:00/CreDtTm InstgAgt xmlns:xsi=http://www.w3.org/2001/XMLSchema- instance xmlns:Doc=xml.staqs.nba.com FinInstnId BICBNPAFRPPAFI/BIC /FinInstnId /InstgAgt InstdAgt xmlns:xsi=http://www.w3.org/2001/XMLSchema- instance xmlns:Doc=xml.staqs.nba.com FinInstnId BICBNPAFRPPAFI/BIC /FinInstnId /InstdAgt /GrpHdr /pacs.002.002.02 /Document For element InstgAgt and InstdAgt I have a unused namespace declaration. How to avoid this ? Note that is generated when I copy some part of xml tree from a source xml to a target xml, like this: public static Pacs00200202 generateGenericHeader(Pacs00300202 msg) { Pacs00200202 doc = Pacs00200202.Factory.newInstance(); GroupHeader12 hdr = doc.addNewGrpHdr(); hdr.setMsgId(msg.getGrpHdr().getMsgId()); hdr.setCreDtTm(msg.getGrpHdr().getCreDtTm()); (1) hdr.setInstdAgt(msg.getGrpHdr().getInstdAgt()); (2) hdr.setInstgAgt(msg.getGrpHdr().getInstgAgt()); return doc; } If I replace line (1) by: hdr.addNewInstdAgt().addNewFinInstnId().setBIC(msg.getGrpHdr().getInstdA gt ().getFinInstnId().getBIC()); and line (2) by: hdr.addNewInstgAgt().addNewFinInstnId().setBIC(msg.getGrpHdr().getInstgA gt ().getFinInstnId().getBIC()); I get a correct XML: ?xml version=1.0 encoding=UTF-8? Document xmlns=urn:xsd:$pacs.002.002.02 pacs.002.002.02 GrpHdr MsgIdDoc:MsgId/MsgId CreDtTm2001-12-31T12:00:00/CreDtTm InstgAgt FinInstnId BICBNPAFRPPAFI/BIC /FinInstnId /InstgAgt InstdAgt FinInstnId BICBNPAFRPPAFI/BIC /FinInstnId /InstdAgt /GrpHdr /pacs.002.002.02 /Document Why this different behaviour in this two cases ? Thanks, Bruno ___ 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: Howto get name of tag in XMLError
Use boolean validate(XmlOptions options); method and check out it's javadoc on how to get details about errors. Cezar From: Fredrik Petersson (Kentor) [mailto:[EMAIL PROTECTED] Sent: Monday, February 05, 2007 7:57 AM To: user@xmlbeans.apache.org Subject: Howto get name of tag in XMLError Hi! When MyXMLObject.validate() fails I would like to get the name of the tag where the error occurred, is it possible to get the name, and if, how? Best regards! /Fredrik ___ 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-2.2.0 and error running XQueryXPath sample
XMLBeans has just a few tests in the checkin tests that are using saxon, but they were working when I upgraded to saxonb8-8j and they still seem to be working with the current sources in SVN. Cezar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, March 02, 2007 6:40 AM To: user@xmlbeans.apache.org Subject: RE: xmlbeans-2.2.0 and error running XQueryXPath sample Hi Cezar, I've defined the classpath as follows: target name=run depends=init,build echo message=== running XQueryXPath/ java classname=org.apache.xmlbeans.samples.xquery.XQueryXPath fork=true arg line=xml/employees.xml/ classpath pathelement path=${LIB_PATH}/xbean.jar;${LIB_PATH}/xbean_xpath.jar;${LIB_PATH}/jsr173 _1.0_api.jar;${LIB_PATH}/saxon8.jar;;build/classes/ /classpath /java /target but I got: [java] java.lang.IllegalArgumentException: When a DOMSource is used, saxon8-dom.jar must be on the classpath So I've added also: ${LIB_PATH}/saxon8-dom.jar Now: run: [echo] == running XQueryXPath [java] Running ExecQuery.selectEmpsByStateCursor [java] java.lang.NoSuchMethodError: net.sf.saxon.query.DynamicQueryContext.getContextNode()Lnet/sf/saxon/om/No deInfo; [java] at org.apache.xmlbeans.impl.xquery.saxon.XBeansXQuery.execQuery(XBeansXQuery. java:76) [java] at org.apache.xmlbeans.impl.store.Query$SaxonQueryImpl$SaxonQueryEngine.curso rExecute(Query.java:345) [java] at org.apache.xmlbeans.impl.store.Query$SaxonQueryImpl.cursorExecute(Query.ja va:243) [java] at org.apache.xmlbeans.impl.store.Query.cursorExecQuery(Query.java:48) [java] at org.apache.xmlbeans.impl.store.Cursor._execQuery(Cursor.java:1336) [java] at org.apache.xmlbeans.impl.store.Cursor._execQuery(Cursor.java:1331) [java] at org.apache.xmlbeans.impl.store.Cursor.execQuery(Cursor.java:3839) [java] at org.apache.xmlbeans.samples.xquery.ExecQuery.updateWorkPhone(ExecQuery.jav a:74) [java] at org.apache.xmlbeans.samples.xquery.XQueryXPath.executeQueries(XQueryXPath. java:75) [java] at org.apache.xmlbeans.samples.xquery.XQueryXPath.main(XQueryXPath.java:54) [java] Exception in thread main [java] Java Result: 1 But the saxon8.jar (taken from http://easynews.dl.sourceforge.net/sourceforge/saxon/saxonb8-8j.zip) contains this class, maybe it is not compatible with xmlbeans-2.2.0. Regards Patrizio -Original Message- From: Cezar Andrei [mailto:[EMAIL PROTECTED] Sent: giovedì, 1. marzo 2007 21:27 To: user@xmlbeans.apache.org Subject: RE: xmlbeans-2.2.0 and error running XQueryXPath sample Patrizio, Make sure you have the following jars on the classpath, not only in build/lib: xbean.jar, xbean_xpath.jar, jsr173_1.0_api.jar and saxon.jar. The latest we tested with is saxonb8-8j from http://easynews.dl.sourceforge.net/sourceforge/saxon/saxonb8-8j.zip . Cezar From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, March 01, 2007 5:01 AM To: user@xmlbeans.apache.org Subject: xmlbeans-2.2.0 and error running XQueryXPath sample Hi all, I'm trying to run the XQueryXPath sample bundled with xmlbeans-2.2.0. I've compiled the sample and updated the xmlbeans- 2.2.0\samples\XQueryXPath\build\lib folder with the below entries: 12.06.2006 11:45 23'630 jsr173_1.0_api.jar 12.06.2006 11:45 60'047 resolver.jar 28.02.2007 16:43 40'109 schemas.jar 12.06.2006 11:45 2'664'574 xbean.jar 12.06.2006 11:45 5'578 xbean_xpath.jar 12.06.2006 11:45 429'483 xmlpublic.jar 12.02.2007 11:30 3'728'517 saxon8.jar I took the first 6 jars from xmlbeans-2.2.0\lib and the last (saxon8.jar) from saxonsa8-9j distribution. I've added the last one because I've found that it is mandatory in order to find the xquery engine. But when I try to run the sample I got the No query engine found error: C:\software\xmlbeans-2.2.0\samples\XQueryXPathant run Buildfile: build.xml init: [echo] xmlbeans.home: C:\software\xmlbeans-2.2.0 [echo] xmlbeans.lib: C:\software\xmlbeans-2.2.0/lib schemas.check: schemas.jar: XQueryXPath.classes: build: run: [echo] == running XQueryXPath [java] Running ExecQuery.selectEmpsByStateCursor [java] java.lang.RuntimeException: No query engine found [java] at org.apache.xmlbeans.impl.store.Query.getCompiledQuery(Query.java:120) [java] at org.apache.xmlbeans.impl.store.Query.getCompiledQuery(Query.java:53) [java] at org.apache.xmlbeans.impl.store.Query.cursorExecQuery(Query.java:48) [java
RE: Set() of a nil element leaves element in invalid state
Joseph, Do I understand correctly that when running with asserts disabled it works fine? Please file a bug in JIRA to track of it, and if you can include a small repro would be even better. Cezar From: Joseph Campolongo [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 28, 2007 12:45 PM To: user@xmlbeans.apache.org Subject: Set() of a nil element leaves element in invalid state I have assertions enabled for v.2.2.0 of XmlBeans under JDK 1.5_10. While trying to validate my bean, I get an AssertionError at the following location: at org.apache.xmlbeans.impl.values.XmlObjectBase.build_text(XmlObjectBase.j ava:837) at org.apache.xmlbeans.impl.store.Xobj.ensureOccupancy(Xobj.java:1694) at org.apache.xmlbeans.impl.store.Cur.next(Cur.java:1444) at org.apache.xmlbeans.impl.store.Validate.process(Validate.java:74) at org.apache.xmlbeans.impl.store.Validate.init(Validate.java:39) at org.apache.xmlbeans.impl.store.Xobj.validate(Xobj.java:1860) at org.apache.xmlbeans.impl.values.XmlObjectBase.validate(XmlObjectBase.jav a:343) The line of code is assert((_flags FLAG_VALUE_DATED) == 0); In other words, after a set() call, the value is in an invalid state. What is happening is that I'm first setting various values in the bean and then validating it. It appears that, if I set a value that had previously been 'nil', then the above flag gets set on the element: XmlBase64BinaryImpl(XmlObjectBase).invalidate_nilvalue() line: 792 Xobj$ElementXobj(Xobj).invalidateNil() line: 1385 Xobj$AttrXobj(Xobj).invalidateSpecialAttr(Xobj) line: 915 Cur.moveNode(Xobj, Cur) line: 1922 Cur.moveNode(Cur) line: 1841 Xobj$ElementXobj(Xobj).removeAttr(QName) line: 520 Xobj$ElementXobj(Xobj).invalidate_nil() line: 2038 XmlBase64BinaryImpl(XmlObjectBase).set_commit() line: 1313 XmlBase64BinaryImpl(XmlObjectBase).set(byte[]) line: 1617 XmlBase64BinaryImpl(XmlObjectBase).setByteArrayValue(byte[]) line: 1553 SymbolImpl.setSymbolData(byte[]) line: 466 The set occurs, but, after the set, the 'nil' attribute is cleared, which calls the following code: public final void invalidate_nilvalue() { assert((_flags FLAG_STORE) != 0); _flags |= FLAG_VALUE_DATED | FLAG_NIL_DATED; } This code very clearly sets the FLAG_VALUE_DATA flag, which leaves the entire element in an invalid state. Is this how everything should work? Is the assert incorrect? Is there something I should be doing to the bean after I set the values? How should I approach dealing with this? I'm running into this quite a bit, so I would appreciate any help. Thank you, jvc ___ 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 and XmlCursor
Hi Patrizio, execQuery() methods return new documents (there are queries that construct new documents), so the modifications on results will not affect the original. In your case, you should be better off using XMLCursor.selectPath(). This method will set a selection on the original document, than use hasNext/toNextSelection methods to navigate. Avoid creation of many cursors, if you want to improve performance, in your case one is probably enough, moving a cursor anywhere in a document is much faster than managing many cursors. After you're done with it don't forget to call dispose(). Cezar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, April 06, 2007 10:41 AM To: user@xmlbeans.apache.org Subject: XMLBeans and XmlCursor Hi all, I've just started to use XMLBeans and I had some troubles to use XmlCursor to navigate through a document, update it and get back the updated version. This is my xml document: ?xml version=1.0 encoding=UTF-8? eda:quoteEvent xmlns:eda=http://www.bsource.ch/EDA; eda:securityCS GROUP N/eda:security eda:date09-03-2007/eda:date eda:time/ eda:national-nr1213853/eda:national-nr eda:change-0.2/eda:change eda:volume5821192/eda:volume eda:currency transcoder=CURRENCYCHF/eda:currency eda:prev-close87.9/eda:prev-close eda:open87.75/eda:open eda:last87.7/eda:last /eda:quoteEvent I would like to retrieve all nodes with transcoder attribute (I've used the //@transcoder/.. expression), call another component (for transcodification) and get back the below new one: ?xml version=1.0 encoding=UTF-8? eda:quoteEvent xmlns:eda=http://www.bsource.ch/EDA; eda:securityCS GROUP N/eda:security eda:date09-03-2007/eda:date eda:time/ eda:national-nr1213853/eda:national-nr eda:change-0.2/eda:change eda:volume5821192/eda:volume eda:currency transcoder=CURRENCY001/eda:currency eda:prev-close87.9/eda:prev-close eda:open87.75/eda:open eda:last87.7/eda:last /eda:quoteEvent The code is: XmlObject xobj = XmlObject.Factory.parse(new ByteArrayInputStream(bodyEvent.getBytes())); XmlObject response = EDATool.transcodification (xobj, SMI-EDA); where public static XmlObject transcodification (XmlObject bodyEvent, String encoder) throws Exception { if ((bodyEvent == null) || (encoder == null)) throw new Exception(unexpected null object); long start = System.currentTimeMillis(); XmlObject[] elems = bodyEvent.execQuery(//@transcoder/..); System.out.println (execQuery elapsed time msec: + (System.currentTimeMillis() - start)); for (int i = 0; i elems.length; i++) { XmlCursor cursor = elems[i].newCursor(); TokenType token = null; String value = cursor.getTextValue(); String table = null; while (cursor.hasNextToken()) { token = cursor.toNextToken(); if (token.isAttr() transcoder.equals(cursor.getName().toString())) { table = cursor.getTextValue(); break; } } if (table != null) { cursor.pop(); value = transcode(table, encoder, value); cursor.setTextValue(value); } cursor.dispose(); } return bodyEvent; } My doubts: 1) I noticed that the time for executing execQuery is not neglectable (msec: 3688 for a document of only 471 bytes). What is wrong in my code ? 2) after disposing the cursor the document is not updated, how could I write back my changes to the document ? Regards Patrizio 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 XmlCursor
Hi Patrizio, Depending on how complex you xpath will be executed by an internal XMLBeans engine or Saxon engine. The XMLBeans xpath engine is usually much faster but supports a very limited subset of xpath. Saxon on the other hand is more complete but since it uses XMLBeans store as a DOM it usually is slower. But even for Saxon 3s for a 400k doc is kind of much on today's procs, but again how complex is the xpath? Cezar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 10, 2007 2:54 AM To: user@xmlbeans.apache.org Subject: RE: XMLBeans and XmlCursor Hi Cezar, thanks. I've used: - XMLCursor.selectPath() - only one XMLCursor object - + cursor.push() cursor.pop() methods. Now the result is ok: Response: eda:quoteEvent xmlns:eda=http://www.bsource.ch/EDA; eda:securityCS GROUP N/eda:security eda:date09-03-2007/eda:date eda:time/ eda:national-nr1213853/eda:national-nr eda:change-0.2/eda:change eda:volume5821192/eda:volume eda:currency transcoder=CURRENCY001/eda:currency eda:prev-close87.9/eda:prev-close eda:open87.75/eda:open eda:currency transcoder=CURRENCY002/eda:currency eda:last87.7/eda:last /eda:quoteEvent but what about the 'huge response time' ? execQuery elapsed time msec: 3281 for a document of only 471 bytes ! Thanks again Patrizio 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: Next stable release?
Hi Linton, We're very close to cut a release candidate. Wing Yew found a bug for dates with year zero or less and we think we have a fix for it. This is the latest planned fix before the release candidate. Other than this, we think the current SVN trunk is stable and ready for production. If no major issues will be found with the release candidate, a vote will make it an official release. Cezar -Original Message- From: Henderson, Linton [mailto:[EMAIL PROTECTED] Sent: Monday, April 30, 2007 5:49 PM To: user@xmlbeans.apache.org Subject: Next stable release? Hi, The current stable version of XMLBeans is 2.2.0 released on June 23 2006. Was just wondering if there is a stable release planned any time soon. I'm really after the fix that was added for more control of CData sections when generating XML: XmlOptions.setSaveCDataLengthThreshold() and XmlOptions.setSaveCDataEntityCountThreshold(). See http://marc.info/?l=xmlbeans-userm=115480077631242w=2 I will have a go at checking out the project and building but I'm unsure of the current state/stability of the trunk code. Thanks for your help, Linton 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: Validating an atomic type
I don't know of any public way to do exactly what you want, but you can quickly put something together by looking at the implementation of: Src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java:74 validateAtomicType(ScemaType, String, Event) I hope this helps, Cezar -Original Message- From: Vance Vagell [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 02, 2007 2:46 PM To: user@xmlbeans.apache.org Subject: Validating an atomic type Hello, Here is my scenario. I have three Strings: 1) A value 2) The name of an atomic schema type (such as decimal) 3) The namespace of the atomic schematype (always http://www.w3.org/2001/XMLSchema;, of course) Does anyone know if its possible to use XmlBeans to confirm that the value (string #1) is valid, given the atomic type? For instance, I thought this might be possible by instantiating a SchemaType object, and using validate() (as I'm doing elsewhere, when I already have a SchemaType loaded from an .xsd). However, I can't see how to instantiate a SchemaType without having a full schema available. Any ideas? Thanks, Vance - 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: [VOTE] XmlBeans 2.3.0 Release
[X] +1 - I am in favor of this release, and can help Cezar -Original Message- From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 3:26 PM To: [EMAIL PROTECTED]; user@xmlbeans.apache.org; [EMAIL PROTECTED] Subject: [VOTE] XmlBeans 2.3.0 Release Please vote on the release of XmlBeans 2.3.0 as it currently exists on http://xmlbeans.apache.org/dist as xmlbeans-2.3.0-RC3*. If the vote turns out positive, these archives are going to become the final release and be renamed to xmlbeans-2.3.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, May 22nd, 2007 (End Of Day), 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) Radu 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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [VOTE] XmlBeans 2.3.0 Release
[X] +1 - I am in favor of this release, and can help Cezar -Original Message- From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 22, 2007 7:29 PM To: [EMAIL PROTECTED]; user@xmlbeans.apache.org; [EMAIL PROTECTED] Subject: [VOTE] XmlBeans 2.3.0 Release Based on the feedback received: http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200705.mbox/ajax/ [EMAIL PROTECTED] http://mail-archives.apache.org/mod_mbox/xmlbeans-dev/200705.mbox/ajax/% [EMAIL PROTECTED] I am cancelling the current vote and start a new one in its place to extend the deadline. I think everyone who voted for RC3 will have to re-cast their vote, since this is a new set of files. Please vote on the release of XmlBeans 2.3.0 as it currently exists on http://xmlbeans.apache.org/dist as xmlbeans-2.3.0-RC4*. If the vote turns out positive, these archives are going to become the final release and be renamed to xmlbeans-2.3.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 Friday, May 25th, 2007, 5pm PDT, 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) Radu 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: [RESULTS] [VOTE] XmlBeans 2.3.0 Release
I updated the maven repository http://people.apache.org/repo/m1-ibiblio-rsync-repository/xmlbeans/ with the latest 2.3.0 binaries and poms for 2.2.0 and 2.3.0 as per JIRA-227. If somebody would try it out and let us know if it works or not would be great. Cezar -Original Message- From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] Sent: Monday, June 04, 2007 6:32 PM To: user@xmlbeans.apache.org Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [RESULTS] [VOTE] XmlBeans 2.3.0 Release Done, the website is updated and the new XmlBeans 2.3.0 release is now available for download. Radu On Sat, 2007-05-26 at 12:36 -0700, Radu Preotiuc-Pietro wrote: The voting is now closed, the results: 5 '+1' votes (3 binding) and 1 '+0' vote. Therefore, XmlBeans 2.3.0 is now officially released, thanks to everyone involved! The next step now is to upload the release files and update the web site, which I'll take care of next week. Radu -Original Message- From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 22, 2007 5:29 PM To: [EMAIL PROTECTED]; user@xmlbeans.apache.org; [EMAIL PROTECTED] Subject: [VOTE] XmlBeans 2.3.0 Release Based on the feedback received: http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200705.mbox/ajax/ [EMAIL PROTECTED] http://mail-archives.apache.org/mod_mbox/xmlbeans-dev/200705.mbox/ajax/% [EMAIL PROTECTED] I am cancelling the current vote and start a new one in its place to extend the deadline. I think everyone who voted for RC3 will have to re-cast their vote, since this is a new set of files. Please vote on the release of XmlBeans 2.3.0 as it currently exists on http://xmlbeans.apache.org/dist as xmlbeans-2.3.0-RC4*. If the vote turns out positive, these archives are going to become the final release and be renamed to xmlbeans-2.3.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 Friday, May 25th, 2007, 5pm PDT, 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) Radu 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 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. -
RE: Forcing namespace prefixes
XmlBeans has to store and preserve the prefixes wherever possible, because this is the only way to preserve the qname values inside a document that has an unknown schema. Don't forget that uris and prefixes have meanings outside of element and attribute names, but also inside attribute values and text. Cezar -Original Message- From: Muzaffer Ozakca [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 13, 2007 3:16 PM To: user@xmlbeans.apache.org Subject: Re: Forcing namespace prefixes After a couple hours of struggling, here are my conclusions: Jacob Danner wrote: Hi Muzaffer, You might be able to do something with XmlCursor (prefixForNamespace(...) )to add the prefix and then use the XmlOption (setSave ... ) to get this behavior. This is what I used: # ModsType mods = modsDoc.addNewMods(); # XmlCursor cursor = mods.newCursor(); # cursor.toFirstContentToken(); # cursor.insertNamespace(mods, http://www.loc.gov/mods/v3;); This actually adds the output XML by adding prefixes but it doesn't change the actual node names by adding a prefix. So, you can get XMLBeans to save/print it with the namespace prefixes but if you do getDomNode(), the node(s) you have will still have their names without a prefix. XMLBeans should be saving the prefix somewhere other than within each node and use it when saving. I also noticed that you can have the same effect without using Cursor by doing # mods.getDomNode().setPrefix(mods) although it fails at some point if you try to modify the document. For now, I'll save the output of XMLBeans and read it back some other way. Thanks anyways. I must ask though, why you need a specific prefix if you are working with DOM implementations. Requiring a specific prefix will lead to LOTS of maintenance issues. Hope this helps, -Jacob Danner On 6/12/07, Muzaffer Ozakca [EMAIL PROTECTED] wrote: Hi all, I'm using XMLBeans to create a document. Then I'm importing the generated document into another DOM tree using the DOM API (by calling getType.getDomMode() first to get the dom node from the XMLBeans generated document and then calling importNode()) This is working. I'm now trying to force namespace prefixes on all nodes. In other words, instead of: a b/ c/ /a I want: t:a t:b/ t:c/ /t:a where t is the namespace prefix. Is there a way to enable that? I played with a few settings in XmlOptions but none worked so far. I'm pretty new to XML processing with Java, I am hoping XMLBeans is going to make it easier. Thanks. m - 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: object oriented persistence layer?
Gustavo, Can you tell us a little more about your solution, maybe show us a little bit of the interceptor? Thanks, Cezar From: Gustavo Aquino [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 31, 2007 11:29 AM To: user@xmlbeans.apache.org Subject: Re: object oriented persistence layer? Hi Jan, I use Hibernate to persist my xmlObjets, to do xmlbeans and hibernate work together i create one hibernate interceptor. best regards. On 7/31/07, Jan Torben Heuer [EMAIL PROTECTED] wrote: Hi, can someony suggest me a persistence soloution for xmlbeans objects? I'd like to use db4o, but I only found posts of people who had problems with xmlbeans and db4o together. Id' like to use some kind of embedded soloution rather than an object-to-RDBMS converter. Thanks, Jan - 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: Problem with output through a weblogic webservice.
Hi Knut-Erik, The best way to solve this is to open a customer request through BEA support on WLS. Cezar From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, August 10, 2007 3:28 PM To: user@xmlbeans.apache.org Subject: Problem with output through a weblogic webservice. Hi there. We're using xmlbeans as input and ouput of our webservices on a weblogic 9.2.0 server. This works great, except that the output produced is really large, and this is in part due to the fact that namespace declarations are on almost every line in the response. If I try to save it myself I can use setSaveAggressiveNamespaces and setSaveNamespacesFirst to remove the namespaces. I've tried to set Xmloptions when using newInstance, but as the documentation says, those options are not considered when using newInstance. So my question is if there is any way to tell weblogic to use the same xmloptions so that the output will look better? We're using the ant task jwsc to create our webservices, if that has any impact. Thanks in advance regards Knut-Erik Johnsen * This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept for the presence of computer viruses. * 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: 2nd Post. Help! Search and Replace...Re: How to edit data in a specific part of an XMLObject
Bob, The wipkeys array returned from selectPath() method is just a copy, it's not a live object in XMLBeans structures, so modifying it will not change the original document. You should call wipkeys[0].set(keys.getWIPKEYS()); or locate it's parent and call parent.setWIPKEYS(keys.getWIPKEYS()) . Cezar From: bob bob [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 15, 2007 1:25 PM To: user@xmlbeans.apache.org Subject: 2nd Post. Help! Search and Replace...Re: How to edit data in a specific part of an XMLObject Anyone? Basically I want a search and replace. I can grab the XMLObject (WIPKEYSDocument) but can't replace it with another WIPKEYSDocument. Please?! Anyone? - Original Message From: bob bob [EMAIL PROTECTED] To: user@xmlbeans.apache.org Sent: Tuesday, August 14, 2007 3:52:32 PM Subject: How to edit data in a specific part of an XMLObject I have and XMLObject node I find by using an XPath expression in my XMLObject root element (XMLINIDocument). It finds this XMLObject (there is only one instance) but I want to replace it with another one. How do I do this? ** XML DOCUMENT ** XMLINI CONFIG SERVICES SERVICE WIPKEYS I WANT TO REPLACE THIS DATA /WIPKEYS . /XMLINI ** CODE ** // Load entire XML document XMLINIDocument config = XMLINIDocument.Factory.parse(editor.getText(), validateOptions); // Create xpath to the node we wish to replace String wipQueryExpression = declare namespace xq='http://skywire.com/ccm/global'; + $this/xq:XMLINI/xq:CONFIG/xq:SERVICES/xq:SERVICE/xq:WIPKEYS; // XMLObject found through XPath. This is the one I want to replace with the new one. WIPKEYSDocument.WIPKEYS[] wipkeys = (WIPKEYSDocument.WIPKEYS[]) config.selectPath(wipQueryExpression); // Got XML data from server and loaded it into a WIPKEYSDocument and wish to replace the wipkeys above with this one WIPKEYSDocument keys = WIPKEYSDocument.Factory.parse(serverData, validateOptions); // This kind of substitution does not work wipkeys[0] = keys.getWIPKEYS(); // Then I save it at the end config.save(new File(war/WEB-INF/xml/global.xml)); Any ideas? Thx, Bob Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games. http://us.rd.yahoo.com/evt=48224/*http:/sims.yahoo.com/ Shape Yahoo! in your own image. Join our Network Research Panel today! http://us.rd.yahoo.com/evt=48517/*http:/surveylink.yahoo.com/gmrs/yahoo _panel_invite.asp?a=7 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: 2nd Post. Help! Search and Replace...Re: How to edit data in a specific part of an XMLObject
To get the parent you can use the cursor API or write a more specific xpath something like /a/b/c/.. . Cezar From: bob bob [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 15, 2007 4:10 PM To: user@xmlbeans.apache.org Subject: Re: 2nd Post. Help! Search and Replace...Re: How to edit data in a specific part of an XMLObject Thanks. But now the problem is, how do I get a reference to the parent? I thought I was getting a reference with selectPath() but apparently not. The XML file is HUGE with tons of elements, data, etc. There is only one instance of WIPKEYS so I would just like to replace what's there. If I get a reference to WIPKEYS and call what you have below; wipkeys[0].set(keys.getWIPKEYS()); it will just replace that copy and not the WIPKEYS section in the root of the main XML doc (XMLINI). Thanks, bob - Original Message From: Cezar Andrei [EMAIL PROTECTED] To: user@xmlbeans.apache.org Sent: Wednesday, August 15, 2007 3:40:33 PM Subject: RE: 2nd Post. Help! Search and Replace...Re: How to edit data in a specific part of an XMLObject Bob, The wipkeys array returned from selectPath() method is just a copy, it’s not a live object in XMLBeans structures, so modifying it will not change the original document. You should call wipkeys[0].set(keys.getWIPKEYS()); or locate it’s parent and call parent.setWIPKEYS(keys.getWIPKEYS()) . Cezar From: bob bob [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 15, 2007 1:25 PM To: user@xmlbeans.apache.org Subject: 2nd Post. Help! Search and Replace...Re: How to edit data in a specific part of an XMLObject Anyone? Basically I want a search and replace. I can grab the XMLObject (WIPKEYSDocument) but can't replace it with another WIPKEYSDocument. Please?! Anyone? - Original Message From: bob bob [EMAIL PROTECTED] To: user@xmlbeans.apache.org Sent: Tuesday, August 14, 2007 3:52:32 PM Subject: How to edit data in a specific part of an XMLObject I have and XMLObject node I find by using an XPath expression in my XMLObject root element (XMLINIDocument). It finds this XMLObject (there is only one instance) but I want to replace it with another one. How do I do this? ** XML DOCUMENT ** XMLINI CONFIG SERVICES SERVICE WIPKEYS I WANT TO REPLACE THIS DATA /WIPKEYS . /XMLINI ** CODE ** // Load entire XML document XMLINIDocument config = XMLINIDocument.Factory.parse(editor.getText(), validateOptions); // Create xpath to the node we wish to replace String wipQueryExpression = declare namespace xq='http://skywire.com/ccm/global'; + $this/xq:XMLINI/xq:CONFIG/xq:SERVICES/xq:SERVICE/xq:WIPKEYS; // XMLObject found through XPath. This is the one I want to replace with the new one. WIPKEYSDocument.WIPKEYS[] wipkeys = (WIPKEYSDocument.WIPKEYS[]) config.selectPath(wipQueryExpression); // Got XML data from server and loaded it into a WIPKEYSDocument and wish to replace the wipkeys above with this one WIPKEYSDocument keys = WIPKEYSDocument.Factory.parse(serverData, validateOptions); // This kind of substitution does not work wipkeys[0] = keys.getWIPKEYS(); // Then I save it at the end config.save(new File(war/WEB-INF/xml/global.xml)); Any ideas? Thx, Bob Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games. http://us.rd.yahoo.com/evt=48224/*http:/sims.yahoo.com/ Shape Yahoo! in your own image. Join our Network Research Panel today! http://us.rd.yahoo.com/evt=48517/*http:/surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 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. Ready for the edge of your seat? Check out tonight's top picks http://us.rd.yahoo.com/evt=48220/*http:/tv.yahoo.com/ on Yahoo! TV. 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: xsdconfig
Does the file have the xsdconfig extension? I.e. is called somename.xsdconfig? Also make sure it's in the list of files to be compiled. Cezar From: Schalk Neethling [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 22, 2007 8:49 AM To: user@xmlbeans.apache.org Subject: xsdconfig Hey there everyone, I am using the below xsdconfig file in an attempt to get the generated classed to extend an additional Interface momentum.wealth.statement.ContractNotesInterface. I have placed this file in the same directory with all of the .xsd's I comple from but, this is having no effect on the generated code. I am using the Ant task to generate the XMLBeans. Am I missing something? Thanks for your help! xb:config xmlns:xb=http://xml.apache.org/xmlbeans/2004/02/xbean/config; xb:extension for=momentum.wealth.statement.AddressDto xb:interface name=momentum.wealth.statement.ContractNotesInterface xb:staticHandlermomentum.wealth.statement.ContractNotesInterface/xb:s taticHandler /xb:interface /xb:extension /xb:config -- Kind Regards, Schalk Neethling Developer - Momentum Wealth +27 (0) 12 673 7527 This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm 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: xsdconfig revisited
Check out the wiki page http://wiki.apache.org/xmlbeans/ExtensionInterfacesFeature and the tests http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/extensions/ interfaceFeature/ As it's described in the wiki page: The for attribute can accept a list of xbean java interfaces (separated by space) or * to include all of them in the extension. This means that momentum.wealth.statement.* is not valid. The handler class has to contain corresponding methods to handle the call of interface methods. Cezar From: Schalk Neethling [mailto:[EMAIL PROTECTED] Sent: Monday, August 27, 2007 3:22 AM To: user@xmlbeans.apache.org Subject: xsdconfig revisited Greetings All, I have a xsdconfig file named statement.xsdconfig. This file resides in the same directory as all of the XSD's from which my XMLBeans are generated. It contains the following: xb:config xmlns:tns=http://statement.wealth.momentum; xmlns:xb=http://xml.apache.org/xmlbeans/2004/02/xbean/config; xb:extension for=momentum.wealth.statement.* xb:interface name=momentum.wealth.statement.ContractNotesInterface xb:staticHandlermomentum.wealth.statement.ContractNotesInterfaceHandle r/xb:staticHandler /xb:interface /xb:extension /xb:config What I am trying to accomplish is to use the interface extension to get the generated implementation classes to extend and additional interface called ContractNotesInterface. Is the way I am trying to implement this correct in the above code? Should the for contain the package name of the final java source files or the xmlns:tns defined inside the XSD files? What exactly should the staticHandler do? Thanks! -- Kind Regards, Schalk Neethling This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm 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 select the root element
Patrizio, There are a number of ways to find out the name of the document root or return the object that represents its content, but the first that comes to mind is using the cursor: XmlCursor xc = document.newCursor(); xc.toFirstChild(); QName nameOfTopLevelElement = xc.getName(); XmlObject contentOfTopLevelElement = xc.getObject(); Cezar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, October 04, 2007 10:31 AM To: user@xmlbeans.apache.org Subject: How to select the root element Hi all, I need to select the root element from a xml document but without knowing its structure. XmlObject[] elems = document.selectPath(...); I would like to know how to execute a statement like document.getRootElement(). How can I do that ? Regards ferp IMPORTANT: This e-mail transmission is intended for the named addressee(s)only. Its contents are private, confidential and protected from disclosure and should not be read, copied or disclosed by any other person. If you are not the intended recipient, we kindly ask you to notify the sender immediately by telephone (+41 (0)58 806 50 00), to redirect the message to the account [EMAIL PROTECTED] and to delete this e-mail. E-mail transmissions may be intercepted, altered or read by unauthorized persons and may contain viruses. Therefore, it is recommended that you use regular mail or courier services for any information intended to be confidential. However, by sending us messages through e-mail, you authorize and instruct us to correspond by e-mail in the relevant matter. Thank you. - 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: Réf. : RE: Problem with boolean type
It is not a bug, as Dennis said in a previous email, XMLBeans and binding tools in general, try to do the right thing in many cases, but this is not one of them. Even if this Boolean restriction seems simple enough, to support all restrictions is impossible. Check out the following example on how to use 0/1 instead of true/false for a Boolean type: XmlBoolean xb = XmlBoolean.Factory.newInstance(); xb.setStringValue(1); XmlObject xo = XmlObject.Factory.parse(a/); System.out.println( xo: + xo); XmlObject axo = xo.selectChildren(, a)[0]; axo.set(xb); System.out.println( xo: + xo); Cezar From: Wing Yew Poon [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 10, 2007 1:27 PM To: user@xmlbeans.apache.org Subject: RE: Réf. : RE: Problem with boolean type Then that is a bug. You can file a bug in JIRA. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 10, 2007 2:16 AM To: user@xmlbeans.apache.org Subject: Réf. : RE: Problem with boolean type Yes I get mustUnderstand=true instead of mustUnderstand=1 Valerie Wing Yew Poon [EMAIL PROTECTED] 09/10/2007 21:40 Veuillez répondre à user Pour :user@xmlbeans.apache.org cc : Objet :RE: Problem with boolean type Valerie, what exactly is the incorrect behavior you are seeing? Are you saying that the xml that is marshalled is incorrect after calling the setter? i.e., you call setMustUnderstand(true) and the xml shows mustUnderstand=true instead of mustUnderstand=1? - Wing Yew From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 09, 2007 6:53 AM To: user@xmlbeans.apache.org Subject: Problem with boolean type I have the following schema element : xs:attribute name=mustUnderstand xs:simpleType xs:restriction base=xs:boolean xs:pattern value=0|1/ /xs:restriction /xs:simpleType /xs:attribute Xbean generates the following accessors : void setMustUnderstand(boolean mustUnderstand); boolean getMustUnderstand(); This result in an xml attribute with value true or false : it is not correct regarding the schema ! Is there anything to do to correct 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. 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 beginner - help
It is possible, but a little less forward that using schema. Just use XmlObject, it handles all un-typed XML in XMLBeans. Use XmlObject xo = XmlObject.Factory.parse(xmlText) to load the xml into XmlObject. And String xmlText = xo.xmlText() to get back to xml. To navigate/read/modify the XmlObject without a schema, you have to use either the cursor xo.newCursor() or the DOM xo.newDomNode(). Cezar -Original Message- From: imorales [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 06, 2007 8:50 AM To: user@xmlbeans.apache.org Subject: RE: xmlbeans beginner - help Is there any way to get from Java classes without XML schema and vice versa? Thanks. Schalk Neethling-4 wrote: You will more then likely have to start with a schema. So define your schema and the from this generate your XMLBean which will give you object A, you can then populate object A using the set methods that will be generated and once you have the completed object you can invert it into a XML string with one step by calling A.xmlText(); HTH! Regards, Schalk Neethling -Original Message- From: imorales [mailto:[EMAIL PROTECTED] Sent: 06 November 2007 11:29 AM To: user@xmlbeans.apache.org Subject: xmlbeans beginner - help Hi is my first time using xmlbeans and I hava a couple of question, I explain my scenario and I would like someone to resolve my ignorance about xmlbeans. Well I hava a pojo class: -- public class A{ private String b; public A(){} public String getB(){ return b;} public void setB(String b){this.b = b;} } -- I´m using a web service that takes one parameter (String), this parameter is the XML associated to the class A. My question is how I can using xmlbeans conver one object A to a XML and then to String. I have no schema to do this and I don´t know if is necessary. Thanks in advance. -- View this message in context: http://www.nabble.com/xmlbeans-beginner---help-tf4756991.html#a13603299 Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/xmlbeans-beginner--- help-tf4756991.html#a13608035 Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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: Import schema for schema aware XQuery
What query engine are you using? From what I know, Saxon's free implementation doesn't support schema aware XQuery. On the other hand, BEA's products do support schema aware XQuery based on XMLBeans schema type systems. Cezar From: Paul Hepworth [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 14, 2007 9:51 AM To: user@xmlbeans.apache.org Subject: Import schema for schema aware XQuery Hi I have a situation where I need to use a schema-aware XQuery, so I can ensure that what the query is asking for is possible in the schema. I tried adding a line like this... import schema default element namespace at videos.xsd; ...to the beginning of my call, so I have something like this: myXmlObject.execQuery(import schema default element namespace '' at 'videos.xsd'; + getQuery()); However, I get an error XPST0003 stating Import schema must appear earlier in the prolog. So it appears that XmlBeans is adding some default statements to the beginning of my XQuery. Is there a way to get my import statement into the query in the right place? Or is schema-aware XQuery not possible in XmlBeans? Many Thanks Paul This message should be regarded as confidential. If you have received this email in error please notify the sender and destroy it immediately. Statements of intent shall only become binding when confirmed in hard copy by an authorised signatory. The contents of this email may relate to dealings with other companies within the Detica Group plc group of companies. Detica Limited is registered in England under No: 1337451. Registered offices: Surrey Research Park, Guildford, Surrey, GU2 7YP, England. 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: Which ORM and XML binding
I haven't play with Hibernate and XMLBeans myself, but earlier this year a few people reported success using XMLBeans at the XML level and Hibernate for saving the state into DB. From what I remember, they had to use Hibernate interceptors to make things work. There are advantages of using XMLBeans over JAXB, it has a SchemaTypeSystem that users have access to, but one thing I consider the most important is it strives to support all the valid schemas, and keep the fidelity of XML. Cezar -Original Message- From: Mansour [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 14, 2007 8:57 AM To: user@xmlbeans.apache.org Subject: Re: Which ORM and XML binding Jacob Danner wrote: From previous posting on teh mailing list it sounds like some folks have had some success with hibernate. I can't say I've needed to do what you are describing, but it should be possible with some additional impl on your part. How? What do you mean by additional impl?? As far as managing the database side of things, XMLBeans doesn't do any of that for you, and it sounds like you want to use Hibernate to manage your DB interaction. I know this. That's the reason I am asking about how to use Hibernate or any ORM tool. If I may suggest, find an ORM solution that meets your needs and then see if it works with XMLBeans. That was my question in the first place. What is this magical solution ? -jacobd On Nov 10, 2007 9:33 PM, Mansour [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hello every one: I am new to xmlbeans, and before I start reading and try to learn about it I need to know which ORM plays well with XMLBeans. First thing, I have a huge number of XML schema files that contain complex and simple types. These files need to be bound to java objects for the business layer. And, I need to create a relational DB from these schema files as well and access the DB using ORM. I was wondering if there any framework that enables me to do all these things. XML schema - Java Objects Binding - Hibernate mapping (or any other ORM) - Create Tables in the DB I have searched around and could not find anything, therefore decided to ask if someone have done this before. I have worked with hibernate and prefer to use it if possible. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] mailto:[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: How to generate XPath for XMLObject/XMLCursor?
Unfortunately, from what I know, there isn't an API to get an XPath. It shouldn't be very hard to implement using a cursor. Cezar -Original Message- From: Willis Morse [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 21, 2007 2:14 PM To: user@xmlbeans.apache.org Subject: How to generate XPath for XMLObject/XMLCursor? Is there any way to derive an Xpath from an XmlObject or XmlCursor at runtime? Or, alternatively, is there anyway to convert an XmlBookmark into an XPath? My app lets users choose elements from within an XML document, and I need a way to persist xpaths to these chosen elements back into the XML document. Thanks, Willis Morse - 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: Upgrading XMLBeans questions
For a SAX parser, use XmlOptions: /** * By default, XmlBeans uses an internal Piccolo parser, * other parsers can be used by providing an XMLReader. * For using the default JDK's SAX parser use: * xmlOptions.setLoadUseXMLReader( SAXParserFactory.newInstance().newSAXParser().getXMLReader() ); * * @see XmlObject.Factory#parse(java.io.File, XmlOptions) */ public XmlOptions setLoadUseXMLReader (XMLReader xmlReader); Or if you want to use a Stax - jsr 173 - pull parser use: XmlObject.Factory.parse ( XMLStreamReader xsr ); Cezar -Original Message- From: starlightpurple [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 21, 2007 3:20 PM To: user@xmlbeans.apache.org Subject: RE: Upgrading XMLBeans questions Thank you Cezar and Jacob for your replies. I have one more question. Would you be able to point me to the documentation on how I can specify which xml parser to use? Thanks, Monica --- Cezar Andrei [EMAIL PROTECTED] wrote: There is also a very slight change on how Cursors work when copying/moving a sub-tree from a document to another. Most likely you don't use this feature. You should be fine with the upgrade, as Jacob said, if you recompile all your schemas. Choosing the parser should work the same. Saxon is used only when selectPath, executeQuery or compilePath methods are called. Cezar -Original Message- From: Jacob Danner [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 21, 2007 11:16 AM To: user@xmlbeans.apache.org Subject: Re: Upgrading XMLBeans questions I'll try to answer a couple of these. re:Saxon, if you aren't using Xpath/Xquery you should be fine. As long as the schemas have been recompiled you should not have any troubles using the new xmlbeans types On 11/20/07, starlightpurple [EMAIL PROTECTED] wrote: Hello, I am currently using version 1.0.2 of XmlBeans and am researching upgrading it to version 2.0.3. I have read through the documentation on this site but have a few questions. * Am I able to dictate which XML Parser XMLBeans uses? * The documentation states the following: Because XMLBeans 2.3.0 is designed to be used with Saxon-8.8 for XPath/XQuery support and because Saxon is not backwards-compatible, it is strongly reccomended that if you use Saxon-8.6.1 with XMLBeans, you upgrade to Saxon-8.8 If I'm not using XPath/XQuery with XMLBeans is it alright if I use an older version of Saxon on the classpath? I assume it should not cause any problems, since I'm not using it in XMLBeans. However, I wanted to double check. * I recompiled my schema as suggested and tested marshalling/un-marshalling a few xml files created under 1.0.2 with 2.3.0. I have not encountered any problems. However, would you know of any problems or things I should be aware of when making such a switch? Thank you, Monica __ __ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs - 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] __ __ Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. http://overview.mail.yahoo.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
RE: type and Java Class
It seems that you have 2 sets of the same classes in different jars. Make sure that when you compile the extension xsd you use the base.jar on the classpath so that you have only one set of compiled schema types on the classpath. See archives at http://www.mail-archive.com/user@xmlbeans.apache.org/msg02498.html Or compile all schemas at once into a single jar. Cezar -Original Message- From: cmoller [mailto:[EMAIL PROTECTED] Sent: Friday, November 30, 2007 8:47 AM To: user@xmlbeans.apache.org Subject: RE: type and Java Class Update: This solution works fine so long as your extensions are in a single XSD. Since I am breaking my extensions out, this will only work if the consumer CHOOSES which extension they are going to use and puts ONLY that jar in their classpath (not possible for me). Is there a way to force xml beans to keep searching the classpath if it is using the xsd declared type instead of the xml specified type? cmoller wrote: The TestTypeClientExtension interface does extend TestTypeExtension. I DID find something interesting, though. I am generating two seperate JAR's from two seperate XSD's. The extension xsd imports the base xsd. The resulting JAR from the extension XSD contains the types from the base xsd. I tried removing the base XSD from my project and everything worked perfectly. I then simply moved the extension jar before the base jar, and everything still worked fine. So, for me, making sure the extended types come before the base types in the classpath solved the problem. Now, I am curious to see if this solution can work with two different extension xsds (client1, client2). Cory Virok wrote: Sounds like the class hierarchy is not translated verbatim when XMLbeans generates Java code. Although I don't know how to solve your problem, I would suggest looking at the generated code to see what the inheritance relationships look like. I have a feeling that there are some interfaces that are being generated on behalf of TestTypeExtension and TestTypeClientExtension that do not have the correct implements relationships... Maybe this will help: If you see this in the generated code: interface TestTypeExtension {...} interface TestTypeClientExtension {...} and *not* interface TestTypeClientExtension extends TestTypeExtension {...} you will get class cast exceptions because even though the implementing classes have the correct inheritance, the interfaces that you're working with do not. Again... this is all speculation but who knows, maybe this is how it works. cory -Original Message- From: cmoller [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 27, 2007 6:43 PM To: user@xmlbeans.apache.org Subject: RE: type and Java Class This is EXACTLY the problem I am having. It works find if you declare the element as anytype in the XSD, but it does NOT work if you declare it as a specific type and then subtype from that. Vinh Nguyen (vinguye2) wrote: Hi, Instead of just getting the extending type's class, is there a way to actually get an instance of that type? For example, the following will not work: TestType test = TestDocument.Factory.newTest(); test.getTypeExtensions().addNewExtension( testTypeClientExtension ); TestTypeClientExtension ext = (TestTypeClientExtension)test.getTypeExtensions().getExtension(0); // ClassCastException! So even if you insert an extending type, the composite object will only return a new instance of the base type. It doesn't even return the actual object that was inserted. Hencing, casting will not work. There seems to be a disjoint in the extension pattern allowed in XML schemas versus how XmlBeans implements the corresponding Java class extension pattern. -Original Message- From: Cory Virok [mailto:[EMAIL PROTECTED] Sent: Thursday, November 15, 2007 8:05 AM To: user@xmlbeans.apache.org Subject: RE: type and Java Class I've done the same thing. Basically, you need to get the SchemaParticle that corresponds to the XmlObject's schema type, then get the Type of that schema particle and finally, get the java class associated with that type, (via getJavaClass().) I haven't actually tried this code so my apologies if it doesn't work... XmlObject testTypeExtension = test.getTest().getTypeExtensions().getExtensionArray()[0]; SchemaType testExtType = testTypeExtension.schemaType(); Class testExtClass = testExtType.getJavaClass(); //the Class you're interested in Hope it helps/works! cory -Original Message- From: cmoller [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 14, 2007 11:05 AM To: user@xmlbeans.apache.org Subject: xsi:type and Java Class I am having trouble getting XmlBeans 1.0.4 to return the Java class I want from an XML document. The XSD defines a
RE: Large xmldocuments and namespace declarations
I see. Than you shoud make sure you're saving them at the beginning of the document and for each chunk use the following XmlOption to avoid outputting the namespaces again: /** * If namespaces have already been declared outside the scope of the * fragment being saved, this allows those mappings to be passed * down to the saver, so the prefixes are not re-declared. * * @param implicitNamespaces a map of prefixes to uris that can be * used by the saver without being declared * * @see XmlTokenSource#save(java.io.File, XmlOptions) * @see XmlTokenSource#xmlText(XmlOptions) */ public XmlOptions setSaveImplicitNamespaces (Map implicitNamespaces) Cezar From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 12, 2007 2:22 PM To: user@xmlbeans.apache.org Subject: RE: Large xmldocuments and namespace declarations Yes i did. But the problem with this is that the method must be run after you build the entire structure in memory. Then it iterates twice over it and that takes quite a lot of cpu time. I want to be able to add the namespaces and prefixes at createInstance time, so that i don't need to run this method to change them afterwards. mvh Knut-Erik Johnsen Cezar Andrei [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 12.12.2007 21:07 Please respond to user@xmlbeans.apache.org To user@xmlbeans.apache.org cc Subject RE: Large xmldocuments and namespace declarations Knut, did you try using the following save option? /** * Causes the saver to reduce the number of namespace prefix declarations. * The saver will do this by passing over the document twice, first to * collect the set of needed namespace declarations, and then second * to actually save the document with the declarations collected * at the root. * * @see XmlTokenSource#save(java.io.File, XmlOptions) * @see XmlTokenSource#xmlText(XmlOptions) */ public XmlOptions setSaveAggressiveNamespaces() Cezar From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 11, 2007 2:00 AM To: user@xmlbeans.apache.org Subject: Re: Large xmldocuments and namespace declarations Thanks for your reply. The problem is that when i do a save or a toString on the responseDocument, I get the printout below (a small cutout of a complete document). As you can see, the namespaces takes a lot of the space in the document. agr:findAgreementsResponse xmlns:agr=http://xmlns.trygvesta.com/dopa/service/agreement; agr:CollectionOfAgreements agr1:Agreement CustomerUuid=323e8d4e-1935-4895-b613-e4762ee4a98a ProcessingState=noChange PrimaryKey=1100586549375 xmlns:agr1=http://xmlns.trygvesta.com/dopa/object/agreement; abs:Properties Value=473f1b6d-ebb6-491e-805c-95c2094e181c Name=AgreementUuid xmlns:abs=http://xmlns.trygvesta.com/dopa/object/abstractdopadomain/ abs:Properties Value=NOR Name=AgreementType xmlns:abs=http://xmlns.trygvesta.com/dopa/object/abstractdopadomain/ abs:Properties Value=5035 Name=AgreementPostalCode xmlns:abs=http://xmlns.trygvesta.com/dopa/object/abstractdopadomain/ abs:Properties Value=5035 Name=PayerPostalCode xmlns:abs=http://xmlns.trygvesta.com/dopa/object/abstractdopadomain/ abs:Properties Value=false Name=ManualTaskExist xmlns:abs=http://xmlns.trygvesta.com/dopa/object/abstractdopadomain/ abs:Properties Value=true Name=PayerAddressAutomaticUpdate xmlns:abs=http://xmlns.trygvesta.com/dopa/object/abstractdopadomain/ abs:Properties Value=0 Name=AgrUnionDiscountPct xmlns:abs=http://xmlns.trygvesta.com/dopa/object/abstractdopadomain/ /agr1:Agreement /agr:CollectionOfAgreements /agr:findAgreementsResponse If i use the parse method as described in the first post, these namepsacedeclarations are removed and only set once at the top, which saves A LOT of sent characters. But I don't want to call the parse-method, as it has to go through the entire xmlstructure. And the second problem is that i do not control which method is called to actually send the xm. That is handled by weblogic which I belive only calls the toString method. What I would like was a possibility to set which namespace prefixes to use when calling the newInstance on the reponseDocument factory, since this takes a xmloption object. Then it could send this down to it's children when i do a reponseDocument.addCollectionOfAgreements() and the like. But from the javadocs, the method you described only has an effect on the save and xmlText methods. Is there any way to achieve my desired goal, or is this not possible with the way xmlbeans works currently? mvh Knut-Erik Johnsen Jacob Danner [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 11.12.2007 03:28 Please respond to user
RE: Using cursor to ierate and adding to map
Zapo, cursor.getName() returns the name of the current token. You need to make sure you move the cursor on the right element to get the text and move back to the parent Testcase and call toNextSibling(). -Original Message- From: Zapo [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 11, 2007 5:17 PM To: user@xmlbeans.apache.org Subject: Using cursor to ierate and adding to map Greetings, I am trying to iterate a XML using cursor and then adding to MAP. The XML has repetable nodes for example Testcase Securityhttps/Security Serverstaging/Server /Testcase Testcase Securityhttps/Security Serverbaijing/Server /Testcase /Testcases I have an array of TestCase objects ready, how to iterate and add to a Map or Array I tried the following way and it did not get too further..I seem to be missing the usage of cursor and addin to a MAP, I seem to overwrite my MAP (which I should avoid), private static void addtoMap(Testcase item2, int i, LinkedHashMapString, String linkedHashMap) { XmlCursor cursor = item.newCursor(); //Iterate throught the nodes cursor.toChild(0); String name = cursor.getName().toString(); String value = cursor.getTextValue(); //Add to Map linkedHashMap.put(name, value); //Next Sibling cursor.toNextSibling(); String name1 = cursor.getName().toString(); String value1 = cursor.getTextValue(); //Add to Map again linkedHashMap.put(name, value); System.out.println(Type of Token is: + cursor.currentTokenType() + \nText of Token is + cursor.xmlText()); //} cursor.dispose(); } -- View this message in context: http://www.nabble.com/Using-cursor-to- ierate-and-adding-to-map-tp14285663p14285663.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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: Large xmldocuments and namespace declarations
Knut, did you try using the following save option? /** * Causes the saver to reduce the number of namespace prefix declarations. * The saver will do this by passing over the document twice, first to * collect the set of needed namespace declarations, and then second * to actually save the document with the declarations collected * at the root. * * @see XmlTokenSource#save(java.io.File, XmlOptions) * @see XmlTokenSource#xmlText(XmlOptions) */ public XmlOptions setSaveAggressiveNamespaces() Cezar From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 11, 2007 2:00 AM To: user@xmlbeans.apache.org Subject: Re: Large xmldocuments and namespace declarations Thanks for your reply. The problem is that when i do a save or a toString on the responseDocument, I get the printout below (a small cutout of a complete document). As you can see, the namespaces takes a lot of the space in the document. agr:findAgreementsResponse xmlns:agr=http://xmlns.trygvesta.com/dopa/service/agreement; agr:CollectionOfAgreements agr1:Agreement CustomerUuid=323e8d4e-1935-4895-b613-e4762ee4a98a ProcessingState=noChange PrimaryKey=1100586549375 xmlns:agr1=http://xmlns.trygvesta.com/dopa/object/agreement; abs:Properties Value=473f1b6d-ebb6-491e-805c-95c2094e181c Name=AgreementUuid xmlns:abs=http://xmlns.trygvesta.com/dopa/object/abstractdopadomain/ abs:Properties Value=NOR Name=AgreementType xmlns:abs=http://xmlns.trygvesta.com/dopa/object/abstractdopadomain/ abs:Properties Value=5035 Name=AgreementPostalCode xmlns:abs=http://xmlns.trygvesta.com/dopa/object/abstractdopadomain/ abs:Properties Value=5035 Name=PayerPostalCode xmlns:abs=http://xmlns.trygvesta.com/dopa/object/abstractdopadomain/ abs:Properties Value=false Name=ManualTaskExist xmlns:abs=http://xmlns.trygvesta.com/dopa/object/abstractdopadomain/ abs:Properties Value=true Name=PayerAddressAutomaticUpdate xmlns:abs=http://xmlns.trygvesta.com/dopa/object/abstractdopadomain/ abs:Properties Value=0 Name=AgrUnionDiscountPct xmlns:abs=http://xmlns.trygvesta.com/dopa/object/abstractdopadomain/ /agr1:Agreement /agr:CollectionOfAgreements /agr:findAgreementsResponse If i use the parse method as described in the first post, these namepsacedeclarations are removed and only set once at the top, which saves A LOT of sent characters. But I don't want to call the parse-method, as it has to go through the entire xmlstructure. And the second problem is that i do not control which method is called to actually send the xm. That is handled by weblogic which I belive only calls the toString method. What I would like was a possibility to set which namespace prefixes to use when calling the newInstance on the reponseDocument factory, since this takes a xmloption object. Then it could send this down to it's children when i do a reponseDocument.addCollectionOfAgreements() and the like. But from the javadocs, the method you described only has an effect on the save and xmlText methods. Is there any way to achieve my desired goal, or is this not possible with the way xmlbeans works currently? mvh Knut-Erik Johnsen Jacob Danner [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 11.12.2007 03:28 Please respond to user@xmlbeans.apache.org To user@xmlbeans.apache.org cc Subject Re: Large xmldocuments and namespace declarations Hi Knut, There is a method on XmlOptions that you can populate with a Map containing Qnames for the namespaces in your document. I don't have the javadoc in front of me, but I think its setSaveSuggestedPrefix(). I've also had some success walking the instance via the XmlCursor API and adding namespaces that way. I'm curious how all the elements in your instance are getting the namespace declarations. Could you explain a bit more? It might help to better frame the problem. -jacobd On 12/10/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi there all :) We are using xmlbeans in webservices with xfire and are sending quite large xmldocuments back and forth between the layers. Our problem is that the namepace declarations take up almost the same amount of space (in the sent xml file) as the actual data. This is due to the fact that each element declares it's namespace, not using what might have been declared allready by it's parentnodes. To remove these unwanted declarations, we do a : FindAgreementsResponseDocument.Factory.parse(findAgreementsResponseDocum ent.newReader(getXmlOptions())) where the Xmloptions are xmlOpt.setSaveAggressiveNamespaces(); xmlOpt.setSaveNamespacesFirst(); This forces (as I have understood the documentation) a double loop through the entire xml structure to first find all namespaces, and then to update all instances with the new ones. This gives us quite a
RE: newbie--override schemaorg_apache_xmlbeans prefix
Richard, It isn't supposed to work like this. The XMLSchema spec assumes that everybody is using namespaces and that the QNames for different types and elements do not collide. This is the model that XMLBeans uses, which is the same as java packages and classes work. In the rare cases when there is a requirement for more than this, as java solves this problem, the solution is to use different classloaders. Each classloader will have access to a non-coliding set of schema artifacts. If you describe your problem in more details maybe somebody on the list might come up with a simpler solution. Cezar -Original Message- From: Lucente, Richard D [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 11, 2007 12:03 PM To: user@xmlbeans.apache.org Subject: newbie--override schemaorg_apache_xmlbeans prefix Is it possible to override the default schemaorg_apache_xmlbeans prefix? There are multiple xbean-packaged.jars on our project. We could go through the pain of generating one for all and deconflicting, but it would be much easier if we could avoid package name overlaps. Any suggestions? - 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: is XSD text file stored at all in XMLBeans output?
Running scomp will include schema sources in the output jar. You can get to the name of the resource by calling getSourceName() on a SchemaType for example or any SchemaComponent. Cezar From: Jacob Danner [mailto:[EMAIL PROTECTED] Sent: Thursday, January 10, 2008 4:17 AM To: user@xmlbeans.apache.org Subject: Re: is XSD text file stored at all in XMLBeans output? Hi Dave, In most cases, running scomp will create a jar that includes the schemas in at schemaorg_apache_xmlbeans\src in the java archive. If you need direct access to it, you can always try accessing it via resources and/or classloaders. AFAIK, xmlbeans does not provide any methods for direct access to those bundled schemas. Hope this helps, -jacobd On Jan 9, 2008 12:41 PM, dave [EMAIL PROTECTED] wrote: I know XMLBeans apis use the compiled schema Jars from scomp for any validation purpose. Just curious to know if XMLBeans also stores actual XSD text file (one of the input to scomp) anywhere in its run time environment? -D Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- I'm competing in a Half-Ironman distance triathlon to raise money for the fight against cancer! Please help support my efforts by going to: http://www.active.com/donate/tntwaak/jacobd 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: SchemaType.getSourceName()
Denis, SchemaType.getSourceName() returns a name of a resource that represents the original xsd file from which the type came from. You can get to the resource by using a SchemaTypeLoader that has access to it. See the following example on how to use it: static void testXbGetSourceName() throws IOException { SchemaType st = SchemaDocument.type; // or any schemaType that is compiled into a jar using scomp InputStream is = st.getTypeSystem().getSourceAsStream(st.getSourceName()); Reader r = new InputStreamReader(is); Writer w = new PrintWriter(System.out); char[] buf = new char[100]; int l; while((l=r.read(buf))=0) { w.write(buf, 0, l); } w.close(); r.close(); is.close(); } Cezar From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 14, 2008 2:12 AM To: user@xmlbeans.apache.org Subject: SchemaType.getSourceName() Hi, everybody! Doesn anybody know how can I decode the result of SchemaType.getSourceName() method? Regards, Denis. 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: Algorithm for saving CDATA blocks in XML Beans 2.2 ?
Steve, The javadoc for setSaveCDataLengthThreshold and setSaveCDataEntityCountThreshold seems to be quite clear: * CDATA will be used if the folowing condition is true: * textLength cdataLengthThreshold entityCount cdataEntityCountThreshold * The default value of cdataLengthThreshold is 32. * The default value of cdataEntityCountThreshold is 5. Cezar -Original Message- From: Steve Davis [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 2:11 PM To: user@xmlbeans.apache.org Subject: Algorithm for saving CDATA blocks in XML Beans 2.2 ? I see that XML Beans 2.3 provides some control over when the saver generates CDATA. The XML Options setSaveCDataLengthThreshold and setSaveCDataEntityCountThreshold allow any of the following configurations: Every text is CDATA Only text that has an entity is CDATA Only text longer than x chars is CDATA Only text that has y entitazable chars is CDATA Only text longer than x chars and has y entitazable chars is CDATA My question is what is the behavior of the saver in XML Beans 2.2? When does it decide to use CDATA blocks? Thanks, Steve - 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: Algorithm for saving CDATA blocks in XML Beans 2.2 ?
Indeed the options weren't available but the algorithm and default values are the same. Cezar -Original Message- From: Steve Davis [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 3:49 PM To: user@xmlbeans.apache.org Subject: RE: Algorithm for saving CDATA blocks in XML Beans 2.2 ? Cezar, If I am not mistaken, the older XML Beans version 2.2 does not does not support these options. Please clarify. Thanks, Steve -Original Message- From: Cezar Andrei [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 4:38 PM To: user@xmlbeans.apache.org Subject: RE: Algorithm for saving CDATA blocks in XML Beans 2.2 ? Steve, The javadoc for setSaveCDataLengthThreshold and setSaveCDataEntityCountThreshold seems to be quite clear: * CDATA will be used if the folowing condition is true: * textLength cdataLengthThreshold entityCount cdataEntityCountThreshold * The default value of cdataLengthThreshold is 32. * The default value of cdataEntityCountThreshold is 5. Cezar -Original Message- From: Steve Davis [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 2:11 PM To: user@xmlbeans.apache.org Subject: Algorithm for saving CDATA blocks in XML Beans 2.2 ? I see that XML Beans 2.3 provides some control over when the saver generates CDATA. The XML Options setSaveCDataLengthThreshold and setSaveCDataEntityCountThreshold allow any of the following configurations: Every text is CDATA Only text that has an entity is CDATA Only text longer than x chars is CDATA Only text that has y entitazable chars is CDATA Only text longer than x chars and has y entitazable chars is CDATA My question is what is the behavior of the saver in XML Beans 2.2? When does it decide to use CDATA blocks? Thanks, Steve - 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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ClassCastException when migrating to xmlbeans 2.2.9
When old xmlbeans jars were compiled, the user may have been used an .xsdconfig file that modified the generated package of the xbean classes and interfaces. You should use the same .xsdconfig file, or modify the code that references those intf/classes to match the ones in the new xbean jars. Cezar From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2008 10:58 AM To: user@xmlbeans.apache.org Subject: Re: ClassCastException when migrating to xmlbeans 2.2.9 Yes, we recompiled the schema. Schema goes into a separate jar. BEA ships two versions of xbean in 9.2 . The server/lib version is no good for us and documentation says to use apache_xbean version that ships in common/lib. The only problem I am seeing is that at compile time, it creates classes along the lines of com.tuftshealth.*. But when we pass XML payload to XmlObject or XmlObjectBase then it returns com.tuftshealth.www.* which results in conflict. I will give compilation another shot but we have been struggling with this for almost a week. Shikhar Jacob Danner [EMAIL PROTECTED] 06/04/2008 11:34 AM Please respond to user@xmlbeans.apache.org To user@xmlbeans.apache.org cc Subject Re: ClassCastException when migrating to xmlbeans 2.2.9 Hi Shikhar, Have you recompiled all of your schemas? Are there any conflicting jars still on the classpath? -jacobd On Wed, Jun 4, 2008 at 7:57 AM, [EMAIL PROTECTED] wrote: Hi We are migrating our applications from Weblogic 8.1 / xbean (?) to Weblogic 9.2 / apache xbean 2.2.9-r540734 . We compiled our schema successfully with new version after making changes recommended by bea (replaced all com.bea.xml occurrences to org.apache.xmlbeans ) along with ant task def etc. XBEAN Compilation produces classes in following package structure: com.tuftshealth.container.providerListService.* and com.tuftshealth.container.providerListService.impl.* Our XSD looks like below: === ?xml version=1.0 encoding=UTF-8? schema xmlns=http://www.w3.org/2001/XMLSchema; xmlns:this=http://www.tuftshealth.com/Container/ProviderListService; xmlns:messageheader=http://www.tuftshealth.com/Base/MessageHeader; xmlns:name=http://www.tuftshealth.com/Base/Name; xmlns:status=http://www.tuftshealth.com/Base/Status; xmlns:network=http://www.tuftshealth.com/Base/Network; xmlns:date=http://www.tuftshealth.com/Base/DateRange; xmlns:contact=http://www.tuftshealth.com/Base/Contact; xmlns:address=http://www.tuftshealth.com/Base/Address; xmlns:reference=http://www.tuftshealth.com/Base/Reference; xmlns:member=http://www.tuftshealth.com/Base/Member; xmlns:benefit=http://www.tuftshealth.com/Base/Benefit; xmlns:covlimit=http://www.tuftshealth.com/Base/CoverageLimitations; xmlns:groupriders=http://www.tuftshealth.com/Base/GroupRiders; xmlns:buslninfo=http://www.tuftshealth.com/Base/BusinessLineInfo; xmlns:phone=http://www.tuftshealth.com/Base/Phone; targetNamespace=http://www.tuftshealth.com/Container/ProviderListServic e elementFormDefault=qualified import namespace=http://www.tuftshealth.com/Base/MessageHeader; schemaLocation=../Base/MessageHeader.xsd/ .. element name=ProviderListRequest type=this:PrivderListServiceRequestType/ complexType name=PrivderListServiceRequestType sequence element name=MessageHeader type=messageheader:MessageHeaderType/ element name=providerRequestInfo type=this:ProviderListRequestParamsType/ = This results in exceptions at run time when we call a Tibco using a generic broker class. The broker uses following method to return class to us: obj = XmlObjectBase.Factory.parse(XMLString); XMLString contains following payload: ?xml version=1.0 encoding=UTF-8? ns0:ProviderListResponse xmlns:ns0=http://www.tuftshealth.com/Container/ProviderListService; Debug Info: PACKAGE NAME: com.tuftshealth.www.container.providerlistservice.impl CLASS NAME: ** com.tuftshealth.www.container.providerlistservice.impl.ProviderListRespo nseDocumentImpl java.lang.ClassCastException: com.tuftshealth.www.container.providerlistservice.impl.ProviderListRespo nseDocumentImpl XmlObjectBase is returning the class with www in package name. This causes ClassCastException. We tried to use XmlObject and XmlOptions is various combinations to see if www in package name goes away but it stays the same. Can someone please help us here ? It seems that behavior of XmlObject or XmlObjectBase has changed between two versions. Our apps can't work without the broker to return correct class type. Thanks for your help, Shikhar Confidential and Proprietary: This email message and any attached files contain information intended for the exclusive use of the individual or entity to
RE: NoClassDefFoundError in Eclipse Plugin IDE
There were a couple of emails from people having problems with classloaders in Eclipse. This seems to be in the same class. Check the archives. Cezar -Original Message- From: Ronald Becher [mailto:[EMAIL PROTECTED] Sent: Thursday, June 19, 2008 5:28 AM To: user@xmlbeans.apache.org Subject: NoClassDefFoundError in Eclipse Plugin IDE Hi Guys, I'm new to the list, so I'm waveing a first hello at everyone ... *wave* :) I'm currently _trying_ to de-bug an Eclipse Plugin (not written by me) and am running into some problems (stacktrace at the end) The code looks like this try { document= XMLTestSuiteDocument.Factory.newInstance(); } catch(Throwable e) { e.printStackTrace(); } which leads me to an interface XMLTestSuiteDocument (extends org.apache.xmlbeans.XmlObject) Inside I have this public static final class Factory, which (you would've guessed it) contains the following method public static org.bpelunit.framework.xml.suite.XMLTestSuiteDocument newInstance() { XMLTestSuiteDocument t = (org.bpelunit.framework.xml.suite.XMLTestSuiteDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); t=t; /* TODO for easier inspection, remove later */ return t;} type references this var in the XMLTestSuiteDocument interface (containing the Factory). Although I'm not a total noob to Java, I have to admit, that I am not familiar whith the way, this variable is initialized ... but okay public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType) org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XMLTestSuiteDocument .class.getClassLoader(), schemaorg_apache_xmlbeans.system.s21B6514B5535163199D3BCDDAA42EFA0).reso lveHandle(testsuite8482doctype); However, this call leads us to XmlBeans.getContextTypeLoader(). Since the exceptions caught at this point do not match the one thrown, I suspect this method itself not to be the problem. It calls return (SchemaTypeLoader)_getContextTypeLoaderMethod.invoke(null, null); and therefore private static Method buildGetContextTypeLoaderMethod() { return buildNoArgMethod( org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl, getContextTypeLoader ); } leading us to private static final Method buildNoArgMethod ( String className, String methodName ) { return buildMethod( className, methodName, new Class[ 0 ] ); } and finally to private static final Method buildMethod ( String className, String methodName, Class[] args ) /* in XMLBeans.java:170 */ I do not fully understand the architecture of the call in the try-block, but suspect that also at this point the problem is somewhere else, because buildMethod() throws an IllegalStateException, which I do not get ... *hrmpf* I have compiled XMLBeans from the source on commandline according to the instructions, and until this point everything seemed to work also ... I've put XMLBeans into Eclipse as a new project for convenient browsing and debugging and stuff. Anyone has any idea or experienced similar problems? Am I perhaps per any chance missing some dependency in or outside XMLBeans? Thanks in advance, Ronald The halfway full stacktrace would read like this: java.lang.NoClassDefFoundError at org.apache.xmlbeans.XmlBeans.class$(XmlBeans.java:43) at org.apache.xmlbeans.XmlBeans.buildNodeMethod(XmlBeans.java:195) at org.apache.xmlbeans.XmlBeans.buildNodeToCursorMethod(XmlBeans.java:232) at org.apache.xmlbeans.XmlBeans.clinit(XmlBeans.java:131) at org.bpelunit.framework.xml.suite.XMLTestSuiteDocument$Factory.newInstance( XMLTestSuiteDocument.java:45) at org.bpelunit.toolsupport.wizards.BPELUnitNewWizard.performFinish(BPELUnitN ewWizard.java:80) at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:742) at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373) at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:618) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:182) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(Acti onContributionItem.java:546) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributio nItem.java:490) at
RE: [VOTE RESULT] XMLBeans 2.4.0 Release
Distribution files and website is updated. Please let me know if I missed anything. Cezar From: Cezar Andrei [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2008 10:51 AM To: user@xmlbeans.apache.org; [EMAIL PROTECTED] Subject: [VOTE RESULT] XMLBeans 2.4.0 Release By unanimous consent, 5 +1 votes, 3 of which binding, RC3 officially becomes XMLBeans 2.4.0 release. In the next few days I'll update the distribution files and website to reflect it. Many thanks to everyone who devoted their time and effort for making this release possible. Cezar From: Cezar Andrei [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 02, 2008 1:44 PM To: [EMAIL PROTECTED] Cc: user@xmlbeans.apache.org Subject: [VOTE] XMLBeans 2.4.0 Release Given that there are no known problems with RC3, I'm starting a vote for declaring RC3 the official XMLBeans 2.4.0 release. Files are still available at this location: http://xmlbeans.apache.org/dist/ Everyone is welcome to vote but only votes from committers and PMC members are binding. In order for the vote to pass, a majority approval is required and at least three +1 binding votes. This vote will end Monday, July 7, 2008 (End of Day). [ ] +1 - I am in favor of this release, and can help [ ] +0 - I am in favor of this release, but cannot help [ ] -0 - I am not in favor of this release [ ] -1 - I am against this proposal (must include a reason) My vote is: [X] +1 - I am in favor of this release, and can help Cezar
RE: question on security..
From what I remember, you're the first to bring this up. I guess this is a good sign. If I understand correctly this question applies more to the applications that use XMLBeans. For XML, XMLBeans uses a standard compliant XML parser, which can be replaced using options with any other SAX parser. As for XPath, the included parser does cover for errors in the path and never -executes-- anything coming from the path expressions or the document it's applied on. Is there anything that you have in mind? Cezar From: al so [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 23, 2008 11:54 AM To: user@xmlbeans.apache.org Subject: question on security.. Is the XmlBeans library immune to Xpath and Xml injections? If not, I would appreciate any solutions that work best in tandem with XmlBeans.
RE: get_store() throws NullPointerException.
Srijith, from your info, it seems that you should address this question to Axis project. If you can get an XMLBeans stand alone repro, will look at it. Cezar From: Srijith Kochunni [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 24, 2008 8:03 AM To: user@xmlbeans.apache.org Subject: get_store() throws NullPointerException. Hi All, I am using Axis2 to create web service client using xmlbeans databinding. I have this strange problem that when I invoke the setter method for a particular type, I get a NullPointer exception. The exception is being thrown from an autogenerated code which I got using wsdl2java. The specific class which throws this error extends XmlObjectBase. The exception is thrown when the following code is invoked in the autogenerated class. target = (com.test.abc.Status)get_store().find_element_user(STATUS$0, 0); So obviously get_store is returning null. Have checked with the xmlbeans doc here - http://ws.apache.org/axis2/1_1_1/userguide-creatingclients-xmlbeans.html and am following all steps correctly, but not sure, why this error is caused. Any help in this regard would be greatly appreciated. Xml beans has been working for all my requirements so far and don't want to back out right now. Thanks, Srijith. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XMLStreamReader namespace handling
Gordon, The two methods are not designed to return exactly the same info. While xmlText() has to always return a valid XML document with more flexible options, the newXMLStreamReader() is designed for speed to transfer the contents of the XML store. Cezar -Original Message- From: Gordon Rogers [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2008 5:24 AM To: user@xmlbeans.apache.org Subject: XMLStreamReader namespace handling Hi I am using XMLBeans version 2.1.0 and have got a question about how the XMLStreamReader handles namespaces and in particular why the semantics used by the newXMLStreamReader() method and the xmlText() method are different when passed the same set of XmlOptions. This is best illustrated by an example: Map ns = new HashMap(); ns.put( EBXML_NAMESPACE_URI, EBXML_NAMESPACE_PREFIX ); XmlOptions xmlOptions = new XmlOptions(); xmlOptions.setSaveOuter(); xmlOptions.setSaveSuggestedPrefixes( ns ) xmlOptions.setSaveAggressiveNamespaces().setSaveImplicitNamespaces( ns ); MessageHeaderDocument messageHeaderDocument = MessageHeaderDocument.Factory.newInstance(); MessageHeaderDocument.MessageHeader messageHeader = messageHeaderDocument.addNewMessageHeader(); messageHeader.setVersion( 2.0 ); FromDocument.From from = messageHeader.addNewFrom(); PartyIdDocument.PartyId fromPartyId = from.addNewPartyId(); fromPartyId.setType( urn:nhs:names:partyType:ocs+serviceInstance ); fromPartyId.setStringValue( from_party_key ); ... The output from the messageHeaderDocument.xmlText( xmlOptions ) looks like: eb:MessageHeader xmlns:eb=http://www.oasis-open.org/committees/ebxml-msg/schema/msg-head er-2_0.xsd eb:version=2.0 eb:From eb:PartyId eb:type=urn:nhs:names:partyType:ocs+serviceInstancefrom_party_key/eb :PartyId /eb:From /eb:MessageHeader The output from messageHeaderDocument.newXMLStreamReader( xmlOptions ) looks like: MessageHeader xmlns=http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header- 2_0.xsd xmlns:axis2ns1=http://www.oasis-open.org/committees/ebxml-msg/schema/ms g-header-2_0.xsd axis2ns1:version=2.0 From PartyId xmlns:axis2ns2=http://www.oasis-open.org/committees/ebxml-msg/schema/ms g-header-2_0.xsd axis2ns2:type=urn:nhs:names:partyType:ocs+serviceInstancefrom_party_k ey/PartyId /From /MessageHeader As you can see the namespaces, whilst valid, have not been prefixed correctly or managed aggressively when using the XMLStreamReader approach. Does this seem like odd behaviour or is this expected? From looking at the 2.1.0 source the only options newXMLStreamReader() pays attention to are saveInner and saveOuter, why is this? I am writing an object that is a wrapper round an XmlObject and want to expose an XMLStreamReader as part of that interface, but due to this namespacing issue I'm considering exposing an InputStream instead, based on the String returned from the xmlText() method. This seems a bit hacky and I'm also concerned that it's not going to be the most efficient. I'm using the result of that method as the input to a StAXOMBuilder so that I can generate AXIOM classes for use in an axis 2 request. Has anyone used a similar approach? Thanks in advance for any help with this. Gordon - 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]
FW: Travel Assistance to ApacheCon US 2008 - 3 days to apply!
-Original Message- From: Gav... [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2008 5:10 AM To: [EMAIL PROTECTED] Subject: Travel Assistance to ApacheCon US 2008 - 3 days to apply! *- Apologies to those PMCs that already got this email. The first attempt I made was rejected by at least 1/2 of all PMCs without being modded through, 1/2 of those that did mod it through did not forward it on to their user or dev lists. That's at least 2+ folks who don't know they can get financial help. WITH NOW ONLY 3 DAYS TO GO BEFORE WE HAVE TO CLOSE OUR HELP OF TRAVEL ASSISTANCE TO APACHECON US 2008, Please, give your community a chance to go. -* Dear PMCs, Please could you forward the below message to your user@ and dev@ mailing lists, thanks in advance. - The Travel Assistance Committee is taking in applications for those wanting to attend ApacheCon US 2008 between the 3rd and 7th November 2008 in New Orleans. The Travel Assistance Committee is looking for people who would like to be able to attend ApacheCon US 2008 who need some financial support in order to get there. There are VERY few places available and the criteria is high, that aside applications are open to all open source developers who feel that their attendance would benefit themselves, their project(s), the ASF and open source in general. Financial assistance is available for flights, accommodation and entrance fees either in full or in part, depending on circumstances. It is intended that all our ApacheCon events are covered, so it may be prudent for those in Europe and or Asia to wait until an event closer to them comes up - you are all welcome to apply for ApacheCon US of course, but there must be compelling reasons for you to attend an event further away that your home location for your application to be considered above those closer to the event location. More information can be found on the main Apache website at http://www.apache.org/travel/index.html - where you will also find a link to the application form and details for submitting. Time is very tight for this event, so applications are open now and will end on the 2nd October 2008 - to give enough time for travel arrangements to be made. Good luck to all those that will apply. Regards, The Travel Assistance Committee - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Substitution Groups and Abstract Types
Jamie, Indeed there is a problem in your scenario. The problem is because of the substitution group uses and not because of type derivation. You can have base types and in your first schema and derived types in the second one, and you can compile them separately. Everything should work as if the were compiled at once. This is no longer valid with substitution groups, and this is because the substituted element has to know all it valid substitution at the moment of compilation, I know this is a drawback but solving this the right way would have a big impact on performance. The short answer is that if you modify a substitution you need to also include in the compilation the file of the substituted element. Hope this helps, Cezar From: Jamie Johnson [mailto:[EMAIL PROTECTED] Sent: Friday, October 03, 2008 3:03 PM To: user@xmlbeans.apache.org Subject: Re: Substitution Groups and Abstract Types I believe the answer to this is yes for anyone else that is interested. On Fri, Oct 3, 2008 at 8:56 AM, Jamie Johnson [EMAIL PROTECTED] wrote: I am attempting to build a set of schemas that uses substitution groups and abstract types which works flawlessly if I compile all the schemas together (i.e. one big jar) but if I build them all separately by first building the abstract type then building all the types that extend the abstract type with the abstracttype on the classpath XmlBeans substitution doesn't seem to work. Do all objects that extend the AbstractType need to be available at build time for XmlBeans to properly recognize the substitution groups? What is strange is when looking at a class that extends the AbstractType it clearly indicates that the AbstractType is it's base, but if I try to do (Extended)AbstractType.substitute(ExtendedDocument.impl.type, Extended.type); I received a class cast exception. Any idea how to address this without having to recompile the Abstract Schema everytime I want to add a type that extends the AbstractType? Jamie
RE: Multiple output files with inst2xsd?
You can run inst2xsd on multiple xml files. See inst2xsd -h for usage. int2xsd file1.xml file2.xml Cezar -Original Message- From: Ferry, Jeremy [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2008 10:26 AM To: user@xmlbeans.apache.org Subject: Multiple output files with inst2xsd? I'm running inst2xsd on a directory full of xml but the output is a single xsd file that combines all my xml elements. Is there a way to tell it to output one xsd for every xml? Or do I need to run inst2xsd on each individual xml file? Jeremy Ferry Sr. Software Engineer Sterling Commerce, an ATT company Eden Prairie, MN - 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: Huge .java get from huge xsd, compilation time 10min
Bartolomeo, Did you try using XMLBeans's scomp tool outside of Eclipse, from the command line? Eclipse might detect all the generated java files and it would spend CPU cycles indexing them. Cezar -Original Message- From: Bartolomeo Nicolotti [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2008 2:48 AM To: [EMAIL PROTECTED] Cc: user@xmlbeans.apache.org Subject: RE: Huge .java get from huge xsd, compilation time 10min Hi, thanks for the response. wsdl2java takes approximatively 1min, but there're more xsd, while the Java compilation that takes 10min to compile the two files: 11Mb (.java) and 35Mb (...impl.java maybe is the java compiler used by Eclipse IDE. Do you have any idea of how to speed up this things? The situation is worsen by the fact that sometimes Eclipse 3.2.2 rebuilds everything even if it's not necessary, and when build is in progress I couldn't even save a file. Best Regards Bye Il giorno gio, 23/10/2008 alle 20.47 -0700, Radu Preotiuc-Pietro ha scritto: That is a big XSD... The most I have tried with is 2MB spread across 2 files (1.1MB + 0.9MB). On my Linux box, the compilation itself takes 6s which doesn't seem so bad, generation of Java sources takes 12s, because there's a lot of I/O involved (32MB of generated files in my case), and compilation another 25sec, so overall about 43sec, with most of it spent in Java compilation, which is what it is. So 10min for you seems indeed excessive, but you mentioned you use wsdl2java, which is not a tool provided by XmlBeans. I suggest you try with scomp on the same set of Schemas to give you a better idea of where's the time going. Or you may have a slow machine. But in general I would not expect much less than 1min overall, because there's a lot of work to be done. I guess one way to speed it up would be for XMLBeans to generate class files directly and skip the time-consuming compilation phase, that'd be an interesting project for someone to take on... Radu -Original Message- From: Bartolomeo Nicolotti [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2008 3:59 AM To: user@xmlbeans.apache.org Subject: Huge .java get from huge xsd, compilation time 10min Hi, I'm using axis2 to consume web services for travel industry. For the Galileo web service I've an xsd of 2.5Mb (Megabytes) and the classes generated by xmlbens are 11Mb (.java) and 35Mb (...impl.java). The problem is that to compile it takes 10min. Is there a way to improve the compilation time? The command I use with axis2 is: wsdl2java.sh -uri XMLSelect_emea.wsdl -S JavaSource -R resources/XMLSelectClient -s -sd -ssi -sp -or -d xmlbean -o ../.. (... namespace mapping) Many thanks, best regards. B.Nicolotti -- Bartolomeo Nicolotti SIAP s.r.l. www.siapcn.it v.S.Albano 13 12049 Trinità(CN) Italy ph:+39 0172 652553 centralino: +39 0172 652511 fax: +39 0172 652519 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Bartolomeo Nicolotti SIAP s.r.l. www.siapcn.it v.S.Albano 13 12049 Trinità(CN) Italy ph:+39 0172 652553 centralino: +39 0172 652511 fax: +39 0172 652519 - To unsubscribe, e-mail: [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 Synchronization
Hi Paul, When doing local updates a simple synchronization is done on the synchronization domain of that XMLObject, we call it Locale. By default, each new document XMLObject is created with a new Locale. But when there is an update operation involving XMLObjects from two Locale-s, we're using a Global lock for a short time to get the locks on the two locales and avoid deadlocks. See code at org.apache.xmlbeans.impl.values.XmlObjectBase.set(XmlObjectBase.java:~2049) . Most probably your application is doing lot's of set's or the JVM is not optimized for this situation. Did you try using a different JVM, 1.6 or JRockit? Or you can modify your app to have XMLObjects created in the same Locale, this way avoiding GlobalLock. There is a non backwards compat option, Locale.USE_SAME_LOCALE that can be used when creating a new XMLObject to have it created in the same Locale as a different XMLObject. Cezar From: Paul Hepworth [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2008 7:00 AM To: user@xmlbeans.apache.org; [EMAIL PROTECTED] Subject: XmlBeans and Synchronization Hi (included dev list as this may be too in depth for the user list) I'm using XmlBeans 2.3.0 in a Weblogic 9.2 J2EE web application (JVM 1.5.0_10). We use XmlBeans to compile our schema and these effectively become our domain objects. These are looked up from the DB, stored in the Http Session, manipulated from the UI and passed to the DB again. The application appears to run fine with a single user, however when we test it with multiple users using LoadRunner, we hit issues. What we are seeing is that we're getting stuck threads with the following stack: at java.lang.Object.wait(Native Method) - waiting on 0xd4a816e8 (a org.apache.xmlbeans.impl.common.Mutex) at java.lang.Object.wait(Object.java:474) at org.apache.xmlbeans.impl.common.Mutex.acquire(Mutex.java:33) - locked 0xd4a816e8 (a org.apache.xmlbeans.impl.common.Mutex) at org.apache.xmlbeans.impl.common.GlobalLock.acquire(GlobalLock.java:27) at org.apache.xmlbeans.impl.values.XmlObjectBase.set(XmlObjectBase.java:1944) at ...MyClassImpl.setMyValue(...) Can anyone shed any light on why this may happen? More specifically, does anyone know what the synchronisation strategy is in XmlBeans. From my investigation, the GlobalLock uses a static Mutex, which means that if an instance needs to take out more than 1 lock, it attempts to acquire a GlobalLock and will subsequently lock out all other threads in the JVM from making any changes to an XmlObject. If that's the case, it seems very strange that making an update to 1 instance of an XmlObject would lock out all other threads form updating any other instance of an XmlObject. I would have thought that the synchronisation would have solely been around the instance itself. We have also seen the same issues that have been recorded here: https://issues.apache.org/jira/browse/XMLBEANS-328 Any help on this would be much appreciated as it's causing major issues!! Thanks Paul This message should be regarded as confidential. If you have received this email in error please notify the sender and destroy it immediately. Statements of intent shall only become binding when confirmed in hard copy by an authorised signatory. The contents of this email may relate to dealings with other companies within the Detica Group plc group of companies. Detica Limited is registered in England under No: 1337451. Registered offices: Surrey Research Park, Guildford, Surrey, GU2 7YP, England.
RE: Xml Element Insertion - Updating Dom Tree
Tim, A good start would be the following documentation page: http://xmlbeans.apache.org/docs/2.0.0/guide/conIntroToTheSchemaTypeSystem.html You should check the SchemaType interface and using getContentModel() method to check for the required particles. Cezar From: Tim Dilks [mailto:[EMAIL PROTECTED] Sent: Monday, November 03, 2008 10:08 AM To: user@xmlbeans.apache.org Subject: Xml Element Insertion - Updating Dom Tree I am developing an application (a bit like XmlSpy) which allows users to load an xml file (with an 'scomp'ed schema), and will allow insertions and data entry. I have a JtreeTable which I am populating using the doc = Document.Factory.parse(tempFile); return (Document) doc.getDomNode(); When the user clicks on a node in the Jtree, a window is updated to show the valid elements available for insert. I have this part all working nicely. The functionality I am working on implementing now is: the user clicks an 'add' button next to a listed element, and that element should be inserted into the tree (and of course the underlying xml). It would be good to have all mandatory elements created for that inserted node as well. Any high level pointers about how best to proceed here would be much appreciated. Thanks.
FW: [Urgent] Please help promote ApacheCon video streaming!
FYI -Original Message- From: Lars Eilebrecht [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2008 10:27 AM To: [EMAIL PROTECTED] Subject: [Urgent] Please help promote ApacheCon video streaming! Importance: High Hi, please help promote the ApacheCon live video streaming by forwarding the email below to your PMC user and dev mailing lists, ASAP! Thank you Lars Eilebrecht - Subject: ApacheCon live video streaming available; keynotes and Apache 101 are free Can't make ApacheCon this week in New Orleans? You can still watch all the keynotes, Apache 101 sessions, and system administration track in live video streams: http://streaming.linux-magazin.de/en/program_apacheconus08.htm?ann Keynotes and the Apache 101 lunchtime sessions are free; the full sysadmin track, including httpd performance, security, and server stack administration talks are available for a fee. Keynotes include: - David Recordon, Six Apart (Wednesday 09:30) Learning from Apache to create Open Specifications - Shahani Markus Weerawarana, Ph.D. (Thursday 11:30) Standing on the Shoulders of Giants - Sam Ramji, Microsoft (Friday 11:30) struct.new(future, :open, :microsoft) Reminder: New Orleans is CST or UTC/GMT -6 hours. Advance notice: ApacheCon EU 2009 returns to Amsterdam, 23-27 March. We had a great response to our CFP and look forward to announcing the schedule in the next month. --- -- Lars Eilebrecht - V.P., Conference Planning [EMAIL PROTECTED] - http://www.us.apachecon.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OutOfMemoryError receiving Soap Responses using Axis2 and XMLBeans
Hi, I don't think the change is related to the problem you're describing, this fix is related to the compiled xpath/xquery cache. Can you try using only XMLBeans to parse that document and compare the memory usage? All you need to do is: XmlObject xo = XmlObject.Factory.parse(new File(name_of_3MB_file)); Cezar From: Albrecht Militzer [mailto:a...@mms-dresden.de] Sent: Monday, February 23, 2009 3:36 AM To: user@xmlbeans.apache.org Subject: OutOfMemoryError receiving Soap Responses using Axis2 and XMLBeans Hello, I use XMLBeans with Axis2 to make webservice-calls. The latest version of Axis2 uses XMLBeans 2.3.0 under the hood, so I am using that. Occasionally I get OutOfMemoryErrors. They happen across different services with different schemas. Sometimes it is an order search that returns 2.5 MB of XML, sometimes it is a simple call to a content management system for some I18N text for a GUI label. I examined my memory dumps with IBMs Memory Analyzer. I found a common pattern. There is an almost infinite chain of org.apache.xmlbeans.impl.store.Xobj$ElementXobj objects. One of these objects references another of the same type and so on and on. I do not know how long this chain is because it is too long to expand it in the Analyzer's object tree. However, the Memory Analyzer tells me that this chain occupies 588 MB of memory. I consider this a lot even for 2.5 MB of XML. What it unfortunately does not tell me is the name of the variable that holds the reference from one element to the next. One more thing: Sometimes the root of the object tree is a java.util.HashMap$Entry. (Before you ask, the Analyzer does not tell me the actual contents of the objects, just the reference graph.) Looking for reasons why such an object is the root, I found the following line in the changelog for XMLBeans 2.4: Replace static HashMaps with WeakHashMaps Could this help me? If so, is there anyone here using Axis2 with XMLBeans 2.4.0? I attached a screenshot of one of my memory dumps, but I do not know if the mailing list allows this. Thanks in advance for any help Bye Albrecht
RE: Navigating Untyped XmlObject with XmlCursor
Kapil, You don't need to create a new cursor, if the item your cursor points to has a name (i.e. element/attribute/pi) just call getName() on it. Check out the javadoc of XmlCursor http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlCursor.html and XmlObject http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlObject.html. An XmlObject represents the xml instance of the schema type that is assigned to, that's why you see xml-fragment. Take a look at the save XmlOptions, saveOutter might be what you're looking for: http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlOptions.html#setSaveOuter(). Cezar -Original Message- From: Kapil Anand [mailto:kapil...@yahoo.com] Sent: Wednesday, March 11, 2009 10:20 PM To: user@xmlbeans.apache.org Subject: Re: Navigating Untyped XmlObject with XmlCursor OK I figured it out. It was my lack of understanding of how cursor.getObject() works. There must be some good reason behind this design but it sure is tricky. xmlObj = cursor.getObject() returns the typed contents of the current start/startdoc cursor position and it excludes the container element itself and so it does not show up in xmlObj.xmlText(). But it does store the QName of the parent element somewhere as it can be accessed again by calling xmlObj.newCursor.getName(). It would be good though if this could be accessible without creating the new cursor. Now I am wondering what would be the way to create the container XMLObject from this one, so the xmlText shows the container element name as well. Tried two things without success: 1) XMLObject.Factory.parse(xmlObj.newXMLStreamReader()). The xmlText() remains the same, perhaps the new one might have lost the information about the cursor name that represented the container element. 2) newObj = XMLObject.Factory.newInstance() newObj.set(xmlObj); This one threw exception: org.apache.xmlbeans.impl.values.XmlValueDisconnectedException I would appreciate any help or ideas. regards kapil Kapil Anand wrote: Thanks for replying Jacob. I tried cursor.child(1) but it returns false. (child index 1 anyway represents the second child of the current cursor position and i need to select the first child). This is what i am inferring from the behavior of the api: When i start with the XmlObject that represents the untyped document, the first child under it is an xml-fragment containing the contents of the root element. But this does not make sense. It might make perfect sense perhaps if I had started with a schema and declared things like this: xs:complexType name=ElemT ... /xs:complexType xs:element name=RootElem type=ElemT/ But I have doubts about this even for typed XmlObject, because it might be right if i am trying to get to the next token, but next child should always be a concrete node as per my understanding. This assumption/inference is proved wrong when i try to move to the first child of this xml-fragment, it actually takes me to the subsequent child, so child navigation is correct the contents of the intermediate child are incorrect. I will try to explain in problem with the tree. RootElement - Level1.1 - Level2-1.1 - Level1.2 - Level2-1.2 - Level1.3 - Level2-1.3 First cursor.toChild(0) should return Level1.1 but instead it returns all the children of Root inside an xml-fragment. Dont know if this is expected behavior but it does not match the behavior of the next call to cursor.toChild(0) since it correctly returns Level2-1.1. So although the first time the cursor was pointing to Level1.1, it somehow returned wrong XML fragment in cursor.getObject(); When i use an XML with single child for each parent it works fine (no siblings at any level). It returns Level1.1 in the first call and Level2-1.1 in the next call, so on and so forth. regards kapil -- View this message in context: http://www.nabble.com/Navigating-Untyped- XmlObject-with-XmlCursor-tp22463857p22469181.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
[POOL] jdk 1.4 support in next of XMLBeans
Thinking on the features for a new XMLBeans release, a question came on how important is for our community support for jdk 1.4. If you're using XMLBeans, please let us know what version of jdk are you using in your project and also if you have a target date for a jdk update. I'm using XMLBeans in a project running on: [ ] jdk 1.3 [ ] jdk 1.4 [ ] jdk 1.5 [ ] jdk 1.6 My project will update to jdk 1.5 or newer in: [ ] less than 6 month [ ] less than 1 year [ ] more than 1 year Any other suggestions or features are welcome. Thank you, Cezar Andrei
RE: Maven and XMLBeans, not best friends??
Did you look at using the maven-plugin that's in XMLBeans tree? http://svn.apache.org/viewvc/xmlbeans/trunk/maven-plugin/ Cezar -Original Message- From: hannehomuth [mailto:hannehomu...@gmx.de] Sent: Wednesday, July 22, 2009 5:22 AM To: user@xmlbeans.apache.org Subject: Maven and XMLBeans, not best friends?? Hi to everyone, I've trying and searching a lot of hours but could not find any solution which worked for me. I want to use xmlbeans in an project which uses maven as build tool. I've configured the plugin in the pom.xml in this way plugin groupIdorg.codehaus.mojo/groupId artifactIdxmlbeans-maven-plugin/artifactId version2.1.0/version executions execution idBuild-XMLBeans/id goals goalxmlbeans/goal /goals /execution /executions configuration schemaDirectorysrc/main/java/com/vw/ais/jobengine/propertytypes/schemaD irectory schemaDirectorysrc/main/java/com/vw/ais/jobengine/configurations/schema Directory classGenerationDirectory${project.build.directory}/generated- classes/xmlbeans/classGenerationDirectory sourceGenerationDirectory${project.build.directory}/generated- sources/xmlbeans/sourceGenerationDirectory verbosetrue/verbose /configuration /plugin Furthermore I have declared some dependencies for xmlbeans dependencies dependency groupIdxmlbeans/groupId artifactIdxmlbeans/artifactId version2.2.0/version /dependency dependency groupIdxmlbeans/groupId artifactIdxbean/artifactId version2.1.0/version /dependency /dependencies The project build will run successful, but when I try to run the app, I get the good old Exception in thread main java.lang.ExceptionInInitializerError at com.vw.ais.jobengine.validation.ConfigurationValidator.schematicValidation (ConfigurationValidator.java:98) at com.vw.ais.jobengine.validation.ConfigurationValidator.validate(Configurat ionValidator.java:58) at com.vw.ais.jobengine.JobEngine.initialize(JobEngine.java:54) at com.vw.ais.jobengine.Test.main(Test.java:34) Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.s09447651F54C8102642F6478AB9428E3.TypeSys temHolder. Make sure the generated binary files are on the classpath. at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783) at com.vw.ais.jobengine.configurations.JobEngineDocument.clinit(JobEngineDo cument.java:19) ... 4 more Caused by: java.lang.ClassNotFoundException: schemaorg_apache_xmlbeans.system.s09447651F54C8102642F6478AB9428E3.TypeSys temHolder ... ... The Class schemaorg_apache_xmlbeans.system.s09447651F54C8102642F6478AB9428E3.TypeSys temHolder lies in the jar. What the hell is wrong here. Does anyone see what I'm doing wrong here. Thx for suggestions -- View this message in context: http://www.nabble.com/Maven-and-XMLBeans%2C- not-best-friends---tp24603611p24603611.html Sent from the Xml Beans - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org