Re: Wrong namespace prefix in generated documents?

2014-08-04 Thread Cezar Andrei

Michael,

That's odd, please check that your namespace URI is exactly the same in 
both the schema and the map you're setting. Also, make sure the prefix 
you want is not already used in your document with a different URI.


If it's still not working and you're not afraid of debugging, you can 
trace the ensureMapping method in Saver.java:757 .

http://svn.apache.org/viewvc/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java?view=markup

Cezar

On 08/02/2014 02:04 PM, Michael Bishop wrote:
OK, thanks for the information. Unfortunately, this doesn't seem to 
fix the problem. I thought I'd tried the steps outlined in the linked 
blog before, but I did it again, just in case.


Here's the full schema definitions:

Old:
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
*xmlns:xxx=http://...*
   targetNamespace=http://...;
   elementFormDefault=qualified

New:
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
*xmlns:xxx=yyy:aaa:bbb...*
   targetNamespace=yyy:...
   elementFormDefault=qualified

As you can see, in both schemas, I'm declaring a namespace of *xxx*, 
but it's only honored in the old schema. The only thing that's changed 
between schemas is the namespace. I had a request from our customer to 
change it. However, a call to:


MyGeneratedClass.Factory.newInstance() results in a document that 
looks like this:


yyy:root xmlns:yyy=yyy:aaa:bbb.../

Applying a namespace map to an XmlOptions object doesn't seem to have 
any effect. I've tried it with the call to 
MyGeneratedClass.Factory.newInstance() and a call to 
MyGeneratedInstance.xmlText():


XmlOptions options = new XmlOptions();
MapString, String nsMap = new HashMap();
nsMap.put(yyy:aaa:bbb, xxx);
options.setSaveSuggestedPrefixes(nsMap);

// No change to output.
MyGeneratedClass.Factory.newInstance(options);
MyGeneratedInstance.xmlText(options);

I guess I have two questions:

1. Why is the prefix declaration in my schema being ignored? 
*xmlns:xxx* has never changed. It's only the value of the namespace 
that has changed.


2. I find it odd that Map has no effect either. Is there anything else 
I should be looking into? I'm not sure if my schema is somehow wrong 
or I have a setting in XMLBeans misconfigured. It's becoming more than 
just an annoying problem. XPath statements are now broken since they 
employ the *xxx* prefix. I'm not sure where to start tracking down the 
issue. Both the guidance and the docs seem straightforward to me, yet 
I can't get it to work properly.


Any guidance is appreciated. I'm on XMLBeans 2.5.0. If there's 
anything more I can provide, I can do so.


Michael Bishop


On Fri, Aug 1, 2014 at 12:10 PM, Cezar Andrei cezar.and...@oracle.com 
mailto:cezar.and...@oracle.com wrote:


If you don't provide a prefix, XmlBeans will automatically pick a
prefix, and it tries to pick one that is part of the URI.

Cezar



On 07/28/2014 01:27 PM, Michael Bishop wrote:

Hello all. I've recently changed the namespace of my schema.
Now I'm getting the wrong prefix name and I'm not sure why.

Old namespace was:

xmlns:*xxx*=http://ccc.bbb.aaa;

New namespace is:

xmlns:*xxx*=*yyy*:aaa:bbb:ccc

With the old namespace, the prefix for elements was xxx. Now
with the new namespace, the prefix fpr elements is *yyy*. It
seems switching from URL form to URI form has caused the
processor to start using the first part of the URI as the
prefix? This happens when I call the static
Factory.newInstance() on generated classes. Older documents
with the correct prefix still parse properly.

It's not a big deal since the namespace is intact and things
work as they should, but I can't figure out why this is
happening. I don't declare xmlns:*yyy* anywhere in the schema
or xsdconfig files.

Michael Bishop



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
mailto:user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org
mailto:user-h...@xmlbeans.apache.org





-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: Wrong namespace prefix in generated documents?

2014-08-01 Thread Cezar Andrei
If you don't provide a prefix, XmlBeans will automatically pick a 
prefix, and it tries to pick one that is part of the URI.


Cezar


On 07/28/2014 01:27 PM, Michael Bishop wrote:
Hello all. I've recently changed the namespace of my schema. Now I'm 
getting the wrong prefix name and I'm not sure why.


Old namespace was:

xmlns:*xxx*=http://ccc.bbb.aaa;

New namespace is:

xmlns:*xxx*=*yyy*:aaa:bbb:ccc

With the old namespace, the prefix for elements was xxx. Now with the 
new namespace, the prefix fpr elements is *yyy*. It seems switching 
from URL form to URI form has caused the processor to start using the 
first part of the URI as the prefix? This happens when I call the 
static Factory.newInstance() on generated classes. Older documents 
with the correct prefix still parse properly.


It's not a big deal since the namespace is intact and things work as 
they should, but I can't figure out why this is happening. I don't 
declare xmlns:*yyy* anywhere in the schema or xsdconfig files.


Michael Bishop



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: XmlCursor tutorial

2014-07-11 Thread Cezar Andrei

This document is probably the closest you're looking for.
http://xmlbeans.apache.org/docs/2.0.0/guide/conNavigatingXMLwithCursors.html

Cezar


On 06/24/2014 03:00 PM, jgagnon wrote:

Does anyone know of any tutorials about using the XMLBeans XmlCursor?  I've
looked at the little bit on the XMLBeans site, but that really doesn't cover
much.  I'm trying to figure out how to use it to construct a document
(actually many documents - test cases) and it is anything but intuitive.  If
someone knows of a really well written, fairly comprehensive tutorial on its
usage, it would be very much appreciated.



--
View this message in context: 
http://xmlbeans.996285.n3.nabble.com/XmlCursor-tutorial-tp7515.html
Sent from the XMLBeans User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org





Re: Dynamic generation of XML object hierarchy using schema

2014-05-06 Thread Cezar Andrei
Joseph,

Best way to learn for what you need to is to look at the implementation of 
xsd2inst tool:
http://svn.apache.org/viewvc/xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/xsd2inst/SchemaInstanceGenerator.java?view=markup

Cezar


On May 6, 2014, at 11:19 AM, jgagnon joseph.gag...@ll.mit.edu wrote:

 I am working on a project where we are trying to dynamically generate XML
 instances, using the information gleaned from a defining XML schema.  The
 instances will represent test cases for a given message type.
 
 I've experimented with the XMLBeans schema type system to get useful
 information about the types defined in the schema, such as the structure
 (sequences, choices, etc.), min/max occurs and various restrictions
 (enumerations, patterns, etc.). This information will be used to determine
 what types of test cases will be generated for a given message element.
 
 I'm at the point where I'd like to use the XMLBeans Java API to
 programmatically generate XML document instances. Of course, I would need to
 compile the schema to generate a Java library of classes that represent the
 Java form of the message types (and supporting types).
 
 What I don't know is how to dynamically use the generated API to create an
 object hierarchy representing a test case.  The hierarchy would represent a
 message instance (which may or may not be valid or complete based on the
 test case), with element content populated with test data.
 
 I cannot seem to find the information from the schema type system that would
 allow me to bridge between the schema information and the specific
 generated API classes that would need to be used to generate the object
 hierarchy.
 
 I assume if this information is available, I would then need to use
 reflection to create the objects and set their values and attributes.
 
 Does anyone have suggestions?
 
 
 
 --
 View this message in context: 
 http://xmlbeans.996285.n3.nabble.com/Dynamic-generation-of-XML-object-hierarchy-using-schema-tp7501.html
 Sent from the XMLBeans User mailing list archive at Nabble.com.
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 


-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: Duplicate complex types with mixed elements

2014-03-17 Thread Cezar Andrei

Narayan,

It's probably a bug that the node1Type is not removed but this doesn't 
affect the rest since it's not used elsewhere.

As you can see in personType, node1 element is defined as mixed content.

Cezar


On 03/11/2014 12:20 AM, Parvatikar, Narayan wrote:


Hi ,

I am trying to generate a xsd from a sample xml which looks like below,

?xml version=1.0 encoding=UTF-8?

person

node1 text /node1

node1 name john /name /node1

/person

Here *node1* is mixed element.

But there are two definitions seen for the node1 in xsd.

One is global complex type and other is complex type defined inline ( 
Check below )


?xml version=1.0 encoding=UTF-8?

xs:schemaxmlns:xs=http://www.w3.org/2001/XMLSchemaelementFormDefault=qualifiedattributeFormDefault=unqualified;

xs:elementname=persontype=personType/

xs:complexTypename=node1Type

xs:sequence

xs:elementname=nametype=xs:stringminOccurs=0/

/xs:sequence

/xs:complexType

xs:complexTypename=personType

xs:sequence

xs:elementname=node1minOccurs=0maxOccurs=unbounded

xs:complexTypemixed=true

xs:sequence

xs:elementname=nametype=xs:stringminOccurs=0/

/xs:sequence

/xs:complexType

/xs:element

/xs:sequence

/xs:complexType

/xs:schema

I am using RussianDoll Strategy for generating this . Do we know any 
solution to fix this ?


Thanks

Narayan





Re: question about namespace

2014-02-18 Thread Cezar Andrei
I believe the order doesn't affect the output.
I see you use setSaveImplicitNamespaces(), this should be used only when
you use XMLBeans for only a smaller part of the document.

Cezar

On Mon, 2014-02-17 at 17:27 -0800, Ted Slusser wrote:
 Hi
 
 Thanks for the suggestion.  I am calling that already, but it doesn't seem to 
 work for my desired effect.
 
 Does the order of the options make any difference?
 
 Thanks,
 
 Ted Slusser
 Java Developer
 Vanderbilt Informatics
 615-420-7326
 
  On Feb 17, 2014, at 4:44 PM, Cezar Andrei cezar.and...@oracle.com wrote:
  
  Ted,
  
  Give a try to XmlOptions.setSaveAggressiveNamespaces() it might get
  closer to the form you want.
  http://xmlbeans.apache.org/docs/2.6.0/reference/org/apache/xmlbeans/XmlOptions.html#setSaveAggressiveNamespaces%28%29
  
  Cezar
  
  On Mon, 2014-02-17 at 13:36 -0800, Ted Slusser wrote:
  Hello,
  
  I’m using XMLBeans 2.6.0 to generate a document based on HL7 CDA.  I am 
  setting an attribute on an element and the output looks like:
  
  code xmlns:urn=urn:hl7-org:v3 xsi:type=urn:CE code=NI 
  codeSystem=2.16.840.1.113883.6.96 displayName=NI”
  
  I would like it to look like this:
  
  code xsi:type=CE code=NI codeSystem=2.16.840.1.113883.6.96 
  displayName=NI”
  
  Here’s the document namespace declaration:
  
  ClinicalDocument xmlns=urn:hl7-org:v3 
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance”
  
  I’m setting the following in XmlOptions:
  
 setUseDefaultNamespace();
 setSavePrettyPrint();
 setSaveSubstituteCharacters(createXmlOptionCharEscapeMap());
 setSaveSuggestedPrefixes(createSuggestedPrefixes());
 setSaveImplicitNamespaces(createImplicitNamespaces());
 setSaveNamespacesFirst();
 setSaveAggressiveNamespaces();
  
  And my namespace map is:
  
 map.put(urn:hl7-org:v3, );
 map.put(http://www.w3.org/2001/XMLSchema-instance;, xsi”);
  
  Is there anyway I can get XmlBeans to emit the “code” element without 
  redeclaring the namespace?
  
  Thanks,
  
  Ted
  -
  To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
  For additional commands, e-mail: user-h...@xmlbeans.apache.org
  
  
  
  -
  To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
  For additional commands, e-mail: user-h...@xmlbeans.apache.org
  
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: question about namespace

2014-02-17 Thread Cezar Andrei
Ted,

Give a try to XmlOptions.setSaveAggressiveNamespaces() it might get
closer to the form you want.
http://xmlbeans.apache.org/docs/2.6.0/reference/org/apache/xmlbeans/XmlOptions.html#setSaveAggressiveNamespaces%28%29

Cezar

On Mon, 2014-02-17 at 13:36 -0800, Ted Slusser wrote:
 Hello,
 
 I’m using XMLBeans 2.6.0 to generate a document based on HL7 CDA.  I am 
 setting an attribute on an element and the output looks like:
 
 code xmlns:urn=urn:hl7-org:v3 xsi:type=urn:CE code=NI 
 codeSystem=2.16.840.1.113883.6.96 displayName=NI”
 
 I would like it to look like this:
 
 code xsi:type=CE code=NI codeSystem=2.16.840.1.113883.6.96 
 displayName=NI”
 
 Here’s the document namespace declaration:
 
 ClinicalDocument xmlns=urn:hl7-org:v3 
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance”
 
 I’m setting the following in XmlOptions:
 
 setUseDefaultNamespace();
 setSavePrettyPrint();
 setSaveSubstituteCharacters(createXmlOptionCharEscapeMap());
 setSaveSuggestedPrefixes(createSuggestedPrefixes());
 setSaveImplicitNamespaces(createImplicitNamespaces());
 setSaveNamespacesFirst();
 setSaveAggressiveNamespaces();
 
 And my namespace map is:
 
 map.put(urn:hl7-org:v3, );
 map.put(http://www.w3.org/2001/XMLSchema-instance;, xsi”);
 
 Is there anyway I can get XmlBeans to emit the “code” element without 
 redeclaring the namespace?
 
 Thanks,
 
 Ted
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



RE: Handling namespaces in xsd

2014-01-28 Thread Cezar Andrei
I used inst2xsd tool in bin directory: 
./xmlbeans/bin/inst2xsd inst.xml 
[ -verbose -validate ] switches are optional.

If you need to call it from your code just look at the implementation.

I don't remember if imports are implemented but it's not an XmlSchema
spec requirement.

Cezar

On Mon, 2014-01-27 at 20:20 -0800, Parvatikar, Narayan wrote:
 Thanks lot Cezar, this is what I am looking for. 
 
 How did you do that ?  I am using xmlbeans 2.6.0 and API Inst2Xsd.inst2xsd() 
 , but I am not able to generate like this.
 Is there any specific option to generate like this ?
 
 I tried xmloptions. setLoadAdditionalNamespaces() but it dint help. 
 
 Also, I noticed that there are no import statements added in schema you sent 
 , Is there a way to do that  ? 
 
 Thanks
 Narayan
 
 -Original Message-
 From: Cezar Andrei [mailto:cezar.and...@oracle.com] 
 Sent: Monday, January 27, 2014 9:14 PM
 To: user@xmlbeans.apache.org
 Subject: Re: Handling namespaces in xsd
 
 Narayan,
 
 It seems correct to me. Each namespace is defined by a separate schema file. 
 And there is a definition in the last schema for abc element:
 element name=abc type=abcType/
 
 Cezar
 
 Here are the generated schema files:
 
 schema attributeFormDefault=unqualified
 elementFormDefault=qualified
 targetNamespace=http://www.w3schools.com/furniture;
 xmlns=http://www.w3.org/2001/XMLSchema;
   element name=table type=fur:tableType
 xmlns:fur=http://www.w3schools.com/furniture/
   complexType name=tableType
 sequence
   element type=xs:string name=name
 xmlns:xs=http://www.w3.org/2001/XMLSchema/
   element type=xs:byte name=width
 xmlns:xs=http://www.w3.org/2001/XMLSchema/
   element type=xs:byte name=length
 xmlns:xs=http://www.w3.org/2001/XMLSchema/
 /sequence
   /complexType
 /schema
 --
 
 schema attributeFormDefault=unqualified
 elementFormDefault=qualified
 targetNamespace=http://www.w3.org/TR/html4/;
 xmlns=http://www.w3.org/2001/XMLSchema;
   element name=table type=htm:tableType
 xmlns:htm=http://www.w3.org/TR/html4//
   complexType name=trType
 sequence
   element name=td maxOccurs=unbounded minOccurs=0
 simpleType
   restriction base=xs:string
 xmlns:xs=http://www.w3.org/2001/XMLSchema;
 enumeration value=Apples/
 enumeration value=Bananas/
   /restriction
 /simpleType
   /element
 /sequence
   /complexType
   complexType name=tableType
 sequence
   element type=htm:trType name=tr
 xmlns:htm=http://www.w3.org/TR/html4//
 /sequence
   /complexType
 /schema
 --
 
 schema attributeFormDefault=unqualified
 elementFormDefault=qualified xmlns=http://www.w3.org/2001/XMLSchema;
   element name=abc type=abcType/
   complexType name=abcType
 sequence
   element ref=fur:table
 xmlns:fur=http://www.w3schools.com/furniture/
   element ref=htm:table xmlns:htm=http://www.w3.org/TR/html4//
 /sequence
   /complexType
 /schema
 
 
 
 Cezar
 
 
 On Mon, 2014-01-27 at 04:36 -0800, Parvatikar, Narayan wrote:
  Hi
  
   
  
  I am trying to convert a xml sample which has multiple namespaces 
  using xmlbeans inst2xsd java API.
  
  The generated xsd does not look correct?  
  
  Source XML : 
  
   
  
  ?xml version=1.0 encoding=UTF-8?
  
  abc xmlns:h=http://www.w3.org/TR/html4/;
  xmlns:f=http://www.w3schools.com/furniture;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  
  f:table
  
  f:nameAfrican Coffee Table/f:name
  
  f:width80/f:width
  
  f:length120/f:length
  
  /f:table
  
  h:table
  
  h:tr
  
  h:tdApples/h:td
  
  h:tdBananas/h:td
  
  /h:tr
  
  /h:table
  
  /abc
  
   
  
  The generated XSD contains only f: table and does not produce element 
  definition for root element abc.
  
  Is there any way to handle the multiple namespaces in xmlbeans ? 
  
   
  
   
  
  Thanks
  
  Narayan
  
   
  
  
 
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: Prevent Ampersand Escaping

2014-01-14 Thread Cezar Andrei
Michelle,

You're right, XML content that contains  and  needs to be escaped and
XmlBeans does that even if you try to escape it beforehand, which is not
right. You're also right that using XmlOptionCharEscapeMap doesn't
affect them, if you know what you're doing you can look at the code that
does the escaping: src/store/org/apache/xmlbeans/impl/store/Saver.java
lines 1419-1422.

This is a strange request since all XML processors should know how to
handle amp; and lt; correctly.

hth,
Cezar

On Tue, 2014-01-14 at 09:13 -0800, Friessen, Michelle wrote:
 Greetings,
 
 
 Is there any way to stop XMLBeans version 2.5.0 from escaping the
 ampersand?  Per system requirements, I am converting special
 characters as follows:
 
 
 return str.replace(, #x0026;).replace(\,
 #x0022;).replace(', #x0027;).replace(,
 #x003C;).replace(, #x003E;);
 
 
 
 However, xmlbeans is escaping the ampersand (#x0022; becomes
 amp;x0022;); therefore, the character comes out as code (amp;#x0026;
 instead of ) when the XML is read by another application.
 
 
 XmlOptionCharEscapeMap does not have the capability to handle the
 codes I need to use.  When I specify
 
 
 escapes.addMapping('', XmlOptionCharEscapeMap.HEXADECIMAL);
 
 
 the ampersand comes out as amp; instead of #x26;.
 
 
 It's likely that someone is going to respond saying xmlbeans has to
 escape the ampersand because it is a mandatory restriction of XML.  If
 that is a response, then please provide some type of solution to my
 problem because I have to use the codes listed above.
 
 
 Thanks.
 
 
 -- Michelle



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: Add to XmlBeans FAQ re orphaned objects and XmlValueDisconnectedException

2013-08-21 Thread Cezar Andrei
I added the new question and answer to the Faq page.

XmlObject.copy() should be much more efficient than toString() and
parse().

Cezar

On Tue, 2013-08-20 at 07:10 -0700, Lott, Christopher M wrote:
 I would like to suggest an addition to page 
 http://wiki.apache.org/xmlbeans/XmlBeansFaq but I cannot edit it, so am 
 trying the email list.   Please redirect me if I'm sending this to the wrong 
 place. 
 
 Is this Q  A sufficient and clear?  Thanks for listening.
 
 
 Q: Why am I getting XmlValueDisconnectedException when I try to change an 
 XmlObject?
 
 A: The most likely cause is that the XmlObject is an orphan; i.e., it has 
 become disassociated from the XML store.  This can happen if you get a 
 reference to an object (perhaps by fetching the first item in an array), 
 delete the item from the tree (perhaps by calling the array remove method on 
 element 0), and then try to invoke methods on that reference or any of its 
 child elements.  You cannot even invoke the toString() method on an orphaned 
 object!  If you need to keep a deleted object, make a copy before you delete 
 it. For example:
 
   LineItem nl = 
 LineItem.Factory.parse(p.getLineItemArray(0).toString());
   p.removeLineItem(0);
 
 
 Credit this to Paul Gillen and also the people who posted to a thread in 2006:
 
 http://mail-archives.apache.org/mod_mbox/xmlbeans-user/200602.mbox/%3c99479f4d39c9244f8e17e688193a3dd8407...@repbex02.amer.bea.com%3E
 -
 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



XmlBeans Wiki

2013-08-21 Thread Cezar Andrei
Several people tried to edit the XMLbeans wiki pages. Only the people in
ContributorsGroup are allowed to edit because of spam reasons.

Please respond to this thread if you want to be added to the this list.

Cezar


-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: Converting from using scomp to SchemaTypeLoader.parse(...)

2013-01-30 Thread Cezar Andrei
Hi,

This is supported, but it's on the advanced list of usages of XmlBeans.

Your best option is to parse the schema files and corectly create the
SchemaTypeSystem. See documentation
http://xmlbeans.apache.org/docs/2.0.0/guide/conIntroToTheSchemaTypeSystem.html
 and previous discussions  on this list, for example:
http://www.mail-archive.com/user@xmlbeans.apache.org/msg01864.html
http://www.mail-archive.com/user@xmlbeans.apache.org/msg03173.html

From it you'll be able to find all the info you'll have in the schema.
We use it to do the validation or the generation of the java source also
editors can use this info for error detecting and completion.


Cezar


On Tue, 2013-01-15 at 05:55 -0800, badger mailinglist wrote:
 Thanks Paul and Jacob, I guess I didn't quite read through the
 tutorials far enough. It's all working now I'm *actually* compiling
 the xsd.
 
 Thanks again,
 
 Badger.
 
 
 On 14 January 2013 23:27, Paul Gillen paul.d.gil...@gmail.com wrote:
 Boy, I wish I got paid for this crap.
 
  
 
 Full answer here:
 
 http://www.oracle.com/technetwork/articles/entarch/incremental-compilation-xmlbeans-089127.html
 
  
 
 In your first example you had compiled your schema and created
 an object to describe parsed XML.
 
  
 
 In you second example you parsed the XSD, which is after all
 XML, and, surprise, it’s described by W3C XSD.
 
  
 
 What you want to do, and I would be interested in hearing why,
 is to compile the XSD on the fly.
 
  
 
 The output of the example below is:
 
 D=TestSchema
 
 D=schema@http://www.w3.org/2001/XMLSchema
 
 D=TestSchema
 
 where the first is your first example, the second is your
 second example, and the third is from compiling the XSD on the
 fly.
 
  
 
 Hope this helps.
 
  
 
 Cheers,
 
 Paul
 
  
 
 package com.riveralph;
 
  
 
 import java.io.File;
 
  
 
 import noNamespace.TestSchemaDocument;
 
  
 
 import org.apache.xmlbeans.SchemaTypeLoader;
 
 import org.apache.xmlbeans.SchemaTypeSystem;
 
 import org.apache.xmlbeans.XmlBeans;
 
 import org.apache.xmlbeans.XmlObject;
 
 import org.apache.xmlbeans.XmlOptions;
 
 import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
 
  
 
 public class TestSchema {
 
   public static void main(String[] args) throws Exception
 {
 
 TestSchema ts = new TestSchema();
 
 ts.go(args);
 
   }
 
  
 
   private void go(String[] args) throws Exception {
 
 {
 
   XmlObject instance =
 TestSchemaDocument.Factory.newInstance(new XmlOptions());
 
   System.out.println(instance.schemaType());
 
 }
 
  
 
 {
 
   SchemaTypeLoader loader =
 
 XmlBeans.typeLoaderForClassLoader(SchemaDocument.class.getClassLoader());
 
   XmlObject instance = loader.parse(new
 File(xsd/testschema.xsd),null, new XmlOptions());
 
   System.out.println(instance.schemaType());
 
 }
 
  
 
 {
 
   XmlObject[] schemaObj = new XmlObject[]
 { XmlObject.Factory.parse(new File(xsd/testschema.xsd))};
 
   SchemaTypeSystem schemaTypeObj =
 XmlBeans.compileXmlBeans(null, null, schemaObj, null, null,
 null, null);
 
   XmlObject instance =
 schemaTypeObj.newInstance(schemaTypeObj.documentTypes()[0],
 null);
 
   System.out.println(instance.schemaType());
 
 }
 
  
 
   }
 
 }
 
  
 
  
 
 From: badger mailinglist
 [mailto:badger.mailing.l...@gmail.com] 
 Sent: Monday, January 14, 2013 6:35 AM
 To: user@xmlbeans.apache.org
 Subject: Re: Converting from using scomp to
 SchemaTypeLoader.parse(...)
 
  
 
 Ok, so I guess no one has ever tried this.
 
 Maybe there's a simpler question:
 
 If I 

Re: MyDocument can't be cast to MyDocumentImpl?

2013-01-30 Thread Cezar Andrei
Hi Michael,

To me it seems you might have 2 different jars around for the same
schema or some classloader issue. I would just make sure first it does
run correctly from command line.

Cezar


On Tue, 2012-12-11 at 13:39 -0800, Michael Bishop wrote:
 Hello all,
 
 I'm experiencing a weird issue in trying to load documents in
 XMLBeans.  I'm working with a NetBeans platform application and we use
 XMLBeans extensively throughout the application.  This issue is a
 first for me and I'm not sure how to proceed.
 
 I have an object that stores XML data as a String.  So, elsewhere in
 my application, I have something like this:
 
 MyDocument doc = MyDocument.Factory.newInstance();
 ... // populate stuff here.
 String myText = doc.xmlText();
 
 Elsewhere in my application, I want to validate that the String I'm
 receiving is indeed a valid instance of that document:
 
 // Shortened for brevity's sake.
 public boolean isValid(final String input) {
 try {
 MyDocument.Factory.Parse(input);
 return true;
 } catch (Exception ex) {
 }
 
 return false;
 }
 
 I get this perplexing error:
 
 java.lang.ClassCastException: myPackage.impl.MyDocumentImpl cannot be
 cast to myPackage.MyDocument
 
 So, I put the whole thing in a unit test.  I made a document, wrote it
 to a String, then parsed it again.  It works in a unit test.  So there
 must be something going wrong with the environment in my application.
 Unfortunately, I don't know what that is, nor how to troubleshoot.
 Here's what I know:
 
 - The XMLBeans data is in a single module.  There should be no
 duplicate classes.
 - I checked the ClassLoader of the MyDocument and MyDocumentImpl
 classes.  They're the same.
 - I load/edit/save other XMLBeans documents throughout the application
 without issue.
 - The string data is stored as child text in another XML element.
 This may be relevant:
 
 String xmlText = myDocument.xmlText();
 myOtherElement.setStringValue(xmlText);
 ...
 String textToValidate = myOtherElement.getStringValue();
 MyDocument.Factory.Parse(textToValidate);
 
 Could this be mangling the structure?  It looks fine when I log the
 value.
 
 Anyway, further suggestions would be great.
 
 Michael



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: XmlBeans dependency for XMLBeans-XPath

2012-10-31 Thread Cezar Andrei
This should be fixed now. About the repository question: did you try
using http://repo.maven.apache.org/maven2/org/apache/xmlbeans/ ?

Cezar

On Tue, 2012-10-30 at 02:33 -0700, Cyrille P. wrote:
 Hi Cezar,
 
 There is the same bug for xmlbeans-xpath 2.5.0
 I'm wondering which is the correct maven repository for xmlbeans project?
  - There is a maven repository where xmlbeans 2.6.0 is released but there is
 only source and jar, the pom file is missing :
 http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.apache.xmlbeans%22%20AND%20a%3A%22xmlbeans%22
 Central Repository 
  - And another one where the latest release is the 2.5.0: 
 http://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans MVN
 Repository 
 
 Regards,
 Cyrille Peninou
 
 
 Cezar Andrei-3 wrote:
  
  Cyrille,
  
  You found a bug, the correct dependency is xmlbeans 2.6.0. I'll fix it.
  
  Cezar
  
  On Thu, 2012-10-25 at 06:47 -0700, Cyrille P. wrote:
  Hi,
  
  Using XmlBeans on a Maven project, I would like to know if it's correct
  that
  xmlbeans-xpath 2.6.0 , has xmlbeans 2.4.0 in dependency and not the 2.6.0
  version ?
  
  Here the pom.xml dependency declaration for xmlbeans-xpath 2.6.0:
  
  dependencies
  dependency
  groupIdorg.apache.xmlbeans/groupId
  artifactIdxmlbeans/artifactId
  version2.4.0/version
  /dependency
  dependency
  groupIdnet.sf.saxon/groupId
  artifactIdsaxon/artifactId
  version9/version
  /dependency
  /dependencies
  
  Thanks in advance,
  Cyrille P.
  
  
  
  -
  To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
  For additional commands, e-mail: user-h...@xmlbeans.apache.org
  
  
  



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: XmlBeans dependency for XMLBeans-XPath

2012-10-29 Thread Cezar Andrei
Cyrille,

You found a bug, the correct dependency is xmlbeans 2.6.0. I'll fix it.

Cezar

On Thu, 2012-10-25 at 06:47 -0700, Cyrille P. wrote:
 Hi,
 
 Using XmlBeans on a Maven project, I would like to know if it's correct that
 xmlbeans-xpath 2.6.0 , has xmlbeans 2.4.0 in dependency and not the 2.6.0
 version ?
 
 Here the pom.xml dependency declaration for xmlbeans-xpath 2.6.0:
 
 dependencies
 dependency
 groupIdorg.apache.xmlbeans/groupId
 artifactIdxmlbeans/artifactId
 version2.4.0/version
 /dependency
 dependency
 groupIdnet.sf.saxon/groupId
 artifactIdsaxon/artifactId
 version9/version
 /dependency
 /dependencies
 
 Thanks in advance,
 Cyrille P.



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



[VOTE RESULT] XMLBeans v2.6.0-RC3 to become official release

2012-08-14 Thread Cezar Andrei
With 8 positive votes: 3 binding and 5 non -binding, RC3 files will
become XMLBeans 2.6.0 official release.

Release files and website will become available in the next few of days.

Thanks for the support and effort of everyone involved,
Cezar


-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: [VOTE] XMLBeans v2.6.0-RC3 to become official release

2012-08-13 Thread Cezar Andrei
Not that I'm aware of, but we always welcome contributions. Saxon was
always hard to keep up to date because it's APIs always have been a
moving target.

Cezar

On Sat, 2012-08-11 at 02:49 -0700, Pascal Heus wrote:
 Thanks Cezar. BTW, is there any plan to support the latest version of
 Saxon-HE (particularly now that the package is publicly available
 through Maven)?
 best
 *P
 
 On 8/10/12 2:02 PM, Cezar Andrei wrote:
  Pascal,
 
  Thanks for the support, the list of changes can be found in CHANGES.txt:
  http://svn.apache.org/viewvc/xmlbeans/trunk/CHANGES.txt?view=markup
 
  Cezar
 
 
  On Wed, 2012-08-08 at 20:30 -0700, Pascal Heus wrote:
  Cezar:
  We're extensively using the package and welcome an update. This
  definitely has my vote (but it's non-binding)
  BTW, is there a full list of changes available?
  thanks
  *P
 
  On 8/8/12 8:33 PM, Cezar Andrei wrote:
  Because I didn't receive any votes, I'm extending the vote period until
  end of next Monday, August 13.
 
  Cezar
 
  On Wed, 2012-08-08 at 17:07 -0700, Cezar Andrei wrote:
  The files are now up at http://xmlbeans.apache.org/dist/ please do send
  your votes.
 
  Thanks,
  Cezar
 
  On Thu, 2012-08-02 at 11:04 -0700, Cezar Andrei wrote:
  The files are not here: http://xmlbeans.apache.org/dist/ yet, they
  should get sync-ed soon. I'll send an update when they're up.
 
  In the meantime, you can find the same files here:
  http://apache.org/~cezar/xmlbeans-2.6.0/
 
  Cezar
 
 
  On Thu, 2012-08-02 at 10:46 -0700, Cezar Andrei wrote:
  Please cast your vote for the XMLBeans v2.6.0-RC3, as published at
  http://xmlbeans.apache.org/dist/ to become XMLBeans v2.6.0 official
  release.
 
   
 
  The vote will be open until end of day Monday, August 6. Anyone is
  allowed to show support or lack of it, but only XMLBeans committer 
  votes
  are binding.
 
   
 
  [ ]  +1  -  I am in favor of this release, and can help
 
  [ ]  +0  -  I am in favor of this release, but cannot help
 
  [ ]  -0  -  I am not in favor of this release
 
  [ ]  -1  -  I am against this proposal (must include a reason) 
 
   
 
 
 
 
 
  My vote is:
 
  [X]  +1  -  I am in favor of this release, and can help
 
   
 
  Cezar 
 
 
 
  -
  To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org
  For additional commands, e-mail: dev-h...@xmlbeans.apache.org
 
 
  -
  To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org
  For additional commands, e-mail: dev-h...@xmlbeans.apache.org
 
 
  -
  To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org
  For additional commands, e-mail: dev-h...@xmlbeans.apache.org
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
  For additional commands, e-mail: user-h...@xmlbeans.apache.org
 
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
  For additional commands, e-mail: user-h...@xmlbeans.apache.org
 
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
  For additional commands, e-mail: user-h...@xmlbeans.apache.org
 
 
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: [VOTE] XMLBeans v2.6.0-RC3 to become official release

2012-08-08 Thread Cezar Andrei
The files are now up at http://xmlbeans.apache.org/dist/ please do send
your votes.

Thanks,
Cezar

On Thu, 2012-08-02 at 11:04 -0700, Cezar Andrei wrote:
 The files are not here: http://xmlbeans.apache.org/dist/ yet, they
 should get sync-ed soon. I'll send an update when they're up.
 
 In the meantime, you can find the same files here:
 http://apache.org/~cezar/xmlbeans-2.6.0/
 
 Cezar
 
 
 On Thu, 2012-08-02 at 10:46 -0700, Cezar Andrei wrote:
  Please cast your vote for the XMLBeans v2.6.0-RC3, as published at
  http://xmlbeans.apache.org/dist/ to become XMLBeans v2.6.0 official
  release.
  
   
  
  The vote will be open until end of day Monday, August 6. Anyone is
  allowed to show support or lack of it, but only XMLBeans committer votes
  are binding.
  
   
  
  [ ]  +1  -  I am in favor of this release, and can help
  
  [ ]  +0  -  I am in favor of this release, but cannot help
  
  [ ]  -0  -  I am not in favor of this release
  
  [ ]  -1  -  I am against this proposal (must include a reason) 
  
   
  
  
  
  
  
  My vote is:
  
  [X]  +1  -  I am in favor of this release, and can help
  
   
  
  Cezar 
  
  
  
  -
  To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org
  For additional commands, e-mail: dev-h...@xmlbeans.apache.org
  
 
 
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: dev-h...@xmlbeans.apache.org
 



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: [VOTE] XMLBeans v2.6.0-RC3 to become official release

2012-08-08 Thread Cezar Andrei
Because I didn't receive any votes, I'm extending the vote period until
end of next Monday, August 13.

Cezar

On Wed, 2012-08-08 at 17:07 -0700, Cezar Andrei wrote:
 The files are now up at http://xmlbeans.apache.org/dist/ please do send
 your votes.
 
 Thanks,
 Cezar
 
 On Thu, 2012-08-02 at 11:04 -0700, Cezar Andrei wrote:
  The files are not here: http://xmlbeans.apache.org/dist/ yet, they
  should get sync-ed soon. I'll send an update when they're up.
  
  In the meantime, you can find the same files here:
  http://apache.org/~cezar/xmlbeans-2.6.0/
  
  Cezar
  
  
  On Thu, 2012-08-02 at 10:46 -0700, Cezar Andrei wrote:
   Please cast your vote for the XMLBeans v2.6.0-RC3, as published at
   http://xmlbeans.apache.org/dist/ to become XMLBeans v2.6.0 official
   release.
   

   
   The vote will be open until end of day Monday, August 6. Anyone is
   allowed to show support or lack of it, but only XMLBeans committer votes
   are binding.
   

   
   [ ]  +1  -  I am in favor of this release, and can help
   
   [ ]  +0  -  I am in favor of this release, but cannot help
   
   [ ]  -0  -  I am not in favor of this release
   
   [ ]  -1  -  I am against this proposal (must include a reason) 
   

   
   
   
   
   
   My vote is:
   
   [X]  +1  -  I am in favor of this release, and can help
   

   
   Cezar 
   
   
   
   -
   To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org
   For additional commands, e-mail: dev-h...@xmlbeans.apache.org
   
  
  
  
  -
  To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org
  For additional commands, e-mail: dev-h...@xmlbeans.apache.org
  
 
 
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: dev-h...@xmlbeans.apache.org
 



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: XMLBeans 2.6.0-RC3

2012-08-02 Thread Cezar Andrei
Thanks Jerry. I'll send out a vote momentarily to make RC3 the final
2.6.0 release.

Cezar

On Mon, 2012-07-30 at 08:47 -0700, jerry...@oracle.com wrote:
 Hi Cezar,
 
 rc3 passed all WLS tests.
 
 Jerry
 
 On 07/23/2012 01:48 PM, Cezar Andrei wrote:
  RC3 is now up at the same location. Please send your comments.
 
  Cezar
 
  On Thu, 2012-07-19 at 13:00 -0700, Cezar Andrei wrote:
  Hello everybody,
 
  RC2 is up, please give it a try and let us know if you find any problems:
  http://people.apache.org/~cezar/xmlbeans-2.6.0/
 
  Cezar
 
  -
  To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
  For additional commands, e-mail: user-h...@xmlbeans.apache.org
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



[VOTE] XMLBeans v2.6.0-RC3 to become official release

2012-08-02 Thread Cezar Andrei
Please cast your vote for the XMLBeans v2.6.0-RC3, as published at
http://xmlbeans.apache.org/dist/ to become XMLBeans v2.6.0 official
release.

 

The vote will be open until end of day Monday, August 6. Anyone is
allowed to show support or lack of it, but only XMLBeans committer votes
are binding.

 

[ ]  +1  -  I am in favor of this release, and can help

[ ]  +0  -  I am in favor of this release, but cannot help

[ ]  -0  -  I am not in favor of this release

[ ]  -1  -  I am against this proposal (must include a reason) 

 

 

 

My vote is:

[X]  +1  -  I am in favor of this release, and can help

 

Cezar 



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: [VOTE] XMLBeans v2.6.0-RC3 to become official release

2012-08-02 Thread Cezar Andrei
The files are not here: http://xmlbeans.apache.org/dist/ yet, they
should get sync-ed soon. I'll send an update when they're up.

In the meantime, you can find the same files here:
http://apache.org/~cezar/xmlbeans-2.6.0/

Cezar


On Thu, 2012-08-02 at 10:46 -0700, Cezar Andrei wrote:
 Please cast your vote for the XMLBeans v2.6.0-RC3, as published at
 http://xmlbeans.apache.org/dist/ to become XMLBeans v2.6.0 official
 release.
 
  
 
 The vote will be open until end of day Monday, August 6. Anyone is
 allowed to show support or lack of it, but only XMLBeans committer votes
 are binding.
 
  
 
 [ ]  +1  -  I am in favor of this release, and can help
 
 [ ]  +0  -  I am in favor of this release, but cannot help
 
 [ ]  -0  -  I am not in favor of this release
 
 [ ]  -1  -  I am against this proposal (must include a reason) 
 
  
 
 
 
 
 
 My vote is:
 
 [X]  +1  -  I am in favor of this release, and can help
 
  
 
 Cezar 
 
 
 
 -
 To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: dev-h...@xmlbeans.apache.org
 



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



XMLBeans 2.6.0-RC3

2012-07-23 Thread Cezar Andrei
RC3 is now up at the same location. Please send your comments.

Cezar

On Thu, 2012-07-19 at 13:00 -0700, Cezar Andrei wrote:
 Hello everybody,
 
 RC2 is up, please give it a try and let us know if you find any problems:
 http://people.apache.org/~cezar/xmlbeans-2.6.0/
 
 Cezar


-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: EntityResolver not getting called...?

2012-02-07 Thread Cezar Andrei
David,

This sounds strange, I checked the code, the resolver is used. Just make
sure you don't have XmlOptions.setLoadUseDefaultResolver ().

You can also give a try using ResolverUtil.resolverForCatalog().

Cezar

On Wed, 2012-01-04 at 01:29 -0800, David Svanberg wrote:
 Hi, my problem is that I have legacy XSD Schemas (won't fix) that
 import other schemas using a non-comformant URI as the schemaLocation
 that I want to compile using XmlBeans.compileXsd (using XmlBeans
 2.5.0). An example import could look like:
 
 xs:import namespace=http://www.example.org; schemaLocation=..\..\My
 Documents/
 
 Please notice that the schemaLocation has no file:// prefix and
 includes both backslashes and spaces.
 
 I thought I could use an own EntityResolver to fix the paths but I'm
 not able to get it working. I've tested:
 
 XmlOptions xmlOpts = new XmlOptions();
 xmlOpts.setEntityResolver(new MyEntityResolver());
 SchemaTypeSystem sts = XmlBeans.compileXsd(new XmlObject[]
 {xmlObject}, XmlBeans.getBuiltinTypeSystem(), xmlOpts);
 
 But the the resolveEntity method of my MyEntityResolver is never
 beeing called although the javadoc states:
 
 If this option is set when compiling a schema, then the given
 EntityResolver will be consulted in order to resolve any URIs while
 downloading imported schemas. EntityResolvers are currently only used
 by compileXsd; they are not consulted by other functions, for example,
 parse. This will likely change in the future.
 
 The problem must of course be that the schemaLocation is not an URI
 and hence there is an exception somewhere before the resolveEntity is
 getting called. But I want it to consult my resolveEntity before doing
 any URI-checks...
 
 Am I missing something? How could I proceed or work-around the bad
 schemaLocations?
 
 Regards,
 David
 



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: Insert xml contents from one xml to another

2012-02-07 Thread Cezar Andrei
Looks like you need to read this:
http://xmlbeans.apache.org/docs/2.0.0/guide/conNavigatingXMLwithCursors.html

Cezar


On Wed, 2012-01-04 at 11:22 -0800, Account forum wrote:
 Hi All,
 I have a requirement where in I need to read a xml file (file 1) and
 insert somewhere in the middle of another xml file(File 2) using xml
 beans and xmlcursors. 
 
 
 Actually, what I am doing is, I am opening a docx file and getting the
 document.xml inside it, and parsing it using xmlbeans. After parsing,
 I am searching the place holders string, and replacing with runtime
 values. Now I have a requirement, where i need to place the content of
 another xml file (read from a docx file ) inside the source file, as a
 replacement for the place holder.
 
 
 So all I need to some sample code to replace the xml inside another
 xml node using xml cursor/xmlbeans . 
 Thanks in advance.



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: Using get after set

2011-09-16 Thread Cezar Andrei
Jason,

If you're schema contains 'myCustomNumber' element that your Book class
should have get/add/set methods for it and you just use them
accordingly.

If it doesn't you can still add it, it's a little more complicated, you
need to use the XmlCursor interface. See following link for how to use
XmlCursors:
http://xmlbeans.apache.org/docs/2.0.0/guide/conNavigatingXMLwithCursors.html .

Cezar

On Mon, 2011-09-12 at 13:50 -0400, Jason Berk wrote:
 I need to do something like this:
 
 BookDoc booksDoc = BooksDoc.Factory.parse(xml, validationOptions);
 Book book = bookDoc.getBook();
 for (Author author:book.getAuthors()) {
   book.setMyCustomNumber(5);
   // how do I save this so the save method below gets a book
 object where the myCustomNumber field is set?
 }
 bookDao.save(book.getAuthors());  //book.getAuthors() is returning books
 without a custom number
 
 what do I need to do so get()'s return the values I just set()
 
 is this even possible?
 
 Jason
 
 This is a transmission from Purdue Federal Credit Union (Purdue Federal) and 
 is intended solely for its authorized recipient(s), and may contain 
 information that is confidential and or legally privileged. If you are not an 
 addressee, or the employee or agent responsible for delivering it to an 
 addressee, you are hereby notified that any use, dissemination, distribution, 
 publication or copying of the information contained in this email is strictly 
 prohibited. If you have received this transmission in error, please notify us 
 by telephoning (765)497-3328 or returning the email. You are then instructed 
 to delete the information from your computer. Thank you for your cooperation.
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: Docs for 2.5.0 not (yet?) hosted on xmlbeans.apache.org

2011-06-24 Thread Cezar Andrei
Jeff, maybe I'm wrong but there were no public API changes in 2.5.0, so the 
2.5.0 docs would be the same as 2.4.0.

Cezar

On Jun 24, 2011, at 1:40 PM, Jeff Martin wrote:

 The latest hosted docs are http://xmlbeans.apache.org/docs/2.4.0/.  But
 2.5.0 was released Dec 2009.  Will xmlbeans.apache.org be updated to
 host the 2.5.0 docs?
 
 -- Jeff
 
 
 
 
 
 
 CONFIDENTIALITY NOTICE: The information contained in this message may be 
 privileged and/or confidential. If you are not the intended recipient, or 
 responsible for delivering this message to the intended recipient, any 
 review, forwarding, dissemination, distribution or copying of this 
 communication or any attachment(s) is strictly prohibited. If you have 
 received this message in error, please notify the sender immediately, and 
 delete it and all attachments from your computer and network.
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 


-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: Why is scomp trying to access remote url without -dl option set?

2011-06-23 Thread Cezar Andrei
What you get is exactly what we were expecting, from my knowledge we use a 
single resolver for all imports.
I wouldn't file a bug if you can't reproduce it anymore, but if you feel 
strongly about it go ahead.

Cezar

On Jun 22, 2011, at 2:16 PM, Jeff Martin wrote:

 Good news and bad news.
 
 I can't reproduce the exact conditions, since I don't have control 
 over www.w3.org and so I can't force the 503 for 
 http://www.w3.org/2001/xml.xsd
 
 So instead I wrote the following my.xsd:
 
  xs:schema
  xmlns:xs=http://www.w3.org/2001/XMLSchema;
  xmlns:c=my:common 
xs:import namespace=my:common
schemaLocation=http://netjeff.com/always503.cgi; /
xs:element name=My
  xs:complexType
xs:sequence
  xs:element ref=c:Common /
/xs:sequence
  /xs:complexType
/xs:element
  /xs:schema
 
 When I run scomp *without* the -dl option, scomp seems to behave 
 correctly:
 
  $ scomp -out my.jar my.xsd
 
  my.xsd:6:3: error: Could not load resource 
  http://netjeff.com/always503.cgi; (network downloads disabled).
  my.xsd:12:9: error: src-resolve: element 'Common@my:common' not found.
  Time to build schema type system: 3.097 seconds
  BUILD FAILED
 
 So that is good news that scomp *without* -dl seems to work, as seen 
 in the network downloads disabled portion of the error message.  
 But then why was scomp spitting out an error when www.w3.org was 
 returning 503, as I described below?  
 
 Since I can't force www.w3.org to return 503, I set up a page on my 
 personal server (netjeff.com) to always return 503, and set that as 
 the schemaLocation (see above).  Then I ran *with* -dl option to see 
 what the error looks like:
 
  $ scomp -dl -out my.jar my.xsd
 
  IO Error java.io.IOException: Server returned HTTP response code: 503
  for URL: http://netjeff.com/always503.cgi
  my.xsd:6:3: error: java.io.IOException: Server returned HTTP response 
  code: 503 for URL: http://netjeff.com/always503.cgi
  my.xsd:12:9: error: src-resolve: element 'Common@my:common' not found.
  Time to build schema type system: 3.396 seconds
  BUILD FAILED
 
 Note that the error above *with* -dl set looks very different from the 
 error when www.w3.org was returning 503:
 
  [ERROR] java.lang.RuntimeException: java.lang.RuntimeException: 
  org.apache.ws.commons.schema.XmlSchemaException: 
  Server returned HTTP response code: 503 for URL:
  http://www.w3.org/2001/xml.xsd
 
 Since the error messages looks so different, maybe the issue has 
 nothing to do with the -dl option? Could scomp be hardcoded such 
 that scomp always try to fetch http://www.w3.org/2001/xml.xsd 
 regardless of the -dl option?
 
 I'm still concerned that if www.w3.org returns 503 during a build, 
 my build will be blocked (regardless of -dl).  Should I still log 
 an issue with Jira, since I can't actually reproduce?
 
 -- Jeff
 
 
 
 -Original Message-
 From: Cezar Andrei [mailto:cezar.and...@oracle.com] 
 Sent: Wednesday, June 22, 2011 11:25 AM
 To: user@xmlbeans.apache.org
 Subject: Re: Why is scomp trying to access remote url without -dl option
 set?
 
 Jeff,
 
 This looks like a bug if it really happens, can you please make a small
 repro which shows the problem all the time and file it under Jira?
 
 Cezar
 
 
 
 On Jun 22, 2011, at 12:21 PM, Jeff Martin wrote:
 
 I've been using scomp successfully for years (currently XMLBeans
 2.4.0).
 
 Recently I got the following error:
 
 $ scomp -d genDir -src genDir -javasource 1.5 -out my.jar \
 my.xsd my.xsdconfig
 {...snip...}
 [ERROR] java.lang.RuntimeException: java.lang.RuntimeException: 
 org.apache.ws.commons.schema.XmlSchemaException: 
 Server returned HTTP response code: 503 for URL:
 http://www.w3.org/2001/xml.xsd
 
 Why was/is scomp trying to retrieve http://www.w3.org/2001/xml.xsd?
 
 According to the scomp help, scomp should never try to download 
 anything  over the network unless you explicitly set -dl option:
  -dl - permit network downloads for imports and includes (default is
 off)
 
 I'm *NOT* using the -dl switch, so why was/is scomp trying to 
 download this file?
 
 Fortunately, the web server at http://www.w3.org stopped returning
 503, 
 and my builds now work again.  But I don't want to be dependent on 
 internet resources at build time.   Why was/is scomp trying to fetch 
 any remote resource without the -dl option set?
 
 -- Jeff
 
 
 
 
 
 
 
 CONFIDENTIALITY NOTICE: The information contained in this message may be 
 privileged and/or confidential. If you are not the intended recipient, or 
 responsible for delivering this message to the intended recipient, any 
 review, forwarding, dissemination, distribution or copying of this 
 communication or any attachment(s) is strictly prohibited. If you have 
 received this message in error, please notify the sender immediately, and 
 delete it and all attachments from your computer and network.
 
 -
 To unsubscribe

Re: Conflict When Having Two XMLBean Generated classes for the same Schema...

2011-06-23 Thread Cezar Andrei
Best way to avoid this problem is to have different target namespaces for your 
schemas, or same target namespace but without conflicts.

If you can't do that next is to manage the jars/classes in different 
classloaders like Kevin suggested.

If this is not possible, at least use different java package names for the two 
files (see .sconfig files), but there are limitations about this, is you start 
with xml/schema names you'll always get the resources from the first jar on the 
classpath.

Cezar

On Jun 23, 2011, at 12:46 PM, Kevin Krouse wrote:

 If you have schemas that define components in the same namespace you'll need 
 to isolate the generated schema jars using classloaders.  The issue is 
 similar to trying to load two different java classes with the same name.
 
 Kevin
 
 
 On Thu, Jun 16, 2011 at 7:35 AM, Horst Heistermann 
 horst.heisterm...@oracle.com wrote:
 Hi,
 
  I am having an issue in my environment because I have two XMLBean generated 
 classes pointing to the same schema. Sometimes when I use the factory of one 
 class
 it tries to create an instance of the other XMLBean class (even though I am 
 using the factory of the class I want to create!).  This causes a 
 classcastexeception
 
 Is there a way to avoid this? The issue is indeterminate because it works 
 fine most of the time but once in a while this issue crashes the program
 
 Thanks,
 
 Horst
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 
 



Re: execQuery: No query engine found

2011-06-22 Thread Cezar Andrei
Henrique,

The main problem is that Saxon is changing the API quite often, this implies 
that without a lot of sustained effort we can't follow all versions.

To find out the exact combination of Saxon and XMLBeans versions the best way 
is to check the XMLbeans svn log. Also look into XMLBeans' build.xml, just sear 
h for saxon.

Cezar
 

On Jun 21, 2011, at 11:22 AM, Henrique wrote:

 Hi all.
 
 I'm aware this is a recurrent problem but I haven't, for the best of my 
 abilities, been able to understand what's going on.
 
 I'm running XMLBeans 2.4.0, from the Maven repo and when I'm trying to make a 
 selectQuery on a XmlObject I get the No query engine found.
 
 Now I've tried with Saxon 9.3.0.4j and 8.8.0.7j and both fail. I'm certain 
 that the saxon*.jar is in the classpath. What else can I do?
 I've thought about downgrading XMLBeans to 2.2 or something... would this be 
 worth it? If so, what version of the xmlbeans-maven-plugin should I use 
 (currently 2.3.3)?
 
 Thanks,
 Henrique Nunes


-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: Why is scomp trying to access remote url without -dl option set?

2011-06-22 Thread Cezar Andrei
Jeff,

This looks like a bug if it really happens, can you please make a small repro 
which shows the problem all the time and file it under Jira?

Cezar



On Jun 22, 2011, at 12:21 PM, Jeff Martin wrote:

 I've been using scomp successfully for years (currently XMLBeans 2.4.0).
 
 Recently I got the following error:
 
  $ scomp -d genDir -src genDir -javasource 1.5 -out my.jar my.xsd
 my.xsdconfig
  {...snip...}
  [ERROR] java.lang.RuntimeException: java.lang.RuntimeException: 
  org.apache.ws.commons.schema.XmlSchemaException: 
  Server returned HTTP response code: 503 for URL:
 http://www.w3.org/2001/xml.xsd
 
 Why was/is scomp trying to retrieve http://www.w3.org/2001/xml.xsd?
 
 According to the scomp help, scomp should never try to download anything
 over 
 the network unless you explicitly set -dl option:
-dl - permit network downloads for imports and includes (default is
 off)
 
 I'm *NOT* using the -dl switch, so why was/is scomp trying to download
 this file?
 
 Fortunately, the web server at http://www.w3.org stopped returning 503,
 and my 
 builds now work again.  But I don't want to be dependent on internet
 resources at 
 build time.   Why was/is scomp trying to fetch any remote resource
 without 
 the -dl option set?
 
 -- Jeff
 
 
 
 
 
 CONFIDENTIALITY NOTICE: The information contained in this message may be 
 privileged and/or confidential. If you are not the intended recipient, or 
 responsible for delivering this message to the intended recipient, any 
 review, forwarding, dissemination, distribution or copying of this 
 communication or any attachment(s) is strictly prohibited. If you have 
 received this message in error, please notify the sender immediately, and 
 delete it and all attachments from your computer and network.
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 


-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



Re: How can I replace xml-fragment to my own value like Return

2011-03-11 Thread Cezar Andrei
Shadab,

You are using an instance of an xmlschema type to serialize your data. You can 
try serializing an instace of a global schema element, i.e. a *Document class. 
Or you can use the setSaveSyntheticDocumentElement() 
http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlOptions.html#setSaveSyntheticDocumentElement(javax.xml.namespace.QName)
 option.

Cezar

On Mar 10, 2011, at 5:49 AM, shadab.g...@jktech.com wrote:

 Hello All,
 
 Please help me out on my problem.
 
 I am new on xmlbeans. when I get Xml using xmlBeans, I get xml like below-
 
 xml-fragment xmlns: * name space *** 
 other tag/
 other tag/
 other tag/
 
 /xml-fragment
 
 while, I want output like this-
 
 Return xmlns: * name space *** 
 other tag/
 other tag/
 other tag/
 /Return
 
 How can i do that. Please reply back to me.
 Many Thanks,
 Shadab
 **
  
 CONFIDENTIALITY. This e-mail and any attachments are confidential and may 
 also be privileged. If you are not the named recipient, please notify the 
 sender immediately and do not disclose the contents to another person, use it 
 for any purpose, or store or copy the information in any medium. Any views 
 expressed in this message are those of the individual sender, except where 
 the sender specifically states them to be the views of JK Technosoft Ltd. If 
 you have received this e-mail in error please immediately notify us at 
 administra...@jktech.com
 
 **



Re: Tips for debugging XML beans - newbie

2011-02-02 Thread Cezar Andrei
Nicholas,

Did you try error.getObjectLocation()? Do you have any more details
about the error?

Cezar



On Fri, 2011-01-28 at 15:48 +0100, Nicholas W wrote:
 Hi All,
  I am having some trouble unmarshalling data generated by a remote
 REST web service (for which I have the XSD.
 
 I have set
 
 log4j.logger.org.apache.xmlbeans = DEBUG
 
 in log4j.properties
 
 and I am using code like:
 
 XmlOptions xmloptions = new XmlOptions();
ArrayList errorList = new ArrayList();
xmloptions.setErrorListener(errorList);
 
 FindObjectsResponseDocument f =
 FindObjectsResponseDocument.Factory.parse(xmlresult,xmloptions);
 
 boolean valid = f.validate();
 if (!valid) {
  for (int i = 0; i  errorList.size(); i++)
 {
 XmlError error = (XmlError)errorList.get(i);
   
 System.out.println(\n);
 System.out.println(Message:  + 
 error.getMessage() + \n);
 System.out.println(Location of invalid XML: 
  +
 error.getCursorLocation().xmlText() + 
 \n);
 }
   }
 
 To find out whats going on.
 
 However. Elements are null when they should not be, nothing is
 reported in the logging and the errorList is empty.
 
 I would be greatful if you could point me to some resources to show
 how to debug XMLBeans unmarshalling.
 
 Thanks a lot
 Regards,
 Nicholas W.
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 



-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



RE: XMLBeans enforcement of xs:pattern in simple type?

2010-12-14 Thread Cezar Andrei
Chris,

 

If you check the XMLSchema spec: 

http://www.w3.org/TR/xmlschema-2/#dateTime 3.2.7.1 explains the lexical 
representation of datetime. This '-'?  '-' mm '-' dd 'T' hh ':' mm ':' ss 
('.' s+)? (zz)? is the production that you can restrict in a derived 
restriction. If you don't restrict using that production no instance will match 
it, so you'll have a type with no valid values.

 

As for XMLBeans serializing according to a pattern, it will as long as the 
instance is a valid instance of the defined type.

 

Also check the definition of pattern: 
http://www.w3.org/TR/xmlschema-2/#dt-pattern

 

I hope this helps,

Cezar

  _  

From: Chris Hopkins [mailto:chrishopk...@gmail.com] 
Sent: Tuesday, December 14, 2010 12:10 PM
To: user@xmlbeans.apache.org
Subject: XMLBeans enforcement of xs:pattern in simple type?

 

Hi all -

 

I'm working with a schema that has the following simple type:

 

xs:simpleType name=DateTimeGroupType

xs:annotation

xs:documentationA date time 
group always in Zulu time./xs:documentation

/xs:annotation

xs:restriction base=xs:dateTime

  xs:pattern 
value=^(3[0-1]|2[0-9]|1[0-9]|0[1-9])(0[0-9]|1[0-9]|2[0-3])([0-5][0-9])\sZ\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s[0-9]{2}$/

/xs:restriction

/xs:simpleType

 

I thought, perhaps naively, that specifying a pattern would force the XMLBeans 
generated classes to validate against that pattern including producing a String 
representation conforming to that pattern when I call getStringValue(). This is 
not the result that I'm getting but perhaps I'm doing something wrong with the 
definition.

 

Does anyone have any insight or experience doing the same thing?

 

Thanks,

Chris


RE: running all junit test

2010-12-13 Thread Cezar Andrei
Raghvendra,

You should do:
  ant checkintest
  ant detailed

And you should also check the test/docs/BuildingAndRunningTests.txt for more 
details.

Cezar

-Original Message-
From: Raghvendra Singh [mailto:rsi...@terracottatech.com] 
Sent: Monday, December 13, 2010 3:16 AM
To: d...@xmlbeans.apache.org; user@xmlbeans.apache.org
Subject: running all junit test

Hi All

I have two questions.

1. I have been hit by this bug 
https://issues.apache.org/jira/browse/XMLBEANS-328
What is the plan to fix this bug, does the patch attache to this jira 
fixes the issue?

2. I have downloaded the source code of xmlbean-2.4.0 and built  it. I 
wanna know is there a way i can run all the junit test of this project 
by some command?

Thanks in advance :)

-Raghvendra Singh




-
To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: dev-h...@xmlbeans.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



RE: XmlCursor.toChild() Ignore Namespace?

2010-12-08 Thread Cezar Andrei
Paul,

 

It looks that you have 3 options:

1)   somehow get the new namespace uri and pass it as parameter - this 
would be the preferred way because namespaces do usually change for a reason 
usually to indicate that they are not backwards compatible

2)   or use the XmlCursors methods toFirstChild() toNextSibling() and test 
the names yourself

3)   or use XmlObject.selectPath(./TrackAndTrace) which is simple enough 
to use the internal XMLBeans XPath implementation.

 

Cezar

 

  _  

From: Brady, Paul [mailto:paul.br...@airnz.co.nz] 
Sent: Wednesday, November 24, 2010 4:13 PM
To: user@xmlbeans.apache.org
Subject: XmlCursor.toChild() Ignore Namespace?

 

Hi,

How can I navigate to a document location using XMLCursor.toChild() without 
supplying a namespace?

 

My current call looks like:

 

XmlCursor documentCursor = myXmlObject.newCursor();

documentCursor.toChild(http://types.mycompany.com/ServiceMetaTypes/1/1;, 
TrackAndTrace);

 

This works fine and the TrackAndTrace element is found as it should be. 

I'd like to insulate the logic from changes to the namespace, e.g. the version 
being incremented to http://types.mycompany.com/ServiceMetaTypes/1/2, by 
ignoring the namespace but following never finds anything.

 

XmlCursor documentCursor = myXmlObject.newCursor();

documentCursor.toChild(TrackAndTrace);

 

I need to use the XMLCursor as opposed to using a query as I don't have a query 
engine available in this particular system. 

 

Any help appreciated.

Good planets are hard to find - please think of the environment before you 
print this email.

CAUTION - This message may contain privileged and confidential 
information intended only for the use of the addressee named above.
If you are not the intended recipient of this message you are hereby 
notified that any use, dissemination, distribution or reproduction 
of this message is prohibited. If you have received this message in 
error please notify Air New Zealand immediately. Any views expressed 
in this message are those of the individual sender and may not 
necessarily reflect the views of Air New Zealand.
_
For more information on the Air New Zealand Group, visit us online
at http://www.airnewzealand.com 
_


RE: [ANN]VTD-XML 2.9

2010-08-24 Thread Cezar Andrei
Jimmy,

 

This is not the right list for these kind of announcements, we're not enforcing 
it, but please have respect for all the people subscribing.

 

Thanks,

Cezar

 

  _  

From: jimmy Zhang [mailto:jzh...@ximpleware.com] 
Sent: Thursday, August 12, 2010 9:33 PM
To: user@xmlbeans.apache.org
Subject: [ANN]VTD-XML 2.9

 

VTD-XML 2.9, the next generation XML Processing API for SOA and Cloud 
computing, has been released. Please visit  HYPERLINK 
wlmailhtml:%7b337D6FBA-0A97-4A74-88E7-1478CBE3B230%7dmid://0796/!x-usc:https://sourceforge.net/projects/vtd-xml/files/https://sourceforge.net/projects/vtd-xml/files/
 to download the latest version.

Strict Conformance 

VTD-XML now fully conforms to XML namespace 1.0 spec 

Performance Improvement

Significantly improved parsing performance for small XML files 

Expand Core VTD-XML API  

Adds getPrefixString(), and toNormalizedString2() 

Cutting/Splitting 

Adds getSiblingElementFragment()  

A number of bug fixes and code enhancement including: 

Fixes a bug for reading very large XML documents on some platforms 
Fixes a bug in parsing processing instruction 
Fixes a bug in outputAndReparse() 


RE: java.lang.OutOfMemoryError: PermGen space

2010-08-24 Thread Cezar Andrei
Michael,

 

The permgen memory contains the class definitions, since you're probably using 
a big number of classes they get loaded into permgen.

You can optimize the size by using custom classloaders with XMLBeans, which 
most likely is more complicated than increasing the permgen size and depends 
very much on the application, but XMLBeans doesn't do this by default. 

 

Cezar

 

  _  

From: as.bausch...@daimler.com [mailto:as.bausch...@daimler.com] 
Sent: Thursday, August 19, 2010 5:01 AM
To: user@xmlbeans.apache.org
Subject: java.lang.OutOfMemoryError: PermGen space

 


Hi,

In our app we have in rare cases the following error:

java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at 
com.teradyne.ds.net.GrUrlClassLoader.defineClass(GrUrlClassLoader.java:321)
at 
com.teradyne.ds.net.GrUrlClassLoader.access$100(GrUrlClassLoader.java:54)
at com.teradyne.ds.net.GrUrlClassLoader$1.run(GrUrlClassLoader.java:265)
at java.security.AccessController.doPrivileged(Native Method)
at 
com.teradyne.ds.net.GrUrlClassLoader.findClass(GrUrlClassLoader.java:258)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at pkg.StepDefsDocumentImpl$StepDefsImpl.getStepDefList(Unknown Source)

Of course we can increase the -XX:MaxPermSize from currently 80M to 128M or 
above, but i'm wondering if there is a possibility to decrease the permGen 
space consumption by finetuning xmlBeans in some way.

We are using XMLGBeans 2.4.0

Kind Regards
Michael

If you are not the intended addressee, please inform us immediately that you 
have received this e-mail in error, and delete it. We thank you for your 
cooperation. 




RE: Removing namespaces at the element level

2010-08-06 Thread Cezar Andrei
Mark,

 

Please take a look at using the save aggressive option when printing/saving the 
document:

http://xmlbeans.apache.org/docs/2.4.0/reference/index.html 

 

Cezar

 

  _  

From: mARK aNDREWS [mailto:mraandr...@gmail.com] 
Sent: Wednesday, August 04, 2010 4:45 AM
To: user@xmlbeans.apache.org
Subject: Removing namespaces at the element level

 

I have been using xmlBeans for a while, and it really has made my life very 
easy, but have come a ccross a problem when looking at performance tuning and 
wondered if anyone new the answer, or can help.

The documents I am passing are very large and I am looking at ways to redice 
the size of what is sent over the wire.  On inspection I noticed that the xml 
produced by xml beans contains the namespace data for each element in the xml:

i.e. 

per:person  xmlns:per=http://www.blah.com/entities/person_v1; 
per:name xmlns:per=http://www.blah.com/entities/person_v1;Bob/per:name
per:origin  
xmlns:per=http://www.blah.com/entities/person_v1;UK/per:origin
per:age  xmlns:per=http://www.blah.com/entities/person_v1;34/per:age
/per:person

What I actually want is something like this:

per:person xmlns:per=http://www.blah.com/entities/person_v1;
per:name Bob/per:name
per:originUK/per:origin
per:age34/per:age
/per:person

Thanx

m/|RK aNDREWS

photos: http://www.flickr.com/photos/mraandrews
twitter:  http://www.twitter.com/mraandrews


RE: java.lang.RuntimeException: No query engine found

2010-07-28 Thread Cezar Andrei
Anil,

You have to make sure that the right jars that implement the XQuery 
functionality are available on the classpath, Saxon or BEA XQuery impl.

Cezar

-Original Message-
From: akonduru [mailto:anilkond...@gmail.com] 
Sent: Monday, July 12, 2010 10:35 PM
To: user@xmlbeans.apache.org
Subject: java.lang.RuntimeException: No query engine found


Hi,

need a help, i am changing XmlBean implementation from BEA Weblogic 8.1
xbean.jar to com.bea.core.xml.xmlbeans_2.2.0.0.jar as we are upgrading
weblogic version to 10.3 from 8.1, though updated required jars for XmlBean
2.2.0 version, getting the below error.

java.lang.RuntimeException: No query engine found
at
org.apache.xmlbeans.impl.store.Query.getCompiledQuery(Query.java:120)
at
org.apache.xmlbeans.impl.store.Query.getCompiledQuery(Query.java:53)
at
org.apache.xmlbeans.impl.store.Query.cursorExecQuery(Query.java:48)
at
org.apache.xmlbeans.impl.store.Cursor._execQuery(Cursor.java:1336)
at
org.apache.xmlbeans.impl.store.Cursor._execQuery(Cursor.java:1331)


Code:

 XmlObject defaultConfig =
configXml.execQuery($this/.//e...@name='default']/logging/*)[0];

thanks,
Anil.
-- 
View this message in context: 
http://old.nabble.com/java.lang.RuntimeException%3A-No-query-engine-found-tp29146340p29146340.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



RE: Cannot get CDATA to work

2010-06-09 Thread Cezar Andrei
Chirstofer,

 

Did you try the example in the javadoc?

http://xmlbeans.apache.org/docs/2.4.0/reference/org/apache/xmlbeans/XmlOptions.html#setUseCDataBookmarks()

 

Cezar

 

  _  

From: Christopher Cheng [mailto:christopher.sw.ch...@gmail.com] 
Sent: Tuesday, June 01, 2010 4:57 AM
To: user@xmlbeans.apache.org
Subject: Re: Cannot get CDATA to work

 

After digging into the codes, I found out that StaxUtils is responsible to 
decide whether it's 'CHARACTER' or 'CDATA'. The XMLStreamReader used is 
'com.sun.xml.fastinfoset.stax.StAXDocumentParser'.

It looks like that after XMLBeans passed the XMLDocument to StAXDocumentParser, 
at line 381 of StAXDocumentParser could not determine whether it is plain 
CHARACTER eventType of CDATA eventType.

 

My quick fix is to add the followings to copy(XMLStreamReader reader, 
XMLStreamWriter writer, boolean fragment) of StaxUtils. It's ugly, I know, so 
hope somebody could fix it.

 

case XMLStreamConstants.CHARACTERS:

if (reader.getText().startsWith(![CDATA[)  
reader.getText().endsWith(]])) {

String text = reader.getText();

writer.writeCData(text.substring(![CDATA[.length(), 
text.length() - ]].length()));

}

else {

writer.writeCharacters(reader.getText());

}

break;

 

On Mon, May 31, 2010 at 11:40 PM, Christopher Cheng HYPERLINK 
mailto:christopher.sw.ch...@gmail.comchristopher.sw.ch...@gmail.com wrote:

I went thru a few posts in this list, but still no luck to get CATA to work. I 
am using xmlbeans version 2.4.

What's wrong with the followings?

 

node.setKey(ABCDEFG);

XmlCursor c = node.xgetKey().newCursor();

c.toFirstContentToken();

c.setBookmark(CDataBookmark.CDATA_BOOKMARK);

System.out.println(node);

 

 

 


RE: problems adding namespace to a schema generated in code

2010-06-09 Thread Cezar Andrei
Hi Alexander,

1) On the schema element, you need to get a cursor: XmlObject.getCursor() and 
use the method: XmlCursor.insertNamespace ( String prefix, String namespace )

2) You can allways look at how scomp is implemented: 
org.apache.xmlbeans.impl.tool.SchemaCompiler which is a now standard way, or 
use the API:

import java.util.ArrayList;
import java.util.List;

import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
import org.apache.xmlbeans.XmlError;
import org.apache.xmlbeans.XmlOptions;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlBeans;
import org.apache.xmlbeans.XmlObject;

public class MySchemaCompile
{

// your schema here
private static String SCHEMA = ?xml version=\1.0\ 
encoding=\UTF-8\?\n +
xsd:schema xmlns:xsd=\http://www.w3.org/2001/XMLSchema\\n; +
   elementFormDefault=\qualified\\n +
   attributeFormDefault=\unqualified\ \n +
   targetNamespace=\http://foo/\\n; +
   xmlns:foo=\http://foo/\;\n +
\n +
xsd:element name=\bar\ type=\xsd:string\ /\n  
\n +
/xsd:schema;


public static void main(String[] args)
{
try
{
SchemaDocument schemaDoc = SchemaDocument.Factory.parse(SCHEMA);

// check it is valid
System.out.println(= is valid? - +schemaDoc.validate());

// compile
System.out.println(= compiling?);
compile(schemaDoc);

System.out.println(END);
}
catch (Exception e)
{
System.out.println(ERROR);
e.printStackTrace();
}
}

private static void compile(SchemaDocument schemaDoc) throws Exception
{
XmlOptions options = new XmlOptions();
ListXmlError errors = new ArrayListXmlError();
options.setErrorListener(errors);
options.setCompileNoAnnotations();
options.setValidateTreatLaxAsSkip();
options.setLoadLineNumbers();

// compile
XmlBeans.compileXsd(new XmlObject[] { schemaDoc }, 
XmlBeans.getBuiltinTypeSystem(), options);

// check validation errors
for(XmlError error : errors)
{
if (error.getSeverity() == XmlError.SEVERITY_ERROR)
{
throw new XmlException(error.getMessage(), null, errors);
}
}
}
}

I hope this helps.

Cezar

-Original Message-
From: Alexander Kampmann [mailto:campino_a...@gmx.de] 
Sent: Monday, May 31, 2010 10:26 AM
To: user@xmlbeans.apache.org
Subject: problems adding namespace to a schema generated in code

hi there, 

i'm using the org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument (and 
related) classes to create a xml- schema in code. 
It works well and I can write the schema to a file, but there are two problems: 

1) I can't figure out how to add something like xmlns:tns=... to my schema- 
Element. Setting the target namespace works, but the schema is invalid without 
that attribute. 

2) By now I write the schema to a file and start scomp using 
Runtime.getDefaultRuntime().exec(), but in my eyes it would be nicer to start 
the compilation from my program directly. Is there a way to do so? I have had a 
look at the scomp- sources, but I didn't get wise from it. 

Thanks for your advice, 

Alex
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



RE: Bad performance using multiple threads

2010-06-09 Thread Cezar Andrei
Choel,

There are two types of locks in XMLBeans: 
 - a global lock that is used only on operations involving two documents in 
different locales are used
 - a local lock, per locale, by default each new doc gets its locale, using 
options same locale can be used for more docs)

Even for read operations because it involves state, there is a need for a lock 
to be used.

But for your case, which seems so performance oriented, if you know what you 
do, you can try using unsynchronized documents (use option when creating your 
doc), but you need to handle the synchronization separately.

Cezar

-Original Message-
From: choel [mailto:ch...@gmx.de] 
Sent: Wednesday, May 26, 2010 12:29 PM
To: user@xmlbeans.apache.org
Subject: Bad performance using multiple threads


Hi,

to improve the performance I started parallelizing (simple fork and join)
some tasks.
After testing the correctness of the output I found the performance on the
parallel tasks extremely bad.
In my testcase it is actually 4 times slower as normal single threaded
usage. I am using a standard dual core cpu running two threads parallel.
Is there anything known on bad multithreading performance using xmlbeans? In
my case there is a lot parallel reading on the same data. Readlocks are for
my usage not neccessary.
Thanks in advance for some help.

Here is some performance data:
1 Thread on dual core:
Creating graph with 2407 nodes, took: 375 ms
Routing 3170 connections, took: 31610 ms

4 Threads on dual core:
Creating graph with 601 nodes, took: 250 ms
Creating graph with 601 nodes, took: 266 ms
Creating graph with 604 nodes, took: 282 ms
Creating graph with 601 nodes, took: 282 ms
Routing 794 connections, took: 57172 ms
Routing 792 connections, took: 59625 ms
Routing 792 connections, took: 60469 ms
Routing 792 connections, took: 60485 ms

Bye Claus

-- 
View this message in context: 
http://old.nabble.com/Bad-performance-using-multiple-threads-tp28683839p28683839.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



RE: two similar xsd in the same wsdl databinded with xmlbean in axis2

2010-01-20 Thread Cezar Andrei
Bartolomeo,

It depends if the schemas collide, i.e. they have the same target namespace and 
are using the same local names for global types, elements, attributes etc.

Maybe _9 version is backwards compatible with _8, i.e. instances of _8 are 
valid under _9 schema, if this is the case you're lucky, and only need to work 
with _9 version.

If they do collide and are not compatible, you can still handle both of them 
with XMLBeans but you need to provide the knowledge when to use one or the 
other and the code becomes much more complicated.

Cezar

 -Original Message-
 From: Bartolomeo Nicolotti [mailto:bnicolo...@siapcn.it]
 Sent: Thursday, January 14, 2010 9:43 AM
 To: user@xmlbeans.apache.org
 Subject: two similar xsd in the same wsdl databinded with xmlbean in axis2
 
 Hello,
 
 we're using xmlbean to parse xmls as an axis2 databinding for travel
 industries web services
 
 A web service we query has different version of the same kind of xml
 
 AirAvailability_8
 AirAvailability_9
 
 
 Is it possible to use xmlbean data binding with only one wsdl that has
 both the kind of xml, i.e. something like:
 
 ...
   s:include schemaLocation=AirAvailability_8.xsd/
   s:include schemaLocation=AirAvailability_9.xsd/
 
 s:element name=SubmitXml
 s:complexType
 s:sequence
 s:element maxOccurs=1 minOccurs=0 name=Profile type=s:string/
 s:element maxOccurs=1 minOccurs=0 name=Request
 s:complexType
 s:sequence
 s:element maxOccurs=1 minOccurs=0
 name=LocalDateTimeCT_6_0  type=s0:LocalDateTimeCT_6_0Type/
 s:element maxOccurs=1
 minOccurs=0 name=AirAvailability_8
 type=s0:AirAvailability_8Type/
 s:element maxOccurs=1
 minOccurs=0 name=AirAvailability_9
 type=s0:AirAvailability_9Type/
 /s:sequence
 /s:complexType
 /s:element
 /s:sequence
 /s:complexType
 /s:element
 
 
 My doubt is that this two kinds of xml have, oviously many similiar
 tags, won't these conflict?
 
 Many many thanks
 
 Best regards.
 
 Bartolomeo Nicolotti.
 
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 

-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



RE: Xmlbeans is able to retrieve extra attribute from xml ?

2009-12-23 Thread Cezar Andrei
Sebastien,

 

It is possible, please check the XmlCursor interface. On the xmlbeans object 
you have the attributes, call:

XmlCursor xc = xobj.getCursor(); . Move the cursor around with 
xc.toFirstAttribute(); xc.toNextAttribute();

And get info on the current token, in your case the attribute: xc.getName 
xc.getTextValue, and when you're done call xc.dispose().

 

Cezar

 

  _  

From: Sebastien Dionne [mailto:survivan...@gmail.com] 
Sent: Wednesday, December 23, 2009 7:10 AM
To: user@xmlbeans.apache.org
Subject: Xmlbeans is able to retrieve extra attribute from xml ?

 

I have a simple question.

I have a xsd standard (string..no complextype).

I receive xml message that can contains extra attributes that are not in the 
xsd.

With JAXB they are put into 

    /**
 * Gets a map that contains attributes that aren't bound to any typed 
property on this class.
 * 
 * p
 * the map is keyed by the name of the attribute and 
 * the value is the string value of the attribute.
 * 
 * the map returned by this method is live, and you can add new attribute
 * by updating the map directly. Because of this design, there's no setter.
 * 
 * 
 * @return
 * always non-null
 */
    public MapQName, String getOtherAttributes() {
    return otherAttributes;
    }

but is it possible to do something similar with xmlbeans ?

It a showstopper if I can't do that.

thanks


-- 
-
A+

Sébastien.

Vous pouvez me suivre sur Twitter / You can follow me on Twitter : 
http://twitter.com/survivant


RE: Xmlbeans is able to retrieve extra attribute from xml ?

2009-12-23 Thread Cezar Andrei
It's probably because the document is not a well formed XML document.

 

Cezar

 

  _  

From: Sebastien Dionne [mailto:survivan...@gmail.com] 
Sent: Wednesday, December 23, 2009 11:17 AM
To: user@xmlbeans.apache.org
Subject: Re: Xmlbeans is able to retrieve extra attribute from xml ?

 

thanks, but why do I obtain a exception CDATA when I parse a xml that contains 
more data then the schema ?

RootDocument root = RootDocument.Factory.parse(new File(./src/test/resources/

RootDevice.xml));
System.out.println(root.toString());

Exception in thread main org.apache.xmlbeans.XmlException: error: Unexpected 
element: CDATA
    at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3486)
    at org.apache.xmlbeans.impl.store.Locale.parse(Locale.java:712)





2009/12/23 Cezar Andrei HYPERLINK 
mailto:cezar.and...@oracle.comcezar.and...@oracle.com

Sebastien,

 

It is possible, please check the XmlCursor interface. On the xmlbeans object 
you have the attributes, call:

XmlCursor xc = xobj.getCursor(); . Move the cursor around with 
xc.toFirstAttribute(); xc.toNextAttribute();

And get info on the current token, in your case the attribute: xc.getName 
xc.getTextValue, and when you're done call xc.dispose().

 

Cezar

 

  _  

From: Sebastien Dionne [mailto:HYPERLINK mailto:survivan...@gmail.com; 
\nsurvivan...@gmail.com] 
Sent: Wednesday, December 23, 2009 7:10 AM
To: HYPERLINK mailto:user@xmlbeans.apache.org; \nu...@xmlbeans.apache.org
Subject: Xmlbeans is able to retrieve extra attribute from xml ?

 

I have a simple question.



I have a xsd standard (string..no complextype).

I receive xml message that can contains extra attributes that are not in the 
xsd.

With JAXB they are put into 

    /**
 * Gets a map that contains attributes that aren't bound to any typed 
property on this class.
 * 
 * p
 * the map is keyed by the name of the attribute and 
 * the value is the string value of the attribute.
 * 
 * the map returned by this method is live, and you can add new attribute
 * by updating the map directly. Because of this design, there's no setter.
 * 
 * 
 * @return
 * always non-null
 */
    public MapQName, String getOtherAttributes() {
    return otherAttributes;
    }

but is it possible to do something similar with xmlbeans ?

It a showstopper if I can't do that.

thanks


-- 
-
A+

Sébastien.

Vous pouvez me suivre sur Twitter / You can follow me on Twitter : 
http://twitter.com/survivant




-- 
-
A+

Sébastien.

Vous pouvez me suivre sur Twitter / You can follow me on Twitter : 
http://twitter.com/survivant


[VOTE RESULTS] XMLBeans v2.5.0-RC1 to become official release

2009-12-14 Thread Cezar Andrei
The vote is closed now, thank you for your votes.

 

After five +1 and three +0 votes, of which five binding, RC1 becomes the 
official XMLBeans v2.5.0 release.

 

Please allow the next few days for files to become available on the 
distribution sites and for the website update.

 

Big thanks to all participants that made this release possible.

 

 

Cezar Andrei

 

 

  _  

From: Cezar Andrei 
Sent: Wednesday, December 09, 2009 11:23 AM
To: d...@xmlbeans.apache.org
Cc: user@xmlbeans.apache.org
Subject: [VOTE] XMLBeans v2.5.0-RC1 to become official release

 

Please cast your vote for the XMLBeans v2.5.0-RC1, as published at 
http://xmlbeans.apache.org/dist/, to become XMLBeans v2.5.0 official release.

 

The vote will be open until end of day Saturday, 12th of December. Anyone is 
allowed to show support or lack of it, but only XMLBeans committer votes are 
binding.

 

[ ]  +1  -  I am in favor of this release, and can help

[ ]  +0  -  I am in favor of this release, but cannot help

[ ]  -0  -  I am not in favor of this release

[ ]  -1  -  I am against this proposal (must include a reason) 

 

 

 

My vote is:

[X]  +1  -  I am in favor of this release, and can help

 

Cezar 


[VOTE] XMLBeans v2.5.0-RC1 to become official release

2009-12-09 Thread Cezar Andrei
Please cast your vote for the XMLBeans v2.5.0-RC1, as published at 
http://xmlbeans.apache.org/dist/, to become XMLBeans v2.5.0 official release.

 

The vote will be open until end of day Saturday, 12th of December. Anyone is 
allowed to show support or lack of it, but only XMLBeans committer votes are 
binding.

 

[ ]  +1  -  I am in favor of this release, and can help

[ ]  +0  -  I am in favor of this release, but cannot help

[ ]  -0  -  I am not in favor of this release

[ ]  -1  -  I am against this proposal (must include a reason) 

 

 

 

My vote is:

[X]  +1  -  I am in favor of this release, and can help

 

Cezar 


RE: [Release Candidate] XMLBeans 2.5.0-RC1

2009-12-08 Thread Cezar Andrei
There seems to be no problems, except from the missing src.zip file which I'll 
copy shortly. I'll follow up with the VOTE email.

In the meantime, please do check it in your environment.

 

Thank you,

Cezar

 

  _  

From: Cezar Andrei 
Sent: Wednesday, November 25, 2009 5:25 PM
To: d...@xmlbeans.apache.org
Cc: user@xmlbeans.apache.org
Subject: [Release Candidate] XMLBeans 2.5.0-RC1

 

Hello everyone,

 

The first release candidate for XMLBeans 2.5.0 is available at:

http://xmlbeans.apache.org/dist/

 

Please give it a try and let us know if there are any problems with it.

 

Thank you,

Cezar Andrei


RE: Processing schema instances

2009-12-04 Thread Cezar Andrei
David,

You're correct the classes in org.apache.xmlbeans.impl.xb.xsdschema are the 
classes XMLBeans uses internally to load up xsd files. They are just compiled 
xbeans of schema4schemas xsd, (because of this bootstrap is required) but you 
can use them directly. 

Those classes will help you deal with .xsd files in XML sense, but it seems you 
need to ask schema specific questions. For this you'll have to compile (use 
XMLBeans.compileXsd() ) the xsd files into a TypeSystem and than using the 
TypeSystem/SchemaType interfaces you can ask schema related questions (see java 
doc and articles linked from XMLBeans website).

Cezar

 -Original Message-
 From: M. David Allen [mailto:dmal...@mitre.org]
 Sent: Wednesday, December 02, 2009 12:14 PM
 To: user@xmlbeans.apache.org
 Subject: Processing schema instances
 
 
 I'm trying to use XMLBeans to process schema instances (that is, actual
 schema files).  I've found that XMLBeans seems to have the types baked in
 to
 do this, via org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
 SchemaDocument doc = SchemaDocument.Factory.parse(relative);
 
 So that works.  But I'm not finding any javadocs for these classes as they
 look like internals that might not have been meant for XMLBeans users.
 
 I need to ask questions of a schema instance such as, which types are
 derived from somepref:FooType? and to get a list of all elements a schema
 defines, with their corresponding types.
 
 Using XMLBeans to process schemas like they were any other document (i.e.
 conforming to the XML schema schema) seemed like the way to go.  Is there
 a
 different API I should be checking to do this?
 
 Thanks
 --
 View this message in context: http://old.nabble.com/Processing-schema-
 instances-tp26613672p26613672.html
 Sent from the Xml Beans - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 

-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



RE: AW: changeType to type with fewer element

2009-11-17 Thread Cezar Andrei
Oliver,

 

That's the thing, changeType does change the schema type assigned to that node 
and returns a new java object of a different class but it doesn't change the 
structure of the document. What you're looking for can be done programmatically 
since all the info is available in the schema types but to make it work 
correctly for all the type is no easy job.

 

Cezar 

 

  _  

From: Oliver Pfau [mailto:oliver.p...@scalaris.com] 
Sent: Tuesday, November 17, 2009 3:55 AM
To: user@xmlbeans.apache.org
Subject: AW: changeType to type with fewer element

 

Hi Cezar,

 

imagine the following: a complex type Top is existing and an inherited 
complex type Sub from Top is existing. Sub does extend Top with a string 
value Something.

If I do the following:

 

Top topsub = Top.Factory.newInstance();

topsub.changeType(Sub.type);

topsub.setSomething(a value only for sub);

topsub.changeType(Top.type));

boolean isValid = topsub.validate();

 

 

isValid will be false, because topsub is at the end of type Top but the xml 
output defines the something element of sub. My expectation is that the 
changeType(Top.type) will cause that the something element will be ignored and 
not unmarshalled to xml and validation.

 

Regards,

Oliver

 

 

 

  _  

Von: Cezar Andrei [mailto:cezar.and...@oracle.com] 
Gesendet: Montag, 16. November 2009 21:45
An: user@xmlbeans.apache.org
Betreff: RE: changeType to type with fewer element

Oliver,

 

I'm not sure what is your question, but you have to keep in mind that 
validation is run only when validate() method is invoked. 

Especially when it is structure related operations modifying the document don't 
keep the document valid. Most of the time a document has to go through a series 
of invalid states to become valid again. XMLBeans' user cooperation is required 
to attain document's validity after modifications.

 

Cezar

 

  _  

From: Oliver Pfau [mailto:oliver.p...@scalaris.com] 
Sent: Friday, November 13, 2009 7:03 AM
To: user@xmlbeans.apache.org
Subject: changeType to type with fewer element

 

Hi,

 

it seems that XmlBeans is generating invalid xml when I change the type to a 
type with fewer elements. There is an example with abstract conrete types on 
the XmlBeans homepage called AbstractTypes. In the file AbstractTypes.java 
there is this section:

 

...

Circle circle = (Circle) s1.changeType(Circle.type);
circle.setRadius(10.0);

...

 

s1 is a shape (more common). If the type of circle is changed to a more common 
type, the radius is nevertheless set for the Shape type. The Validation of the 
changed circle to a Shape will fail, because the radius is existing in the xml 
event though the xsi:type is correct. The xml and the java representation seems 
to be here out of sync. Isn't it ? Or is there a trick ?

 

Regards,

Oliver

 


RE: ClasscastException - XmlAnyTypeImpl cannot be cast to - Error

2009-11-16 Thread Cezar Andrei
I'm not familiar with Spring Marshaller, but it seems that the source is not 
parsed in the schema context you expect.

Also you can declare your response an XmlObject and use changeType method.

Cezar

 -Original Message-
 From: pattabi [mailto:pattabiraman.meenakshisunda...@aig.com]
 Sent: Monday, November 16, 2009 10:55 AM
 To: user@xmlbeans.apache.org
 Subject: ClasscastException - XmlAnyTypeImpl cannot be cast to - Error
 
 
 Hi,
 I searched the forum and googled but could not get a solution. hence
 posting
 it.
 
 I am using Spring Marshaller with xmlbeans 2.4. In the bean config file, I
 am just defined the XmlbeansMarshaller with no properties set.
 
 I am accessing it this way:
 ResDecisionServiceType  response = (ResDecisionServiceType)
 unmarshaller.unmarshal(source);
 
 and am getting the following error:
 org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be cast to
 decisionserviceapp.ResDecisionServiceType.
 
 Please help.
 Thanks
 
 
 --
 View this message in context: http://old.nabble.com/ClasscastException---
 XmlAnyTypeImpl-cannot-be-cast-to---Error-tp26375379p26375379.html
 Sent from the Xml Beans - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 

-
To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
For additional commands, e-mail: user-h...@xmlbeans.apache.org



RE: changeType to type with fewer element

2009-11-16 Thread Cezar Andrei
Oliver,

 

I'm not sure what is your question, but you have to keep in mind that 
validation is run only when validate() method is invoked. 

Especially when it is structure related operations modifying the document don't 
keep the document valid. Most of the time a document has to go through a series 
of invalid states to become valid again. XMLBeans' user cooperation is required 
to attain document's validity after modifications.

 

Cezar

 

  _  

From: Oliver Pfau [mailto:oliver.p...@scalaris.com] 
Sent: Friday, November 13, 2009 7:03 AM
To: user@xmlbeans.apache.org
Subject: changeType to type with fewer element

 

Hi,

 

it seems that XmlBeans is generating invalid xml when I change the type to a 
type with fewer elements. There is an example with abstract conrete types on 
the XmlBeans homepage called AbstractTypes. In the file AbstractTypes.java 
there is this section:

 

...

Circle circle = (Circle) s1.changeType(Circle.type);
circle.setRadius(10.0);

...

 

s1 is a shape (more common). If the type of circle is changed to a more common 
type, the radius is nevertheless set for the Shape type. The Validation of the 
changed circle to a Shape will fail, because the radius is existing in the xml 
event though the xsi:type is correct. The xml and the java representation seems 
to be here out of sync. Isn't it ? Or is there a trick ?

 

Regards,

Oliver

 


RE: Output dateTime in canonical form

2009-10-09 Thread Cezar Andrei
Anirban,

 

Did you look at GDateBuilder, specifically at using normalizeToTimeZone methods?

 

Cezar

 

  _  

From: Anirban Mukherjee [mailto:amukh...@gmail.com] 
Sent: Saturday, September 12, 2009 3:12 PM
To: user@xmlbeans.apache.org
Subject: Output dateTime in canonical form

 

I wish to generate xml output where xs:dateTime values will be generated in the 
canonical form rather than the natural form 

e.g. instead of 2009-10-13T01:11:17+05:30, I need 2009-10-12T19:41:17Z 
(converted to UTC with Z indicating that it is UTC)

Is there a straightforward way to achieve this ?

The GDate class has a canonicalString() method that produces the form I need, 
but the toString() produces the natural form. 

Note: If input xml contains dateTime values in the canonical form, they are 
processed properly.

As an experiment, I tried to inherit a subclass from GDate with the intent of 
overriding toString() to invoke super.canonicalString() but the GDate class is 
final and hence cannot be extended. 
But even that would probably not have worked as the XmlDateTime would probably 
not care about the canonical form. Refer below...
[
GDate gdt = new GDate(cal);
XmlDateTime dt = XmlDateTime.Factory.newInstance();
dt.setGDateValue(gdt);
sig.xsetExpirationDateTime(dt);
...
...
doc.save...
]

Any help would be appreciated.


Thanks,
Anirban


RE: [xmlbeans] Dynamically renaming an element in XmlObject?

2009-09-09 Thread Cezar Andrei
Hi,

 

Take a look at the XmlCursor interface, with it you have low level access to 
the xml representation, you can create/modify instances that don't have a 
schema definition.

 

Renaming elements is not possible, but in your case, you can create a new doc 
with one element AAA and than copy the contents of your original employee 
element, ending up with the document you're looking for.

 

Cezar

 

  _  

From: sol myr [mailto:solmy...@yahoo.com] 
Sent: Wednesday, September 09, 2009 10:28 AM
To: user@xmlbeans.apache.org
Subject: [xmlbeans] Dynamically renaming an element in XmlObject?

 

Hi,

 

Given some XmlObject, is it possible to dynamically rename its root XML element?

Details: 

 

1) I have and XSD with ComplexType:

complexType name=Employee

   element name=salary type=string/

/complexType

 

2) I need to create an XmlObjects, but dynamically rename its root XML tag.

I wish I could just write:

XmlObject e1=Employee.Factory.newInstance();

e.setSalary(1000);

e.setRootXmlTag(AAA);  // Wishful thinking - not a real code

// Now e.xmlText() should be: AAAsalary1000/salary/AAA

 

3) I know that if the xml tag name (AAA) is known in advance, I can declare 
an XSD Element:

element name=AAA type=EmployeeType/

And XmlBeans will easily generate corresponding XmlObjects, with AAA root.

 

4) But what if the xml tag name is totally dynamic (e.g. extracted at runtime 
from a user's request)? Is there any way for me to control the XML tag name?

 

Thanks very much.

 


RE: Maven and XMLBeans, not best friends??

2009-08-06 Thread Cezar Andrei
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



[POOL] jdk 1.4 support in next of XMLBeans

2009-05-11 Thread Cezar Andrei
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: Navigating Untyped XmlObject with XmlCursor

2009-03-12 Thread Cezar Andrei
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



RE: OutOfMemoryError receiving Soap Responses using Axis2 and XMLBeans

2009-02-26 Thread Cezar Andrei
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

 

 



FW: [Urgent] Please help promote ApacheCon video streaming!

2008-11-04 Thread Cezar Andrei
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: Xml Element Insertion - Updating Dom Tree

2008-11-03 Thread Cezar Andrei
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.

 



RE: Multiple output files with inst2xsd?

2008-10-24 Thread Cezar Andrei
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

2008-10-24 Thread Cezar Andrei
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

2008-10-24 Thread Cezar Andrei
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: Substitution Groups and Abstract Types

2008-10-03 Thread Cezar Andrei
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

 



FW: Travel Assistance to ApacheCon US 2008 - 3 days to apply!

2008-09-29 Thread Cezar Andrei


-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: question on security..

2008-09-24 Thread Cezar Andrei
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.

2008-09-24 Thread Cezar Andrei
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

2008-09-24 Thread Cezar Andrei
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]



RE: [VOTE RESULT] XMLBeans 2.4.0 Release

2008-07-17 Thread Cezar Andrei
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: NoClassDefFoundError in Eclipse Plugin IDE

2008-06-19 Thread Cezar Andrei
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: ClassCastException when migrating to xmlbeans 2.2.9

2008-06-04 Thread Cezar Andrei
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: Algorithm for saving CDATA blocks in XML Beans 2.2 ?

2008-03-19 Thread Cezar Andrei
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 ?

2008-03-19 Thread Cezar Andrei
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: SchemaType.getSourceName()

2008-02-15 Thread Cezar Andrei
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: is XSD text file stored at all in XMLBeans output?

2008-01-11 Thread Cezar Andrei
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: Large xmldocuments and namespace declarations

2007-12-12 Thread Cezar Andrei
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

2007-12-12 Thread Cezar Andrei
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

2007-12-12 Thread Cezar Andrei
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

2007-12-12 Thread Cezar Andrei
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: type and Java Class

2007-11-30 Thread Cezar Andrei
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: How to generate XPath for XMLObject/XMLCursor?

2007-11-21 Thread Cezar Andrei
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

2007-11-21 Thread Cezar Andrei
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: Import schema for schema aware XQuery

2007-11-14 Thread Cezar Andrei
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

2007-11-14 Thread Cezar Andrei
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: xmlbeans beginner - help

2007-11-06 Thread Cezar Andrei
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: Réf. : RE: Problem with boolean type

2007-10-10 Thread Cezar Andrei
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: How to select the root element

2007-10-05 Thread Cezar Andrei
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: xsdconfig revisited

2007-08-27 Thread Cezar Andrei
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: xsdconfig

2007-08-22 Thread Cezar Andrei
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: 2nd Post. Help! Search and Replace...Re: How to edit data in a specific part of an XMLObject

2007-08-15 Thread Cezar Andrei
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

2007-08-15 Thread Cezar Andrei
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: Problem with output through a weblogic webservice.

2007-08-13 Thread Cezar Andrei
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: object oriented persistence layer?

2007-07-31 Thread Cezar Andrei
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: Forcing namespace prefixes

2007-06-13 Thread Cezar Andrei
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: [RESULTS] [VOTE] XmlBeans 2.3.0 Release

2007-06-04 Thread Cezar Andrei
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: [VOTE] XmlBeans 2.3.0 Release

2007-05-23 Thread Cezar Andrei
[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: [VOTE] XmlBeans 2.3.0 Release

2007-05-18 Thread Cezar Andrei
[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: Validating an atomic type

2007-05-02 Thread Cezar Andrei
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: Next stable release?

2007-05-01 Thread Cezar Andrei
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]



  1   2   >