Re: Wrong namespace prefix in generated documents?

2014-08-18 Thread Michael Bishop
Hi Peter and thanks for the explanation. It's been awhile; I've been on
vacation for a week.

Anyway, I tried what you said about the XPath expressions and it looks like
you're correct. I'm using the Java core XPath libraries and the prefix I
set in an instance of NamespaceContext is what dictates how the expression
is evaluated. So two documents:
xxx:root xmlns:xxx=a/ and yyy:root xmlns:yyy=a/ can both be
successfully queried with //xxx:root as long as the NamespaceContext
object maps the xxx prefix to the a namespace. In short, the
NamespaceContext for the XPath statement takes precedence and the prefixes
in the document are not significant.

Our project produces both a file specification and an application that
helps create specification compliant documents. However, someone could
create their own document outside of the application and use whatever
prefix they wish. So we have to accept different prefixes; a scenario I did
not consider previously.

Our application also exposes APIs and allows users to create plugins, so
they would be able to access the XMLBeans-generated classes directly. We'd
have mismatching prefixes if we used XmlOptions for output that a plugin
developer did not.

Your explanation has helped me understand these issues and when/why
prefixes are/aren't significant and I've been able to write unit tests to
demonstrate the understood behavior.

FWIW, the reason I'm using the Java core libraries for XPath is because I
can't get XMLBeans to do it correctly inside the NetBeans platform.
XMLBeans can't find supporting libraries across module dependencies due to
class path issues; each module has its own class path and XMLBeans only
checks it's own.

Michael




On Fri, Aug 8, 2014 at 6:58 AM, Peter Keller pkel...@globalphasing.com
wrote:

 Hi Michael,

 OK - now this is getting to the heart of the question...

 On Thu, 2014-08-07 at 16:02 -0400, Michael Bishop wrote:
  Hi Peter,
 
  You're right, I came across that table recently since I've been
  working at this problem most of the day. Let me share one more thing
  I've discovered. It appears that XMLBeans has always been ignoring my
  namespace prefixes. In URL form, it will use the last token and in
  URN form, it will use the first:
 
 
  xmlns:aaa=http://test.example.com/TOKEN;
  xmlns:bbb=TOKEN:xxx:yyy:zzz

 I use tag (i.e. RFC4151) URI's, and XMLBeans takes the first token, like
 with URN URI's. Obviously, since all such URI's begin with tag:, it
 can only do this for the first one that it hits. I am lucky, in that I
 don't care :-)

  In other words, the declared (xmlns:...) prefixes above are never
  honored. In both cases, TOKEN will end up being the prefix. I thought
  this had worked before because my old namespace was:
 
 
  xmlns:aaa=http://test.example.com/aaa;
 
 
  Changing the trailing aaa in the URL will change the prefix in the
  generated document.
 
 
  So why do I need the same prefix?
 
 
  Our application is transitioning from version X to version X.1.
  Our customer has requested a namespace change to URN form.
  We have extensive documentation and screen shots that show the old
  prefix.

 Yes, I can see that this is a nuisance.

  We also have XPath statements scattered throughout our application
  that reference the old prefix.

 Looking at the XPath/selectPath example here:
 
 http://xmlbeans.apache.org/docs/2.0.0/guide/conSelectingXMLwithXQueryPathXPath.html
 I don't think that the prefix used in queryExpression needs to be the same
 as in the document, i.e. if you changed the query to this:

  String queryExpression =
  declare namespace xq1='
 http://xmlbeans.apache.org/samples/xquery/employees'; +
  $this/xq1:employees/xq1:employee/xq1:phone[contains(., '(206)')];

 the query should still work, even though the document has xq as the
 prefix. The scope of the prefix declaration here should the query only,
 and it should get mapped to the namespace itself when querying the
 document. I can't remember if I have ever tried this with XMLBeans or
 not, but it works with other XML utilities that I have used. Worth a
 try, maybe?

  It was believed that it would be far less of a hassle to correct the
  prefix than it would to correct all our documentation and XPath
  statements.

 Hm, the problem is that AFAIK nothing in the XSD standard mandates the
 stability of the prefix: it is the namespace name itself that matters.
 From the XSD point of view, any application that treats the prefix as
 data has fragility built-in.

  In our application, when a user creates a new instance of the
  document, it uses Factory.newInstance() which results in a document
  with the wrong namespace.

 I assume that you mean wrong prefix here? The namespace itself should
 be fine.

  Like a lot of other applications (Word, Excel, etc.), our files reside
  in memory until they are saved. So a new document would carry the
  wrong prefix until it was saved.

 Ah, here is the fallacy, I think. When you call 

Re: Wrong namespace prefix in generated documents?

2014-08-08 Thread Peter Keller
Hi Michael,

OK - now this is getting to the heart of the question...

On Thu, 2014-08-07 at 16:02 -0400, Michael Bishop wrote:
 Hi Peter,
 
 You're right, I came across that table recently since I've been
 working at this problem most of the day. Let me share one more thing
 I've discovered. It appears that XMLBeans has always been ignoring my
 namespace prefixes. In URL form, it will use the last token and in
 URN form, it will use the first:
 
 
 xmlns:aaa=http://test.example.com/TOKEN;
 xmlns:bbb=TOKEN:xxx:yyy:zzz

I use tag (i.e. RFC4151) URI's, and XMLBeans takes the first token, like
with URN URI's. Obviously, since all such URI's begin with tag:, it
can only do this for the first one that it hits. I am lucky, in that I
don't care :-)

 In other words, the declared (xmlns:...) prefixes above are never
 honored. In both cases, TOKEN will end up being the prefix. I thought
 this had worked before because my old namespace was:
 
 
 xmlns:aaa=http://test.example.com/aaa;
 
 
 Changing the trailing aaa in the URL will change the prefix in the
 generated document.
 
 
 So why do I need the same prefix?
 
 
 Our application is transitioning from version X to version X.1.
 Our customer has requested a namespace change to URN form.
 We have extensive documentation and screen shots that show the old
 prefix.

Yes, I can see that this is a nuisance.

 We also have XPath statements scattered throughout our application
 that reference the old prefix.

Looking at the XPath/selectPath example here:
http://xmlbeans.apache.org/docs/2.0.0/guide/conSelectingXMLwithXQueryPathXPath.html
 I don't think that the prefix used in queryExpression needs to be the same as 
in the document, i.e. if you changed the query to this:

 String queryExpression =
 declare namespace 
 xq1='http://xmlbeans.apache.org/samples/xquery/employees'; +
 $this/xq1:employees/xq1:employee/xq1:phone[contains(., '(206)')];

the query should still work, even though the document has xq as the
prefix. The scope of the prefix declaration here should the query only,
and it should get mapped to the namespace itself when querying the
document. I can't remember if I have ever tried this with XMLBeans or
not, but it works with other XML utilities that I have used. Worth a
try, maybe?

 It was believed that it would be far less of a hassle to correct the
 prefix than it would to correct all our documentation and XPath
 statements.

Hm, the problem is that AFAIK nothing in the XSD standard mandates the
stability of the prefix: it is the namespace name itself that matters.
From the XSD point of view, any application that treats the prefix as
data has fragility built-in.

 In our application, when a user creates a new instance of the
 document, it uses Factory.newInstance() which results in a document
 with the wrong namespace. 

I assume that you mean wrong prefix here? The namespace itself should
be fine.

 Like a lot of other applications (Word, Excel, etc.), our files reside
 in memory until they are saved. So a new document would carry the
 wrong prefix until it was saved. 

Ah, here is the fallacy, I think. When you call Factory.newInstance(),
the instantiated element doesn't carry a prefix with it as such. As far
as XMLBeans is concerned, the element's QName is
{TOKEN:xxx:yyy:zzz}test, i.e. uses the full namespace string. The
prefix only makes its appearance when you call save or xmlText, and
then you can always suggest the prefix that should be used. If you
added a suitable XmlOptions argument to every call to xmlText in your
application, would that achieve what you are after? Or are you using
XmlCursor or some other lower-level trickery to get at the xmlns
declarations?

 Even after it was saved, it would have to be reloaded by the
 application to have the correct prefix in-memory.

Yes, if replacing every xmlText() call with xmlText(xmlOptions) isn't
feasible, I can't see any way other than save/parse to achieve this.
Using streams or Reader/Writer may be more efficient than writing to a
file and reading it back.

 Our application also has the ability to digitally sign documents.
 Signing one prefix, then saving another causes the signature to break.

I hadn't thought of this scenario, but yes, this is an example of using
the prefix as data.

 So the options are starting to look like this:
 
 1. Figure out why XMLBeans doesn't honor my xmlns:... declarations.
 
 2. Change the namespace URN to start with the desired prefix.
 Obviously, this is a workaround.
 
 3. Use the new prefix and change everything else to suit.
 
 
 So I guess my first question (in this email at least) is does XMLBeans
 ever try to honor xmlns prefix declarations?

As I said, in my understanding there is nothing to honour before
save/xmlText is called. Prefixes only materialise when the element is
serialised. Otherwise, they are only known about externally such as in
declarations in XPath/XQuery expressions.

 If so, what's wrong with the schema I posted that causes this 

Re: Wrong namespace prefix in generated documents?

2014-08-07 Thread Michael Bishop
I've got to figure out how to debug it. Currently, it's in a Maven project
with the XMLBeans plugin running the schema compilation.

The map works when I call save(options) or xmlText(options), but not when
the document is created (Factory.newInstance(options)).

// Option that sets the namespace map.
XmlOptions options = ...;

MyDoc doc = MyDoc.Factory.newInstance(options);

System.out.println(Wrong prefix:  + doc.xmlText());
System.out.println(Right prefix:  + doc.xmlText(options));

The schema is spread out across multiple files. I'm going to try to create
a small test case to see if I can't reproduce this.


On Mon, Aug 4, 2014 at 4:31 PM, Cezar Andrei cezar.and...@oracle.com
wrote:

 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




 

Re: Wrong namespace prefix in generated documents?

2014-08-07 Thread Michael Bishop
OK, here is a test schema:

?xml version=1.0 encoding=UTF-8 ?
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
   xmlns:aaa=bbb:ccc:ddd:eee:fff:aaa
   targetNamespace=bbb:ccc:ddd:eee:fff:aaa
   elementFormDefault=qualified

xs:element name=test type=aaa:testType/

xs:complexType name=testType
xs:sequence
xs:element name=name type=xs:string minOccurs=1
maxOccurs=1/
xs:element name=uuid type=xs:string minOccurs=1
maxOccurs=1/
xs:element name=version type=xs:string minOccurs=1
maxOccurs=1/
xs:element name=created type=xs:string minOccurs=1
maxOccurs=1/
xs:element name=createdBy type=xs:string minOccurs=1
maxOccurs=1/
xs:element name=modified type=xs:string minOccurs=1
maxOccurs=1/
xs:element name=modifiedBy type=xs:string minOccurs=1
maxOccurs=1/
xs:element name=description type=xs:string minOccurs=0
maxOccurs=1/
/xs:sequence
xs:attribute name=version type=xs:string use=required/
/xs:complexType
/xs:schema

TestDocument doc = TestDocument.Factory.newInstance();
doc.addNewTest();

// Wrong, default Factory output.
doc.xmlText(): bbb:test xmlns:bbb=bbb:ccc:ddd:eee:fff:aaa/

// Correct output that I can't get from just the Factory.newInstance()
method.
doc.xmlText(options): aaa:test xmlns:aaa=bbb:ccc:ddd:eee:fff:aaa/

Does anyone else get the same compilation results? Is there a reason the
new instances won't default to xmlns:aaa as declared? I'd be hard pressed
to believe that something in XMLBeans is causing this. It's probably
something I'm doing. Does the XSDConfig file have any influence that I'm
missing?

Michael Bishop


On Thu, Aug 7, 2014 at 1:22 PM, Michael Bishop bisho...@gmail.com wrote:

 I've got to figure out how to debug it. Currently, it's in a Maven project
 with the XMLBeans plugin running the schema compilation.

 The map works when I call save(options) or xmlText(options), but not when
 the document is created (Factory.newInstance(options)).

 // Option that sets the namespace map.
 XmlOptions options = ...;

 MyDoc doc = MyDoc.Factory.newInstance(options);

 System.out.println(Wrong prefix:  + doc.xmlText());
 System.out.println(Right prefix:  + doc.xmlText(options));

 The schema is spread out across multiple files. I'm going to try to create
 a small test case to see if I can't reproduce this.


 On Mon, Aug 4, 2014 at 4:31 PM, Cezar Andrei cezar.and...@oracle.com
 wrote:

 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 

Re: Wrong namespace prefix in generated documents?

2014-08-07 Thread Peter Keller
Hi Michael,

There is a table in the Javadocs that states which options are used by
which methods: see
http://xmlbeans.apache.org/docs/2.6.0/reference/org/apache/xmlbeans/XmlOptions.html.
 You have to make the prefix suggestion in the options to a save or xmlText 
method: they won't have any effect in a newInstance method. What you have 
observed here is expected and documented.

Maybe I'm missing something, but I can't think of any scenario where
this is going to cause any problems. If you really need the prefix to be
a particular string before you get to the stage of writing or saving the
XML document, perhaps you could explain why? Then we might be able to
think of other ways to solve the issue.

Regards,
Peter.

On Thu, 2014-08-07 at 13:53 -0400, Michael Bishop wrote:
 OK, here is a test schema:
 
 ?xml version=1.0 encoding=UTF-8 ?
 xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema;
xmlns:aaa=bbb:ccc:ddd:eee:fff:aaa
targetNamespace=bbb:ccc:ddd:eee:fff:aaa
elementFormDefault=qualified
 
 xs:element name=test type=aaa:testType/
 
 xs:complexType name=testType
 xs:sequence
 xs:element name=name type=xs:string minOccurs=1
 maxOccurs=1/
 xs:element name=uuid type=xs:string minOccurs=1
 maxOccurs=1/
 xs:element name=version type=xs:string minOccurs=1
 maxOccurs=1/
 xs:element name=created type=xs:string minOccurs=1
 maxOccurs=1/
 xs:element name=createdBy type=xs:string
 minOccurs=1 maxOccurs=1/
 xs:element name=modified type=xs:string minOccurs=1
 maxOccurs=1/
 xs:element name=modifiedBy type=xs:string
 minOccurs=1 maxOccurs=1/
 xs:element name=description type=xs:string
 minOccurs=0 maxOccurs=1/   
 /xs:sequence
 xs:attribute name=version type=xs:string use=required/
 /xs:complexType
 /xs:schema
 
 
 TestDocument doc = TestDocument.Factory.newInstance();
 doc.addNewTest();
 
 // Wrong, default Factory output.
 doc.xmlText(): bbb:test xmlns:bbb=bbb:ccc:ddd:eee:fff:aaa/
 
 
 // Correct output that I can't get from just the Factory.newInstance()
 method.
 doc.xmlText(options): aaa:test xmlns:aaa=bbb:ccc:ddd:eee:fff:aaa/
 
 
 Does anyone else get the same compilation results? Is there a reason
 the new instances won't default to xmlns:aaa as declared? I'd be hard
 pressed to believe that something in XMLBeans is causing this. It's
 probably something I'm doing. Does the XSDConfig file have any
 influence that I'm missing?
 
 
 Michael Bishop
 
 
 
 On Thu, Aug 7, 2014 at 1:22 PM, Michael Bishop bisho...@gmail.com
 wrote:
 I've got to figure out how to debug it. Currently, it's in a
 Maven project with the XMLBeans plugin running the schema
 compilation.
 
 
 The map works when I call save(options) or xmlText(options),
 but not when the document is created
 (Factory.newInstance(options)).
 
 
 
 // Option that sets the namespace map.
 
 XmlOptions options = ...;
 
 
 MyDoc doc = MyDoc.Factory.newInstance(options);
 
 
 System.out.println(Wrong prefix:  + doc.xmlText());
 
 System.out.println(Right prefix:  + doc.xmlText(options));
 
 
 The schema is spread out across multiple files. I'm going to
 try to create a small test case to see if I can't reproduce
 this.
 
 
 
 On Mon, Aug 4, 2014 at 4:31 PM, Cezar Andrei
 cezar.and...@oracle.com wrote:
 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;
 

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-02 Thread Michael Bishop
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
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
 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: Wrong namespace prefix in generated documents?

2014-07-31 Thread Duane Zamrok
The short answer is to use XmlOptions to configure the prefixes used in your 
XmlBeans output. Something like the following will cause it to use xxx for 
yyy:aaa:bbb:ccc. XmlBeans output is NOT tied to the prefixes you declare in 
your schema.

HashMap ns = new HashMap();
ns.put(yyy:aaa:bbb:ccc, xxx);
// ns.put(http://ccc.bbb.aaa;, orig);
// ns.put(urn:some.other.namespace, pfxUwnt);
xmlOptions.setSaveSuggestedPrefixes(ns);

A longer answer is provided here 
http://codebrane.com/blog/2005/12/12/xmlbeans-and-namespaces/

From: Michael Bishop [mailto:bisho...@gmail.com]
Sent: Monday, July 28, 2014 2:28 PM
To: user@xmlbeans.apache.org
Subject: Wrong namespace prefix in generated documents?

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


Re: Validation issues

2014-07-21 Thread Peter Keller
Dear Joseph,

On Wed, 2014-07-16 at 10:15 -0700, jgagnon wrote:
 I have written an application that generates XML files that represent test
 cases for a collection of types defined by an XML schema.  Some of these
 types contain elements that are abstract.  The logic locates all concrete
 implementers of the abstract type and when an instance is generated,
 processes one of the concrete types in place of the abstract type.
 
 It's my understanding that the element must have a type reference attribute
 that indicates the concrete type name.  So, as an example:
 
 ...
   SomeElement xsi:type=ConcreteType
 ... content ...
   /SomeElement
 ...
 
 The schema defines the SomeElement field as being defined by an abstract
 type.  ConcreteType is one of many possible concrete implementers of that
 abstract type.
 
 To take this a little further, a namespace entry is made in the document
 that defines a prefix for the schema types.  So, in the root element there
 would be entry like:
 
 Root xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:myPrefix=http://my-schema-site/
 
 The prefix is applied to all elements that are defined by the schema.  E.g.
 myPrefix:SomeElement.  I would also assume that the prefix needs to be
 used in the concrete type reference. So, what I have above now becomes:
 
 ...
   SomeElement xsi:type=myPrefix:ConcreteType
 ... content ...
   /SomeElement
 ...
 
 My application does all of this.
 
 I have also added the option to validate the instance once it's been
 generated.  *Here is where the problem enters the story.*  For some reason,
 it fails validation with the complaint:
 
 error: cvc-elt.4.2: Invalid xsi:type qname: 'myPrefix:ConcreteType' in
 element SomeElement@my-schema-site

IIRC XMLBeans implements XMLSchema 1.0 rather than 1.1, so this error
refers to clause 4.2 of this validation rule:

http://www.w3.org/TR/xmlschema-1/#cvc-elt

It looks as if the XML schema definition of myPrefix:ConcreteType is not
found or not accessible. Earlier you wrote:

 The logic locates all concrete implementers of the abstract type

This may be the problem: if by concrete implementers you mean types
defined in Java that simply implement/extend XMLBeans-generated types,
your implementing types have no presence within the schema type system
that XMLBeans generates. You have not stated explicitly whether or not
your concrete types are defined in XML schemata or not. If not, there is
no way that XMLBeans can know about them. If this is what you are doing,
you need to generate additional XML schemata that define your concrete
types (overriding the abstract types that are defined in your existing
XML schema by either restriction or extension). Compile these schemata
and the XMLBeans-generated API should allow you to work with the
concrete types, including instantiating them automatically and correctly
from parsed XML. On output, the xsi:type elements will also be written
automatically by the XMLBeans-generated API without you having to worry
about them.

Alternatively, you could generate your own implementations of
http://xmlbeans.apache.org/docs/2.6.0/reference/org/apache/xmlbeans/SchemaType.html
 and 
http://xmlbeans.apache.org/docs/2.6.0/reference/org/apache/xmlbeans/SchemaTypeSystem.html.
 This seems to me to be a much harder approach, although it may be worthwhile 
if you absolutely have to map existing Java types to XML Schema types.

 Oddly, if I validate the instance externally using XMLBeans validate utility
 (.../xmlbeans-2.6.0/bin/validate), there is no complaint.

Did you do 'validate -strict'?

 Am I doing something wrong?

Without knowing more about what you are doing, it is hard to say. FWIW,
I do something very like this (defining all my concrete types in XML
schemata) and I don't have any validation problems.

Hope that this helps,
Peter.

-- 
Peter Keller Tel.: +44 (0)1223 353033
Global Phasing Ltd., Fax.: +44 (0)1223 366889
Sheraton House,
Castle Park,
Cambridge CB3 0AX
United Kingdom



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



Re: Validation issues

2014-07-21 Thread Peter Keller
On Mon, 2014-07-21 at 05:50 -0700, jgagnon wrote:
 Sorry for the confusion.  My application does not deal with the Java
 implementation of any of the schema types.  It uses the information from the
 schema to determine test cases to generate and then uses the XMLBeans API
 (mainly XmlCursor) to create an XML instance.  Once the instance is complete
 I then validate it via the XmlObject.validate(XmlOptions options) method and
 save the object to a file.

 One of the first things I do is to compile the schema XSD (with
 XmlBeans.compileXsd(...)) to get a SchemaTypeSystem object. This provides me
 with everything else I need.
 
 The schema defines several abstract types, each of which has some number of
 other schema types that extend them (i.e. xs:extension
 base=myPrefix:AbstractBaseType).  As the program works its way through a
 document type to identify and generate test cases, when it encounters an
 element defined by an abstract type, it scans the schema for any types that
 extend that type.  It then generates the element with the type reference
 attribute to point to the specific concrete schema type.

OK - by generates .. with the type reference... do you mean that you
are doing something like this?

  xmlCursor.insertAttributeWithValue(type,
  http://www.w3.org/2001/XMLSchema-instance;,
  myPrefix:ConcreteType);

If so, it seems to me that at this point the XMLBeans API hasn't
associated myPrefix: with your namespace, hence the validation
failure. The cursor methods can only work with attribute values of type
java.lang.String, i.e. as far as I can see the XmlCursor API doesn't
provide a bridge between attribute _values_ and anything related to the
schema. What you actually want to insert as the attribute value is an
instance of javax.xml.namespace.QName or org.apache.xmlbeans.XmlQName
rather than a string, but it doesn't seem that there is a way of doing
that.

When the document is read back in by the command-line validator, it
interprets the value of the xsi:type attribute as a QName, so it
validates OK.

 I also generate
 the child content that is defined by the specific concrete type.
 
 The generation logic inserts the namespace(s) as attributes of the root
 element.  I insert the default namespace (i.e.
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;) and the
 schema-specific namespace (e.g. xmlns:myPrefix=my-schema-site) [myPrefix
 and my-schema-site are not the actual values used, of course].

I work with documents that are very similar to yours without any
problems. There are two differences with what you are doing:

(i) I don't use XmlCursor, but rather the type-specific methods provided
by the XMLBeans-generated API, something like this:

  Instantiate an element of the correct type like this:

myConcreteType = ConcreteType.Factory.newInstance();

   then populate it and insert it into the XML instance something like
this:

  myContainingElement.setSomeElement(i, myConcreteType);

I don't set the type reference at all, it is just taken care of
automatically by the XMLBeans-generated API.

If this is not practical for you, then perhaps saving and re-parsing the
XML instance before validating would be an acceptable workaround?

(ii) the xmlns:xsi and xmlns:myprefix attributes end up in the element
that is the immediate container of the explicitly typed element rather
than the root element:

 ContainingElement xmlns:xsi=... xmlns:myprefix=...
   TypedElement xsi:type=myprefix:MyType
  ...
  /TypedElement
 /ContainingElement

or sometimes on the typed element itself. This is a minor annoyance, and
in my hands XmlObject.setSaveAggressiveNamespaces() has no effect when
the document is saved, but it really shouldn't make any difference to
the validation.

 Regarding your comment on the schema version that is used, what can I do
 about that?  

A version 1.0 schema is still valid under the 1.1 standard: I mentioned
it only in order to be clear about which standards document I was using
to look up your error message (the clause numbers are different in the
two standards). As far as I know, if you use XMLBeans, you are using XML
Schema 1.0. Only you can decide whether that is a problem for you (it
isn't for me, FWIW). The introduction to the XML Schema 1.1 document may
be a good starting point:

http://www.w3.org/TR/xmlschema11-1/#intro1.1

 I insert the standard XML heading into the file before
 validating and saving.  E.g. ?xml version=1.0 encoding=utf-8?  Does
 the version number here indicate the schema version number?

No, this is the version of the XML standard that is used, not of XML
Schema. Once again, only you can decide whether you have a need for XML
1.1, or if 1.0 is OK for you. As with XML Schema, there is a preamble to
the newer standard that says something about what issues it is
addressing:

http://www.w3.org/TR/xml11/#sec-xml11

Regards,
Peter.

-- 
Peter Keller Tel.: +44 (0)1223 353033
Global Phasing Ltd

Re: Validation issues

2014-07-20 Thread Michael Pigott
Hi,
   Perhaps you are using the wrong prefix for the type element?  In my
(valid) XML Schema, I do not define a prefix for the type attribute, and
instead have the default namespace as http://www.w3.org/2001/XMLSchema.
 Perhaps that's the difference?
   Eclipse also seems to come bundled with an XML Schema validator.  That
gave me a lot of (painfully cryptic, but correct) error messages when I
tried to define my own schema.

Good luck!
Mike


On Wed, Jul 16, 2014 at 1:15 PM, jgagnon joseph.gag...@ll.mit.edu wrote:

 I have written an application that generates XML files that represent test
 cases for a collection of types defined by an XML schema.  Some of these
 types contain elements that are abstract.  The logic locates all concrete
 implementers of the abstract type and when an instance is generated,
 processes one of the concrete types in place of the abstract type.

 It's my understanding that the element must have a type reference attribute
 that indicates the concrete type name.  So, as an example:

 ...
   SomeElement xsi:type=ConcreteType
 ... content ...
   /SomeElement
 ...

 The schema defines the SomeElement field as being defined by an abstract
 type.  ConcreteType is one of many possible concrete implementers of that
 abstract type.

 To take this a little further, a namespace entry is made in the document
 that defines a prefix for the schema types.  So, in the root element there
 would be entry like:

 Root xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:myPrefix=http://my-schema-site/

 The prefix is applied to all elements that are defined by the schema.  E.g.
 myPrefix:SomeElement.  I would also assume that the prefix needs to be
 used in the concrete type reference. So, what I have above now becomes:

 ...
   SomeElement xsi:type=myPrefix:ConcreteType
 ... content ...
   /SomeElement
 ...

 My application does all of this.

 I have also added the option to validate the instance once it's been
 generated.  *Here is where the problem enters the story.*  For some reason,
 it fails validation with the complaint:

 error: cvc-elt.4.2: Invalid xsi:type qname: 'myPrefix:ConcreteType' in
 element SomeElement@my-schema-site

 Oddly, if I validate the instance externally using XMLBeans validate
 utility
 (.../xmlbeans-2.6.0/bin/validate), there is no complaint.

 Am I doing something wrong?




 --
 View this message in context:
 http://xmlbeans.996285.n3.nabble.com/Validation-issues-tp7520.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: Namespaces

2014-07-16 Thread Gagnon, Joseph - 0558 - MITLL
I was able to achieve a prefix-less namespace attribute by passing an empty 
string for the prefix argument.



E.g.  cursor.insertNamespace(, namespaceUri);



From: Friessen, Michelle [mailto:michelle.fries...@pearson.com]
Sent: Tuesday, July 15, 2014 4:38 PM
To: user@xmlbeans.apache.org
Subject: Namespaces



We have 3 namespaces that need to be added when generating XML:



xmlns=http://www.imsglobal.org/xsd/imsqti_v2p1;

xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

xsi:schemaLocation=http://www.imsglobal.org/xsd/imsqti_v2p1 
http://www.imsglobal.org/question/qtiv2p1pd2/xsd/imsqti_v2p1.xsd;



Using XmlCursor, we were able to get the last 2 added using:



cursor.insertAttributeWithValue(schemaLocation, 
http://www.w3.org/2001/XMLSchema-instance;, 
http://www.imsglobal.org/xsd/imsqti_v2p1 
http://www.imsglobal.org/question/qtiv2p1pd2/xsd/imsqti_v2p1.xsd;);



However, we cannot successfully get the first one to print out.  We've tried 
variations of insertNamespace, insertAttribute and insertAttributeWithValue. 
Does anyone have any suggestions on how to add a namespace without a prefix?



Thanks.




Michelle Friessen

Systems Product Support Analyst
Assessment  Instruction
Pearson

(319) 354-9200 x214687



smime.p7s
Description: S/MIME cryptographic signature


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 jerry . sy

look at the XmlCursor api. You can use it to create an xml document.

On 5/6/2014 8:19 AM, jgagnon 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: 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: question about namespace

2014-02-17 Thread Ted Slusser
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



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: Handling namespaces in xsd

2014-01-27 Thread Parvatikar, Narayan
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: Problem about generating Java Source Code with XMLBeans from xsd

2013-11-06 Thread Federico Rossetti
Hi Cezar


First of all thanks for your quick response.


If I understand correctly, using SubInfo.xsetNome with Testo70Custom object
as parameter, I still have to call the “validate” method to check if the
message is correct against the xsd, is it true?


What I wanted to do was something different like this:



String value = //String of more than 70 characters


SubInfo sub =
DocumentoDocument.Factory.newInstance().addNewDocumento().addNewCreditore();


//Maximum length of the element type Nome, which should be Testo70Custom

int subInfoMaxLength =
Integer.parseInt(sub.xgetNome().type.getFacet(SchemaType.FACET_MAX_LENGTH).getStringValue());


String name = //substring of “value” with maxlength = “subInfoMaxLength”


sub.setNome(name);



However the length of subInfoMaxLength is not 70 but is 140, that is the
length of the type Testo140, because like you said java rules and schema
rules don’t match fully.


I thought of this strategy to automatically manage any max length changes
of elements in XSD.


Can I manage these changes automatically in any other way?


Thanks for your response

Federico


2013/11/5 Cezar Andrei cezar.and...@oracle.com

 Federico,

 The schema looks fine, if you look closely at SubInfo type def:

 xs:complexType name=SubInfo
 xs:complexContent
 xs:restriction base=Info
 xs:sequence
 xs:element name=Nome type=Testo70Custom/
 /xs:sequence
 /xs:restriction
 /xs:complexContent
 /xs:complexType
 xs:complexType name=Info
 xs:sequence
 xs:element name=Nome type=Testo140 minOccurs=0/
 /xs:sequence
 /xs:complexType
 xs:simpleType name=Testo70Custom
 xs:restriction base=Testo140
 xs:maxLength value=70/
 /xs:restriction
 /xs:simpleType
 xs:simpleType name=Testo140
 xs:restriction base=xs:string
 xs:minLength value=1/
 xs:maxLength value=140/
 /xs:restriction
 /xs:simpleType

 SubInfo is a restriction of type Info, i.e. it has to have a property
 called Nome of type Testo140.
 But in the same type the element Nome inside the SubInfo sequence is
 declared of type Testo70Custom, which is fine because Testo70Custom is a
 subtype of Testo140.

 This is a case where java rules and schema rules don't match fully. But if
 you're a little careful everything works fine,  make sure that you use
 SubInfo.xsetNome() only with objects of type Testo70Custom.

 Cezar


 On Nov 5, 2013, at 10:29 AM, Federico Rossetti 
 federico.rossetti...@gmail.com wrote:

 Hi all


 i have a starting xsd no editable, from which to generate the Java source
 code with XMLBeans. My problem is on the generated java class SubInfo.java.


 In the xsd, the element “Nome”, child of the element “SubInfo”, has as
 type “Testo70Custom”, but in the generated java code the type is
 “Testo140”. Is the xsd poorly written the problem? Or is the process of
 code generation the problem?


 The correct type is important because in my java code – client side – I
 use it to get some attributes of the xsd elements (like max length of
 string, to truncate strings in surplus) from the schemaytpe in order to
 perform the validation before sending out the message. If the type is
 wrong, I could send erroneous messages.


 In binary file .xsb generated with XmlBeans,  i see that in the properties
 of the element “Nome” there is a difference between the Type
 (testo70custom8e3etype) and the Type for Java Signature (testo1405c59type).


 The three files are attached to the message.


 Thanks for a response


 Federico
 SubInfo.javasubinfo0d05type.xsbxsdtest.xsd
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org





Re: Getting XMLBeans out of Attic

2013-10-25 Thread Jacob Danner
Hi Nick,
I was wondering if this was going to get off the ground. I'm still game to
work on this and have been poking at bits on my github fork. As a prior
committer all the legalese has been completed once before. Do I or should I
do anything else for this incubating project?
-jacobd
On Oct 24, 2013 4:43 AM, Nick Burch apa...@gagravarr.org wrote:

 On Thu, 24 Oct 2013, Tammo van Lessen wrote:

 Me too, I can also serve as a mentor. Perhaps we should also inform attic
 (and board?) when we get this started so that the actual move to attic can
 be avoided.


 I think the attic already knows?

 I've created an initial proposal, feedback welcome! I've also added the
 people who volunteered in this thread. Jerry and Serkan - there's a few
 bits you need to edit about yourselves on the wiki

 The proposal is available at:
  
 https://wiki.apache.org/**incubator/XMLBeansProposalhttps://wiki.apache.org/incubator/XMLBeansProposal

 Nick

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




Re: Getting XMLBeans out of Attic

2013-10-24 Thread Serkan Taş
Me too...

Serkan.

23 Eki 2013 tarihinde 21:54 saatinde, jerry...@oracle.com şunları yazdı:

 Yes I am still interested.
 
 Thanks
 Jerry
 
 On 10/23/2013 4:37 AM, Nick Burch wrote:
 Hi All
 
 Is there still interest in rebooting the XMLBeans project?
 
 If so, I think we have enough existing Apache PMC members to mentor the 
 rebooted project. I'm happy to start the ball rolling on the proposal if 
 there's still the interest?
 
 Nick
 
 PS The steps would be that I'd setup the proposal on the incubator wiki,
   people interested in helping with the rebooted project would sign up,
   then we'd have a vote and then begin working on the code and the
   community within the Apache Incubator
 
 -
 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: Getting XMLBeans out of Attic

2013-10-24 Thread Tammo van Lessen
Me too, I can also serve as a mentor. Perhaps we should also inform attic
(and board?) when we get this started so that the actual move to attic can
be avoided.

Tammo


On Thu, Oct 24, 2013 at 8:17 AM, Serkan Taş serkan_...@hotmail.com wrote:

 Me too...

 Serkan.

 23 Eki 2013 tarihinde 21:54 saatinde, jerry...@oracle.com şunları yazdı:

  Yes I am still interested.
 
  Thanks
  Jerry
 
  On 10/23/2013 4:37 AM, Nick Burch wrote:
  Hi All
 
  Is there still interest in rebooting the XMLBeans project?
 
  If so, I think we have enough existing Apache PMC members to mentor the
 rebooted project. I'm happy to start the ball rolling on the proposal if
 there's still the interest?
 
  Nick
 
  PS The steps would be that I'd setup the proposal on the incubator wiki,
people interested in helping with the rebooted project would sign up,
then we'd have a vote and then begin working on the code and the
community within the Apache Incubator
 
  -
  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




-- 
Tammo van Lessen - http://www.taval.de


Re: XMLBeans Project Reboot Proposal - Volunteers Needed

2013-10-24 Thread Daniel Lübke

Hi Nick,

thanks for your effort on creating the proposal. I'd like to join.

Daniel

Am 24.10.2013 14:16, schrieb Nick Burch:

Hi All

As many of you will know, the Apache XMLBeans project is currently 
destined for the Apache Attic, in large part because the previous PMC [1]
(Project Management Committee) is no longer around to provide the 
required levels of oversight of the project.


It looks like there are still plenty of people around though who want 
to help with XMLBeans and keep it going, which is great! The next step 
is to take a proposal to the Apache Incubator to reboot the project. 
This would be for the Incubator to help the community develop into a 
new PMC, such as learning more about the Apache Way - our meritocratic 
way of developing open source software.


I've put together an initial proposal to the IPMC for this, which is 
available at:

   https://wiki.apache.org/incubator/XMLBeansProposal

At this point, we need people to volunteer to take part in the 
rebooted project! If you'd like to help develop the code, develop the 
website, develop documentation etc, please sign up! To do so, just go 
to the proposal, edit the wiki, and list yourself in the table near 
the bottom. (Existing IPMC members please sign up to help mentor!)


People may also want to read through the Incubator Guides, which 
explain a lot more about the process, the way that software gets 
developed at Apache, the importance of the community etc. That's all at:

   http://incubator.apache.org/guides/index.html

The main thing for now though is for people to sign up on the proposal 
to help! Sign up, join in, help out :)

https://wiki.apache.org/incubator/XMLBeansProposal#Initial_Committers

Nick

[1] http://www.apache.org/dev/#pmc

-
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 Project Reboot Proposal - Volunteers Needed

2013-10-24 Thread Nick Burch

On Thu, 24 Oct 2013, Daniel Lübke wrote:

thanks for your effort on creating the proposal. I'd like to join.


Great! First thing, which I see you've already done, is to list yourself 
in the Initial Committers list

https://wiki.apache.org/incubator/XMLBeansProposal#Initial_Committers

Secondly, assuming the IPMC approves the reboot, everyone will need to 
have an iCLA on file before they can get an account as a committer. It 
only takes a short while to read the iCLA and send one in, so it may be 
worth people going ahead and doing that. Details are at
http://www.apache.org/licenses/#clas . Once you've submitted an iCLA, you 
can update the committers list iCLA column on the wiki to say you've 
submitted yours!


Nick

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

Re: Getting XMLBeans out of Attic

2013-10-23 Thread Nick Burch

Hi All

Is there still interest in rebooting the XMLBeans project?

If so, I think we have enough existing Apache PMC members to mentor the 
rebooted project. I'm happy to start the ball rolling on the proposal if 
there's still the interest?


Nick

PS The steps would be that I'd setup the proposal on the incubator wiki,
   people interested in helping with the rebooted project would sign up,
   then we'd have a vote and then begin working on the code and the
   community within the Apache Incubator

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



Re: Getting XMLBeans out of Attic

2013-10-23 Thread jerry . sy

Yes I am still interested.

Thanks
Jerry

On 10/23/2013 4:37 AM, Nick Burch wrote:

Hi All

Is there still interest in rebooting the XMLBeans project?

If so, I think we have enough existing Apache PMC members to mentor 
the rebooted project. I'm happy to start the ball rolling on the 
proposal if there's still the interest?


Nick

PS The steps would be that I'd setup the proposal on the incubator wiki,
   people interested in helping with the rebooted project would sign up,
   then we'd have a vote and then begin working on the code and the
   community within the Apache Incubator

-
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 to insert after using XmlCursor?

2013-10-23 Thread jerry . sy
You need to go to the END of the parent cursor or to the nextToken of 
the END of the lastChild, then do the insert.


XmlObject test1 = 
XmlObject.Factory.parse(parentchildfirst/child/parent);

XmlCursor testcurs = test1.newCursor();
if (testcurs.isStartdoc()){
testcurs.toNextToken();
}
boolean res = testcurs.toLastChild();
XmlCursor.TokenType tt = testcurs.toEndToken(); //this goes to 
END tag of the last child element

tt = testcurs.toNextToken(); //we are now at the END tag of parent
testcurs.insertElementWithText(child,second);

or this
XmlObject test1 = 
XmlObject.Factory.parse(parentchildfirst/child/parent);

XmlCursor testcurs = test1.newCursor();
if (testcurs.isStartdoc()){
testcurs.toNextToken(); //now at parent element
}
XmlCursor.TokenType tt = testcurs.toEndToken(); //END tag of 
parent element

testcurs.insertElementWithText(child,second);


On 10/23/2013 11:51 AM, Michael Bishop wrote:

Hello all,

I'm a bit stuck in trying to achieve this with XmlObjects and 
XmlCursor. Imagine the following scenario:


parent
childSome text/child
/parent

I want to insert a new element AFTER the child element.

parent
childSome text/child
!-- New element here! --
/parent

I don't necessarily know anything about the child element. It might 
have child text like the example above. It might not. It might have 
child elements, it might not. It might have siblings, it might not. 
Here's where I'm stuck:


// XmlObject representing parent.
XmlObject parent = ...;

XmlCursor parentCursor = parent.newCursor();

// Now I'm at the START token for the child element.
parentCursor.toChild(child);

From here, how do I reliably get the cursor past /child or child/? 
Basically I'm at the start of child and want to be right past the 
end of that element.


Thanks,

Michael



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



Re: How to insert after using XmlCursor?

2013-10-23 Thread Michael Bishop
That's really helpful. That got me most of the way there. I have to take
into account that child may not be the only kind of child a parent can
have. Given schema constraints, I have to make sure children appear in the
right order. I've found a solution that still needs testing for all cases.

The overall goal is to take some source XmlObject and apply it to a
target XmlObject. The target XmlObject is the live XmlObject. We have
custom events, event listeners, etc., working with the target XmlObject.
That's why I can't just call target.set(source); we lose all the listeners.

So, you invoke an edit on the live target and get a dialog. The dialog
makes a copy of the target and returns the modified copy based on user
input. So your target is still the live XML and the source is the
updated version of target. If everything goes correctly, your target is
now equivalent to your source.

I have a series of methods that compare source and target. One handles
attributes. One handles child text. One handles removing child elements
from the target that no longer exist in the source. One handles updating
child elements that exist in both target and source. Finally, I have the
method that adds child elements from source that don't exist in target.
This is the one that's giving me trouble.

I iterate through all of the source's child elements in order. Order's
important; otherwise we could break schema constraints. Assuming source is
correct, I try to place the new child element in the right place under
target.

// This is the qualified name of the previous child element from source we
processed.
QName previous = ...

XmlCursor targetCursor = target.newCursor();

// Attempt to go to the last child we processed. This should pass unless
the target has no child elements and this is the first child element
processed.
if (targetCursor.toChild(previous)) {

// If we don't have a sibling, w try to go to the end of the parent
(containing) element.
if (!targetCursor.toNextSibling()) {
targetCursor.toParent();
targetCursor.toEndToken();
targetCursor.toPrevToken();
}

// If we made it to the last child we processed, we want to insert the new
child after it.
else {
targetCursor.toEndToken();
}
}

sourceCursor.copyXml(targetCursor);

previous = sourceName;

targetCursor.dispose();

// Iterate to the next source child.


Does this make any sense whatsoever? Am I making this too difficult? At the
end of the day, I want to operate on target so it is equivalent to
source without losing any of the custom event-related information in
target.


On Wed, Oct 23, 2013 at 3:35 PM, jerry...@oracle.com wrote:

 You need to go to the END of the parent cursor or to the nextToken of the
 END of the lastChild, then do the insert.

 XmlObject test1 = XmlObject.Factory.parse(**
 parentchildfirst/child/**parent);
 XmlCursor testcurs = test1.newCursor();
 if (testcurs.isStartdoc()){
 testcurs.toNextToken();
 }
 boolean res = testcurs.toLastChild();
 XmlCursor.TokenType tt = testcurs.toEndToken(); //this goes to END
 tag of the last child element
 tt = testcurs.toNextToken(); //we are now at the END tag of parent
 testcurs.**insertElementWithText(child,**second);

 or this
 XmlObject test1 = XmlObject.Factory.parse(**
 parentchildfirst/child/**parent);
 XmlCursor testcurs = test1.newCursor();
 if (testcurs.isStartdoc()){
 testcurs.toNextToken(); //now at parent element
 }
 XmlCursor.TokenType tt = testcurs.toEndToken(); //END tag of
 parent element
 testcurs.**insertElementWithText(child,**second);



 On 10/23/2013 11:51 AM, Michael Bishop wrote:

 Hello all,

 I'm a bit stuck in trying to achieve this with XmlObjects and XmlCursor.
 Imagine the following scenario:

 parent
 childSome text/child
 /parent

 I want to insert a new element AFTER the child element.

 parent
 childSome text/child
 !-- New element here! --
 /parent

 I don't necessarily know anything about the child element. It might have
 child text like the example above. It might not. It might have child
 elements, it might not. It might have siblings, it might not. Here's where
 I'm stuck:

 // XmlObject representing parent.
 XmlObject parent = ...;

 XmlCursor parentCursor = parent.newCursor();

 // Now I'm at the START token for the child element.
 parentCursor.toChild(child);

 From here, how do I reliably get the cursor past /child or child/?
 Basically I'm at the start of child and want to be right past the end of
 that element.

 Thanks,

 Michael



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




Re: Question about generating Java Source Code from XML Schemas

2013-08-21 Thread Michael Bishop
I think I can answer your first question. From what I recall in
parsing/reading documents, InputStream is a poor choice for XML documents
that include other documents. An InputStream object can't tell you where
its source is. Therefore, there is no way to find relative paths. I would
try the following:

final URL schema1Url = BeanGenerator.class.getResource(xsd/schema1.xsd);
final XmlObject schema1 = XmlObject.Factory.parse(schema1Url);

See if that helps.



On Wed, Aug 21, 2013 at 9:39 AM, Michael Szalay michael.sza...@abacus.chwrote:

 Hi all

 I have some xsd schemas in my source tree and I want to generate java
 sources with XML Beans.
 I cannot use ant or maven task, I have to do it in plain java.

 I use the following java code:

 final InputStream schema1Stream =
 BeanGenerator.class.getResourceAsStream(xsd/schema1.xsd);
 final XmlObject schema1 = XmlObject.Factory.parse(schema1Stream);
 final InputStream schema2Stream =
 BeanGenerator.class.getResourceAsStream(xsd/schema2.xsd);
 final XmlObject schema2 = XmlObject.Factory.parse(schema2Stream);
 final XmlObject[] schemas = { schema1, schema2 };
 final BindingConfig config = new BindingConfig() {
@Override
public String lookupPackageForNamespace(String uri) {
  return ch.mypackage;
}
 };

 final Filer filer = new FilerImpl(null, new File(.java/src/), null,
 true, true);
 final XmlOptions options = new XmlOptions();
 options.setCompileDownloadUrls();
 XmlBeans.compileXmlBeans(null, null, schemas, config, null, filer,
 options);


 I have questions:

 1) The schemas have include statements like this:

xs:include schemaLocation=./th08_extern.xsd/

 How can I make XmlBeans to include this schemas? Its located in the same
 folder as the original schema, but XMLBeans does not
 find it:

 URL ./th08_extern.xsd is not well-formed

 how to solve that?

 2) I want everything XmlBeans generates in the package ch.mypackage.
 How can I to this? XmlBeans generates a lot of other stuff like xsb
 files which are not in that package.

 How can I say to XmlBeans to not generate this files?

 3) When I use one of the generated classes, there is the following
 runtime error:

 java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable to load
 class with name

 schemaorg_apache_xmlbeans.system.s2EF0617F3F8756BE32108E3CF22693B4.TypeSystemHolder.
 Make sure the generated binary files are on the classpath.
 at
 org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783)
 ... 29 more
 Caused by: java.lang.ClassNotFoundException:

 schemaorg_apache_xmlbeans.system.s2EF0617F3F8756BE32108E3CF22693B4.TypeSystemHolder
 at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
 at
 org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:769)
 ... 30 more

 What is the problem here? Why is this class not generated?

 Thanks for a response
 Michael



 -
 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



Add to XmlBeans FAQ re orphaned objects and XmlValueDisconnectedException

2013-08-20 Thread Lott, Christopher M
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



Re: Modifying XmlBeans document without XmlValueDisconnectedException?

2013-08-19 Thread Nick Burch

On Mon, 19 Aug 2013, Lott, Christopher M wrote:
We use XmlBeans, code generated from a schema, to read in an XML 
instance that conforms to the schema and modify it.  Read and validate 
work fine; modify is killing me.  For example, change the value of an 
element, delete an element from a list, etc.  I am using Java method 
calls like removeMyElement(i) to remove the element at position (i).  I 
am not using Cursors or any low-level DOM access.


I would have expected that to work, but I'm not an xmlbeans expert

We thought it would be convenient to walk thru the document, gather a 
list of elements (i.e., references to XmlBeans objects) that need to be 
modified or nuked, then iterate over the list changing them.  But use of 
a cached object reference is where I run into the ditch: I get 
XmlValueDisconnectedException.  I read that this means the XmlObject has 
become disconnected from its underlying store. But I have not discarded 
the Document!


Are you able to produce a very small unit test (possibly with a dummy 
schema file) that shows up the problem? People may have more luck in 
understanding your problem if they can look at some code. If not, at least 
the produce a unit test for the bug part is covered!


Nick

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



RE: Modifying XmlBeans document without XmlValueDisconnectedException?

2013-08-19 Thread Paul Gillen
Since I think I can answer your question I probably misunderstand it.  :)
However ...

 

Given an XSD:

?xml version=1.0 encoding=UTF-8?

xs:schema targetNamespace=org.eltesto elementFormDefault=qualified
attributeFormDefault=unqualified xmlns=org.eltesto
xmlns:xs=http://www.w3.org/2001/XMLSchema;

   xs:element name=Rootie

  xs:complexType

 xs:sequence

   xs:element name=ItLives type=xs:string/

   xs:element name=DoorNail type=xs:string
minOccurs=0/

 /xs:sequence

  /xs:complexType

   /xs:element

/xs:schema

 

And XML:

?xml version=1.0 encoding=UTF-8?

Rootie xmlns=org.eltesto
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=org.eltesto

xsd\Rootie.xsd

   ItLivesfoo/ItLives

   DoorNailbar/DoorNail

/Rootie

 

This program modifies and deletes element DoorNail:

package org.eltesto;

 

import java.io.File;import eltesto.org.RootieDocument;

import eltesto.org.RootieDocument.Rootie;

 

public class Main {

   public static void main(String[] args) throws Exception {

  Main m = new Main();

  m.go(args);

   }

   private void go(String[] args) throws Exception {

  File f = new File(Rootie.xml);

  RootieDocument rd = RootieDocument.Factory.parse(f);

  System.out.println(rd.xmlText());

  Rootie r = rd.getRootie();

  r.setDoorNail(modified);

  System.out.println(rd.xmlText());

  r.unsetDoorNail();

  System.out.println(rd.xmlText());

   }

}

 

Output:

Rootie xsi:schemaLocation=org.eltesto xsd\Rootie.xsd xmlns=org.eltesto
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

   ItLivesfoo/ItLives

   DoorNailbar/DoorNail

/Rootie

 

Rootie xsi:schemaLocation=org.eltesto xsd\Rootie.xsd xmlns=org.eltesto
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

   ItLivesfoo/ItLives

   DoorNailmodified/DoorNail

/Rootie

 

Rootie xsi:schemaLocation=org.eltesto xsd\Rootie.xsd xmlns=org.eltesto
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

   ItLivesfoo/ItLives

   

/Rootie

 

Note that you only get the unset. method if the element is declared as
optional, i.e. 'minOccurs=0' which is as it should be.

 

Cordially,

Paul Gillen

 

 

-Original Message-
From: Lott, Christopher M [mailto:cl...@appcomsci.com] 
Sent: Monday, August 19, 2013 5:33 PM
To: user@xmlbeans.apache.org
Subject: Modifying XmlBeans document without XmlValueDisconnectedException?

 

I tried asking this on StackOverflow, but then realized that this email list
is probably the better place, so please forgive if you read both places.  I
hope someone can please find time to answer.

 

We use XmlBeans, code generated from a schema, to read in an XML instance
that conforms to the schema and modify it.  Read and validate work fine;
modify is killing me.  For example, change the value of an element, delete
an element from a list, etc.  I am using Java method calls like
removeMyElement(i) to remove the element at position (i).  I am not using
Cursors or any low-level DOM access.

 

We thought it would be convenient to walk thru the document, gather a list
of elements (i.e., references to XmlBeans objects) that need to be modified
or nuked, then iterate over the list changing them.  But use of a cached
object reference is where I run into the ditch: I get
XmlValueDisconnectedException.  I read that this means the XmlObject has
become disconnected from its underlying store. But I have not discarded the
Document!

 

Does every change to an XmlObject backed by the XmlBeans XmlStore cause all
existing references to become invalid?  I don't yet have the right mental
model for what's going on when I call the java methods.

 

I checked the XmlBeans FAQ and the sample code for guidelines.  I found many
samples at  http://xmlbeans.apache.org/samples/
http://xmlbeans.apache.org/samples/ that show how to create an object from
scratch, how to read in XML, how to validate XML, etc.  Unfortunately I
didn't find a sample that does a messy change to the content. The FAQ at
http://wiki.apache.org/xmlbeans/XmlBeansFaq
http://wiki.apache.org/xmlbeans/XmlBeansFaq doesn't have a good question on
this either.

 

Thanks in advance.

-

To unsubscribe, e-mail:  mailto:user-unsubscr...@xmlbeans.apache.org
user-unsubscr...@xmlbeans.apache.org

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

 



Re: Modifying XmlBeans document without XmlValueDisconnectedException?

2013-08-19 Thread Lott, Christopher M
Thanks to Nick B. and Paul G. for their quick replies!  Below is code that 
demonstrates, at least superficially, the exception that we get.  We are doing 
something wrong in our code; I don't suspect an XmlBeans bug at this point.  
This code is derived from (and depends on the schema and example XML instance 
from) the XmlBeans tutorial at 
http://xmlbeans.apache.org/documentation/tutorial_getstarted.html

--
package my.xb.example;

import java.io.File;
import java.math.BigDecimal;
import java.math.BigInteger;

import org.openuri.easypo.LineItem;
import org.openuri.easypo.PurchaseOrderDocument;

public class POUpdater {
public static void main(String[] args) throws Exception {
if (args.length  5)
throw new Exception(Usage: inputfile desc ounces price 
quantity);
File poXmlFile = new File(args[0]);
String updatedPoXml = addLineItem(poXmlFile, args[1], args[2], 
args[3],
args[4]);
System.out.println(updatedPoXml);
}

private static String addLineItem(File purchaseOrder,
String itemDescription, String perUnitOuncesString,
String itemPriceString, String itemQuantityString) 
throws Exception {

// Read in the file content
PurchaseOrderDocument poDoc = PurchaseOrderDocument.Factory
.parse(purchaseOrder);

// Convert incoming data to types that can be used in accessors.
BigDecimal perUnitOunces = new BigDecimal(perUnitOuncesString);
BigDecimal itemPrice = new BigDecimal(itemPriceString);
BigInteger itemQuantity = new BigInteger(itemQuantityString);

// Add a new line-item element.
LineItem newItem = poDoc.getPurchaseOrder().addNewLineItem();
newItem.setDescription(itemDescription);
newItem.setPerUnitOunces(perUnitOunces);
newItem.setPrice(itemPrice);
newItem.setQuantity(itemQuantity);

// Delete the old first line item
LineItem removedItem = 
poDoc.getPurchaseOrder().getLineItemArray(0);
poDoc.getPurchaseOrder().removeLineItem(0);

// Try to access the newly added one; is the ref still good?
System.out.println(new item:  + newItem.toString());
newItem.setDescription(newItem.getDescription() +  fu);

// Try to access the removed one; this throws 
XmlValueDisconnectedException
System.out.println(removed item:  + removedItem.toString());

return poDoc.toString();
}
}




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



RE: Modifying XmlBeans document without XmlValueDisconnectedException?

2013-08-19 Thread Paul Gillen
If I understand you correctly you are trying to print something you removed;
it gone baby.  If for some reason you need it, preserve a copy, not a
reference.

 

package org.eltesto;

 

import java.io.File;

import java.math.BigDecimal;

import java.math.BigInteger;

 

import org.openuri.easypo.LineItem;

import org.openuri.easypo.PurchaseOrderDocument;

import org.openuri.easypo.PurchaseOrderDocument.PurchaseOrder;

 

public class Main {

   public static void main(String[] args) throws Exception {

  Main m = new Main();

  m.go(args);

   }

   private void go(String[] args) throws Exception {

  File f = new File(easypo.xml);

  PurchaseOrderDocument pd =
PurchaseOrderDocument.Factory.parse(f);

  System.out.println(ORIGINAL\n+pd.xmlText());

  

  PurchaseOrder p = pd.getPurchaseOrder();

  

  LineItem l = p.addNewLineItem();

  l.setDescription(foo);

  l.setPerUnitOunces(new BigDecimal(1));

  l.setPrice(new BigDecimal(2));

  l.setQuantity(new BigInteger(3));

  System.out.println(\nLINE ITEM ADDED\n+pd.xmlText());

  

  LineItem nl =
LineItem.Factory.parse(p.getLineItemArray(0).toString());

  

  p.removeLineItem(0);

  System.out.println(\nLINE ITEM DELETED\n+pd.xmlText());

  

  System.out.println(\nCOPY OF DELETED LINE
ITEM\n+nl.xmlText());

   }

}

 

Output:

ORIGINAL

purchase-order xmlns=http://openuri.org/easypo;

customer

nameGladys Kravitz/name

addressAnytown, PA/address

/customer

date2003-01-07T14:16:00-05:00/date

line-item

descriptionBurnham's Celestial Handbook, Vol 1/description

per-unit-ounces5/per-unit-ounces

price21.79/price

quantity2/quantity

/line-item

line-item

descriptionBurnham's Celestial Handbook, Vol 2/description

per-unit-ounces5/per-unit-ounces

price19.89/price

quantity2/quantity

/line-item

shipper

nameZipShip/name

per-ounce-rate0.74/per-ounce-rate

/shipper

/purchase-order

 

LINE ITEM ADDED

purchase-order xmlns=http://openuri.org/easypo;

customer

nameGladys Kravitz/name

addressAnytown, PA/address

/customer

date2003-01-07T14:16:00-05:00/date

line-item

descriptionBurnham's Celestial Handbook, Vol 1/description

per-unit-ounces5/per-unit-ounces

price21.79/price

quantity2/quantity

/line-item

line-item

descriptionBurnham's Celestial Handbook, Vol 2/description

per-unit-ounces5/per-unit-ounces

price19.89/price

quantity2/quantity

/line-item

 
line-itemdescriptionfoo/descriptionper-unit-ounces1/per-unit-ounces
price2/pricequantity3/quantity/line-itemshipper

nameZipShip/name

per-ounce-rate0.74/per-ounce-rate

/shipper

/purchase-order

 

LINE ITEM DELETED

purchase-order xmlns=http://openuri.org/easypo;

customer

nameGladys Kravitz/name

addressAnytown, PA/address

/customer

date2003-01-07T14:16:00-05:00/date



line-item

descriptionBurnham's Celestial Handbook, Vol 2/description

per-unit-ounces5/per-unit-ounces

price19.89/price

quantity2/quantity

/line-item

 
line-itemdescriptionfoo/descriptionper-unit-ounces1/per-unit-ounces
price2/pricequantity3/quantity/line-itemshipper

nameZipShip/name

per-ounce-rate0.74/per-ounce-rate

/shipper

/purchase-order

 

COPY OF DELETED LINE ITEM

xml-fragment xmlns:eas=http://openuri.org/easypo;

  eas:descriptionBurnham's Celestial Handbook, Vol 1/eas:description

  eas:per-unit-ounces5/eas:per-unit-ounces

  eas:price21.79/eas:price

  eas:quantity2/eas:quantity

/xml-fragment

 

On the other hand I might be completely FOS.  Please let me know if this is
the case.

 

Cordially,

Paul Gillen

 

 

 

-Original Message-
From: Lott, Christopher M [mailto:cl...@appcomsci.com] 
Sent: Monday, August 19, 2013 9:33 PM
To: user@xmlbeans.apache.org
Subject: Re: Modifying XmlBeans document without
XmlValueDisconnectedException?

 

Thanks to Nick B. and Paul G. for their quick replies!  Below is code that
demonstrates, at least superficially, the exception that we get.  We are
doing something wrong in our code; I don't suspect an XmlBeans bug at this
point.  This code is derived from (and depends on the schema and example XML
instance from) the XmlBeans tutorial at
http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
http://xmlbeans.apache.org/documentation/tutorial_getstarted.html

 

--

package my.xb.example;

 

import java.io.File;

import java.math.BigDecimal;

import java.math.BigInteger;

 

import org.openuri.easypo.LineItem;

import

Re: Getting XMLBeans out of Attic

2013-07-29 Thread Daniel Lübke

Hi,

sorry for not replying immediately. We have now 7 persons who would be 
willing to join a new PMC:


Jacob Danner (already committer)
Jerry Sy
Pascal Heus
Jack Gager
Harring Figueiredo
Serkan Tas
Daniel Lübke (me)

I have talked to the Apache ODE PMC Chair Tammo van Lessen how we can 
get things running again, i.e. which Apache rules are there etc. I will 
keep you updated.


Are there any other committers (except for Jacob) who would continue to 
contribute to this project?


Regards,
Daniel

Am 23.07.2013 17:29, schrieb Daniel Lübke:

Hi list,

I am a long-time user of XMLBeans, most of the time as part of the 
BPELUnit project. There is no replacement to XMLBeans because in 
contrast to JAXB if preserves namespace declarations so you e.g. read 
and write XML document that contain XPath expressions (e.g. BPEL, 
BPMN2, ...).


Although I know XMLBeans only from the user perspective, I would 
contribute to it, which includes learning more of its internals, apply 
the outstanding patches, test them and so on.


As far as I understand the Apache rules a project needs to have a 
working PMC. This means at least 3 people (for substitution 4 or 5 
would be better) which vote on releases. I also would join a new PMC 
if 3 other would be willing to join me and at least build regular 
maintainance releases to keep this project alive and reboot its PMC.


I know that many other projects use XMLBeans, e.g. Apache Camel, 
Apache CXX Apache ODE, ... and many non-Apache projects, too. So I 
hope that we can find enough interested people to keep this project 
alive.


If you are one of them, please reply to this list. If we are enough 
people, I would try to talk to the Apache Foundation.


Regards,
Daniel

-
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: Getting XMLBeans out of Attic

2013-07-29 Thread Nick Burch

On Mon, 29 Jul 2013, Daniel Lübke wrote:
I have talked to the Apache ODE PMC Chair Tammo van Lessen how we can 
get things running again, i.e. which Apache rules are there etc. I will 
keep you updated.


As I understand it, the responsibility for the project has been moved to 
the Apache Attic PMC, but no-one from there has yet had the time to action 
the move. So, I think you probably want to get in touch with the Attic 
PMC[1], let them know there's a move to reboot the pmc, and ask them for 
their advice on how to do that


Nick
[1] http://mail-archives.apache.org/mod_mbox/attic-general/

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

Re: Getting XMLBeans out of Attic

2013-07-26 Thread Pascal Heus
Daniel:
You can add myself and my colleague Jack Gager
(j.ga...@metadatatechnology.com) to the list.
best
*P

On 7/24/13 9:50 PM, jerry...@oracle.com wrote:
 Hi Daniel,

 Please count me in.

 Thanks
 Jerry

 On 7/23/2013 8:29 AM, Daniel Lübke wrote:
 Hi list,

 I am a long-time user of XMLBeans, most of the time as part of the
 BPELUnit project. There is no replacement to XMLBeans because in
 contrast to JAXB if preserves namespace declarations so you e.g. read
 and write XML document that contain XPath expressions (e.g. BPEL,
 BPMN2, ...).

 Although I know XMLBeans only from the user perspective, I would
 contribute to it, which includes learning more of its internals,
 apply the outstanding patches, test them and so on.

 As far as I understand the Apache rules a project needs to have a
 working PMC. This means at least 3 people (for substitution 4 or 5
 would be better) which vote on releases. I also would join a new PMC
 if 3 other would be willing to join me and at least build regular
 maintainance releases to keep this project alive and reboot its PMC.

 I know that many other projects use XMLBeans, e.g. Apache Camel,
 Apache CXX Apache ODE, ... and many non-Apache projects, too. So I
 hope that we can find enough interested people to keep this project
 alive.

 If you are one of them, please reply to this list. If we are enough
 people, I would try to talk to the Apache Foundation.

 Regards,
 Daniel

 -
 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: Getting XMLBeans out of Attic

2013-07-26 Thread Harring Figueiredo
Add myself as well, please.

Thank you,

Harring Figueiredo


On Fri, Jul 26, 2013 at 9:15 AM, Pascal Heus pascal.h...@gmail.com wrote:

 Daniel:
 You can add myself and my colleague Jack Gager
 (j.ga...@metadatatechnology.com) to the list.
 best
 *P

 On 7/24/13 9:50 PM, jerry...@oracle.com wrote:
  Hi Daniel,
 
  Please count me in.
 
  Thanks
  Jerry
 
  On 7/23/2013 8:29 AM, Daniel Lübke wrote:
  Hi list,
 
  I am a long-time user of XMLBeans, most of the time as part of the
  BPELUnit project. There is no replacement to XMLBeans because in
  contrast to JAXB if preserves namespace declarations so you e.g. read
  and write XML document that contain XPath expressions (e.g. BPEL,
  BPMN2, ...).
 
  Although I know XMLBeans only from the user perspective, I would
  contribute to it, which includes learning more of its internals,
  apply the outstanding patches, test them and so on.
 
  As far as I understand the Apache rules a project needs to have a
  working PMC. This means at least 3 people (for substitution 4 or 5
  would be better) which vote on releases. I also would join a new PMC
  if 3 other would be willing to join me and at least build regular
  maintainance releases to keep this project alive and reboot its PMC.
 
  I know that many other projects use XMLBeans, e.g. Apache Camel,
  Apache CXX Apache ODE, ... and many non-Apache projects, too. So I
  hope that we can find enough interested people to keep this project
  alive.
 
  If you are one of them, please reply to this list. If we are enough
  people, I would try to talk to the Apache Foundation.
 
  Regards,
  Daniel
 
  -
  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: Getting XMLBeans out of Attic

2013-07-26 Thread s t


 We are using the library for 3 years, after castor. 
 
 I may participate.
 
 24 Tem 2013 tarihinde 22:50 saatinde, jerry...@oracle.com şunları yazdı:
 
 Hi Daniel,
 
 Please count me in.
 
 Thanks
 Jerry
 
 On 7/23/2013 8:29 AM, Daniel Lübke wrote:
 Hi list,
 
 I am a long-time user of XMLBeans, most of the time as part of the BPELUnit 
 project. There is no replacement to XMLBeans because in contrast to JAXB if 
 preserves namespace declarations so you e.g. read and write XML document 
 that contain XPath expressions (e.g. BPEL, BPMN2, ...).
 
 Although I know XMLBeans only from the user perspective, I would contribute 
 to it, which includes learning more of its internals, apply the outstanding 
 patches, test them and so on.
 
 As far as I understand the Apache rules a project needs to have a working 
 PMC. This means at least 3 people (for substitution 4 or 5 would be better) 
 which vote on releases. I also would join a new PMC if 3 other would be 
 willing to join me and at least build regular maintainance releases to keep 
 this project alive and reboot its PMC.
 
 I know that many other projects use XMLBeans, e.g. Apache Camel, Apache CXX 
 Apache ODE, ... and many non-Apache projects, too. So I hope that we can 
 find enough interested people to keep this project alive.
 
 If you are one of them, please reply to this list. If we are enough people, 
 I would try to talk to the Apache Foundation.
 
 Regards,
 Daniel
 
 -
 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
 
 
 
 
 
 
 
 Serkan Taş
 Likya Bilgi Teknolojileri
 ve İletişim Hiz. Ltd. Şti.
 www.likyateknoloji.com
  
 Tel :+ 90 216 471 81 55 - 117
 Gsm : + 90 542 242 00 92
 Faks:  + 90 216 661 14 92
  
 --
 Bu elektronik posta ve onunla iletilen bütün dosyalar gizlidir. Sadece 
 yukarıda isimleri belirtilen kişiler arasında özel haberleşme amacını 
 taşımaktadır. Size yanlışlıkla ulaşmışsa bu elektonik postanın içeriğini 
 açıklamanız, kopyalamanız, yönlendirmeniz ve kullanmanız kesinlikle yasaktır. 
 Lütfen mesajı geri gönderiniz ve sisteminizden siliniz. Likya Bilgi 
 Teknolojileri ve İletişim Hiz. Ltd. Şti. bu mesajın içeriği ile ilgili olarak 
 hiç bir hukuksal sorumluluğu kabul etmez.
  
 This electronic mail and any files transmitted with it are intended for the 
 private use of  the persons named above. If you received this message in 
 error, forwarding, copying or use of any of the information is strictly 
 prohibited. Please immediately notify the sender and delete it from your 
 system. Likya Bilgi Teknolojileri ve İletişim Hiz. Ltd. Şti. does not accept 
 legal responsibility for the contents of this message.
 --
 
 image001.jpg
 
 
 
 P
 Bu e-postayı yazdırmadan önce, çevreye olan sorumluluğunuzu tekrar düşünün.
 Please consider your environmental responsibility before printing this e-mail.
  
 


Re: Getting XMLBeans out of Attic

2013-07-24 Thread Pascal Heus
Daniel and all:
We're using XmlBeans quite a bit and are interested to keep this alive
as well. Would be great to have more information around the Apache
rules/processes, PMC, roles/responsibilities, etc. to understand how we
could support the project.
best
*P

On 7/23/13 5:29 PM, Daniel Lübke wrote:
 Hi list,

 I am a long-time user of XMLBeans, most of the time as part of the
 BPELUnit project. There is no replacement to XMLBeans because in
 contrast to JAXB if preserves namespace declarations so you e.g. read
 and write XML document that contain XPath expressions (e.g. BPEL,
 BPMN2, ...).

 Although I know XMLBeans only from the user perspective, I would
 contribute to it, which includes learning more of its internals, apply
 the outstanding patches, test them and so on.

 As far as I understand the Apache rules a project needs to have a
 working PMC. This means at least 3 people (for substitution 4 or 5
 would be better) which vote on releases. I also would join a new PMC
 if 3 other would be willing to join me and at least build regular
 maintainance releases to keep this project alive and reboot its PMC.

 I know that many other projects use XMLBeans, e.g. Apache Camel,
 Apache CXX Apache ODE, ... and many non-Apache projects, too. So I
 hope that we can find enough interested people to keep this project
 alive.

 If you are one of them, please reply to this list. If we are enough
 people, I would try to talk to the Apache Foundation.

 Regards,
 Daniel

 -
 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: Getting XMLBeans out of Attic

2013-07-24 Thread Nick Burch

On Wed, 24 Jul 2013, Pascal Heus wrote:

We're using XmlBeans quite a bit and are interested to keep this alive
as well. Would be great to have more information around the Apache
rules/processes, PMC, roles/responsibilities, etc. to understand how we
could support the project.


The Apache Community Development project has quite a bit of information on 
that: http://community.apache.org/


If you look online, you'll find quite a few The Apache Way talks as 
slides or videos, which will explain a lot of that, if you prefer to learn 
from talks


Nick

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



Re: Getting XMLBeans out of Attic

2013-07-24 Thread jerry . sy

Hi Daniel,

Please count me in.

Thanks
Jerry

On 7/23/2013 8:29 AM, Daniel Lübke wrote:

Hi list,

I am a long-time user of XMLBeans, most of the time as part of the 
BPELUnit project. There is no replacement to XMLBeans because in 
contrast to JAXB if preserves namespace declarations so you e.g. read 
and write XML document that contain XPath expressions (e.g. BPEL, 
BPMN2, ...).


Although I know XMLBeans only from the user perspective, I would 
contribute to it, which includes learning more of its internals, apply 
the outstanding patches, test them and so on.


As far as I understand the Apache rules a project needs to have a 
working PMC. This means at least 3 people (for substitution 4 or 5 
would be better) which vote on releases. I also would join a new PMC 
if 3 other would be willing to join me and at least build regular 
maintainance releases to keep this project alive and reboot its PMC.


I know that many other projects use XMLBeans, e.g. Apache Camel, 
Apache CXX Apache ODE, ... and many non-Apache projects, too. So I 
hope that we can find enough interested people to keep this project 
alive.


If you are one of them, please reply to this list. If we are enough 
people, I would try to talk to the Apache Foundation.


Regards,
Daniel

-
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: Project still maintained?

2013-07-23 Thread Elvis Stansvik
2013/7/23 Bill Stafford bstaff...@artificialmed.com

 Peter Keller is correct, VTD is no substitute for XMLBeans.  I would class
 the email suggesting that it was as spam.

 The next best approach, if XMLBeans is not an option, would be JAXB.  But
 JAXB is nothing like XMLBeans so I would not call JAXB an equivalent, just
 a substitute.


Since I wrote my first mail I've switched over to JAXB, which is sufficient
for my quite simple needs. But I still feel it's sad that XMLBeans has been
left unmaintained. But I guess it's a fact of life.

Regards,
Elvis


 

 ** **

 -=bill  stafford



Re: Project still maintained?

2013-07-23 Thread Pascal Heus
We're using XmlBeans in several of our projects and haven't found
anything else out there that does the job like it, particularly when it
comes to dealing with substitution groups and other advanced schema
features. Would very much like to see this stay out of the attic!
best
*P

On 7/23/13 3:26 PM, Elvis Stansvik wrote:
 2013/7/23 Bill Stafford bstaff...@artificialmed.com
 mailto:bstaff...@artificialmed.com

 Peter Keller is correct, VTD is no substitute for XMLBeans.  I
 would class the email suggesting that it was as spam.

 The next best approach, if XMLBeans is not an option, would be
 JAXB.  But JAXB is nothing like XMLBeans so I would not call JAXB
 an equivalent, just a substitute.


 Since I wrote my first mail I've switched over to JAXB, which is
 sufficient for my quite simple needs. But I still feel it's sad that
 XMLBeans has been left unmaintained. But I guess it's a fact of life.

 Regards,
 Elvis
  

  

 -=bill  stafford





Re: Project still maintained?

2013-07-23 Thread mARK aNDREWS
Hi all,

I have been working for a Charity for the last 5 years, and we are using
XMLBeans for Marshalling web service calls to Java with Spring-ws.

These has been a very successful approach and have had no real issues with
it.  I know it counts for little, but It would be a massive shame if the
project was to die.

mARK aNDREWS

m/|RK aNDREWS

website: http://www.mraandrews.co.uk
photos:  http://www.flickr.com/photos/mraandrews
twitter:   http://www.twitter.com/mraandrews


On 23 July 2013 14:36, Pascal Heus pascal.h...@gmail.com wrote:

  We're using XmlBeans in several of our projects and haven't found
 anything else out there that does the job like it, particularly when it
 comes to dealing with substitution groups and other advanced schema
 features. Would very much like to see this stay out of the attic!
 best
 *P


 On 7/23/13 3:26 PM, Elvis Stansvik wrote:

 2013/7/23 Bill Stafford bstaff...@artificialmed.com

  Peter Keller is correct, VTD is no substitute for XMLBeans.  I would
 class the email suggesting that it was as spam.

 The next best approach, if XMLBeans is not an option, would be JAXB.  But
 JAXB is nothing like XMLBeans so I would not call JAXB an equivalent, just
 a substitute.


  Since I wrote my first mail I've switched over to JAXB, which is
 sufficient for my quite simple needs. But I still feel it's sad that
 XMLBeans has been left unmaintained. But I guess it's a fact of life.

  Regards,
 Elvis




 -=bill  stafford






Re: Project still maintained?

2013-07-22 Thread Jacob Danner
Hi Elvis,
The XMLBeans project is in the process of moving to the attic
http://www.mail-archive.com/dev%40xmlbeans.apache.org/msg02815.html
-jacobd


On Mon, Jul 22, 2013 at 10:28 AM, Elvis Stansvik elvst...@gmail.com wrote:

 Hi folks,

 I had a look at the bugs reported over the past 6 months (496-503) [1].
 None of these 7 bugs have been assigned to anyone, and none have been
 commented on by a commiter/maintainer.

 Most of them are fairly well described and have test cases/good
 description, or at least an idea of a fix. Two of them include actual
 patches. One of them seems to be a dupe.

 So my question is: Is the project still maintained?

 Not complaining, just interested in what the status is, since use XMLBeans
 and like it a lot.

 Best regards,
 Elvis Stansvik

 [1]
 https://issues.apache.org/jira/issues/?jql=project%20%3D%20XMLBEANS%20AND%20created%20%3E%3D%202013-01-01%20AND%20created%20%3C%3D%202013-07-22%20ORDER%20BY%20created%20DESC%2C%20key%20DESC



RE: Project still maintained?

2013-07-22 Thread Paul Gillen
Once again simplicity, utility, and elegance lose out.

 

Cordially,

Paul Gillen

  _  

 

From: Jacob Danner [mailto:jacob.dan...@gmail.com] 
Sent: Monday, July 22, 2013 1:38 PM
To: user@xmlbeans.apache.org
Subject: Re: Project still maintained?

 

Hi Elvis,

The XMLBeans project is in the process of moving to the attic

http://www.mail-archive.com/dev%40xmlbeans.apache.org/msg02815.html

-jacobd

 

On Mon, Jul 22, 2013 at 10:28 AM, Elvis Stansvik elvst...@gmail.com wrote:

Hi folks,

 

I had a look at the bugs reported over the past 6 months (496-503) [1]. None
of these 7 bugs have been assigned to anyone, and none have been commented
on by a commiter/maintainer.

 

Most of them are fairly well described and have test cases/good description,
or at least an idea of a fix. Two of them include actual patches. One of
them seems to be a dupe.

 

So my question is: Is the project still maintained?

 

Not complaining, just interested in what the status is, since use XMLBeans
and like it a lot.

 

Best regards,

Elvis Stansvik

 

[1]
https://issues.apache.org/jira/issues/?jql=project%20%3D%20XMLBEANS%20AND%20
created%20%3E%3D%202013-01-01%20AND%20created%20%3C%3D%202013-07-22%20ORDER%
20BY%20created%20DESC%2C%20key%20DESC

 



Re: Project still maintained?

2013-07-22 Thread Michael Bishop
This is awfully unfortunate. To my knowledge, there's no comparable product
out there. We're still struggling with a few XMLBeans issues that we've had
to go to straight DOM to work around. I was hoping that future releases
would address some of these issues, but it doesn't appear to be the case.

Michael


On Mon, Jul 22, 2013 at 1:44 PM, Elvis Stansvik elvst...@gmail.com wrote:

 2013/7/22 Jacob Danner jacob.dan...@gmail.com

 Hi Elvis,
 The XMLBeans project is in the process of moving to the attic
 http://www.mail-archive.com/dev%40xmlbeans.apache.org/msg02815.html


 Ah I should have suspected that. That's bad news to me, but
 understandable. I had a small patch I was hoping to get into a 2.6.1
 release.

 Thanks for the quick response.

 Elvis


 -jacobd


 On Mon, Jul 22, 2013 at 10:28 AM, Elvis Stansvik elvst...@gmail.comwrote:

 Hi folks,

 I had a look at the bugs reported over the past 6 months (496-503) [1].
 None of these 7 bugs have been assigned to anyone, and none have been
 commented on by a commiter/maintainer.

 Most of them are fairly well described and have test cases/good
 description, or at least an idea of a fix. Two of them include actual
 patches. One of them seems to be a dupe.

 So my question is: Is the project still maintained?

 Not complaining, just interested in what the status is, since use
 XMLBeans and like it a lot.

 Best regards,
 Elvis Stansvik

 [1]
 https://issues.apache.org/jira/issues/?jql=project%20%3D%20XMLBEANS%20AND%20created%20%3E%3D%202013-01-01%20AND%20created%20%3C%3D%202013-07-22%20ORDER%20BY%20created%20DESC%2C%20key%20DESC






Re: Project still maintained?

2013-07-22 Thread Elvis Stansvik
2013/7/22 Jacob Danner jacob.dan...@gmail.com

 Hi Elvis,
 The XMLBeans project is in the process of moving to the attic
 http://www.mail-archive.com/dev%40xmlbeans.apache.org/msg02815.html


Ah I should have suspected that. That's bad news to me, but understandable.
I had a small patch I was hoping to get into a 2.6.1 release.

Thanks for the quick response.

Elvis


 -jacobd


 On Mon, Jul 22, 2013 at 10:28 AM, Elvis Stansvik elvst...@gmail.comwrote:

 Hi folks,

 I had a look at the bugs reported over the past 6 months (496-503) [1].
 None of these 7 bugs have been assigned to anyone, and none have been
 commented on by a commiter/maintainer.

 Most of them are fairly well described and have test cases/good
 description, or at least an idea of a fix. Two of them include actual
 patches. One of them seems to be a dupe.

 So my question is: Is the project still maintained?

 Not complaining, just interested in what the status is, since use
 XMLBeans and like it a lot.

 Best regards,
 Elvis Stansvik

 [1]
 https://issues.apache.org/jira/issues/?jql=project%20%3D%20XMLBEANS%20AND%20created%20%3E%3D%202013-01-01%20AND%20created%20%3C%3D%202013-07-22%20ORDER%20BY%20created%20DESC%2C%20key%20DESC





Re: Project still maintained?

2013-07-22 Thread Nick Burch

On Mon, 22 Jul 2013, Michael Bishop wrote:
This is awfully unfortunate. To my knowledge, there's no comparable 
product out there. We're still struggling with a few XMLBeans issues 
that we've had to go to straight DOM to work around. I was hoping that 
future releases would address some of these issues, but it doesn't 
appear to be the case.


The project is set to go to the attic as there aren't enough people around 
(on the current PMC) to help maintain it.


If there are new volunteers to help look after it, then it could be saved 
from the attic! If you might be interested in this role, now might be the 
time to read through the resources on http://www.apache.org/dev/ to work 
out what you'd be getting yourself in for, then put yourself forward


Nick
(Who's not on the XMLBeans PMC, but is on other ones)

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



RE: Project still maintained?

2013-07-22 Thread Paul Gillen
The spirit is willing but the coding skills are weak.

Cordially,
Paul Gillen


-Original Message-
From: Nick Burch [mailto:apa...@gagravarr.org] 
Sent: Monday, July 22, 2013 2:00 PM
To: user@xmlbeans.apache.org
Subject: Re: Project still maintained?

On Mon, 22 Jul 2013, Michael Bishop wrote:
 This is awfully unfortunate. To my knowledge, there's no comparable 
 product out there. We're still struggling with a few XMLBeans issues 
 that we've had to go to straight DOM to work around. I was hoping that 
 future releases would address some of these issues, but it doesn't 
 appear to be the case.

The project is set to go to the attic as there aren't enough people around
(on the current PMC) to help maintain it.

If there are new volunteers to help look after it, then it could be saved
from the attic! If you might be interested in this role, now might be the
time to read through the resources on http://www.apache.org/dev/ to work out
what you'd be getting yourself in for, then put yourself forward

Nick
(Who's not on the XMLBeans PMC, but is on other ones)

-
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: Project still maintained?

2013-07-22 Thread Michael Bishop
If I knew the first thing about most of the issues, I'd be more help.
XMLBeans has helped me learn a few things about XML and schemas in general.
Most of our issues are high level; i.e., not just minor bug fixes. For
those interested:

- Documentation on getting XMLBeans to run on the NetBeans platform and/or
an OSGi container would be helpful. With JARs in different modules,
XMLBeans can't find dependent libraries (i.e., finding Saxon to do XPath
queries).

- XMLBeans is advertised as DOM Level 2 compliant, but that doesn't seem to
include the DOM Level 2 event model. In the grand scheme of things, there's
no way I'm aware of to listen for add/edit/remove events in XMLBeans. We've
ended up writing our own and firing the events as needed.

- XML Digital Signatures requires that ID attributes be identified as xs:ID
attributes in the schema. XMLBeans' DOM doesn't support this as it's a DOM
Level 3 feature. Digitally signing documents requires us to reparse the
document as DOM.


If I had the ability to address some of these issues or even provide
guidance, I'd do so. My knowledge to date is that of an end user; I
understand the problem, but not a path to the solution.


On Mon, Jul 22, 2013 at 2:00 PM, Nick Burch apa...@gagravarr.org wrote:

 On Mon, 22 Jul 2013, Michael Bishop wrote:

 This is awfully unfortunate. To my knowledge, there's no comparable
 product out there. We're still struggling with a few XMLBeans issues that
 we've had to go to straight DOM to work around. I was hoping that future
 releases would address some of these issues, but it doesn't appear to be
 the case.


 The project is set to go to the attic as there aren't enough people around
 (on the current PMC) to help maintain it.

 If there are new volunteers to help look after it, then it could be saved
 from the attic! If you might be interested in this role, now might be the
 time to read through the resources on http://www.apache.org/dev/ to work
 out what you'd be getting yourself in for, then put yourself forward

 Nick
 (Who's not on the XMLBeans PMC, but is on other ones)

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




Re: Project still maintained?

2013-07-22 Thread jzhang
I think vtd-xml is quite comparable to xml bean,...

- Original Message -
From: user@xmlbeans.apache.org
To:
Cc:
Sent:Mon, 22 Jul 2013 13:46:37 -0400
Subject:Re: Project still maintained?

This is awfully unfortunate. To my knowledge, there's no comparable
product out there. We're still struggling with a few XMLBeans issues
that we've had to go to straight DOM to work around. I was hoping that
future releases would address some of these issues, but it doesn't
appear to be the case.

Michael

On Mon, Jul 22, 2013 at 1:44 PM, Elvis Stansvik  wrote:
2013/7/22 Jacob Danner 
 Hi Elvis,The XMLBeans project is in the process of moving to the
attichttp://www.mail-archive.com/dev%40xmlbeans.apache.org/msg02815.html
[3] 
Ah I should have suspected that. That's bad news to me, but
understandable. I had a small patch I was hoping to get into a 2.6.1
release.
Thanks for the quick response.  
Elvis

-jacobd

On Mon, Jul 22, 2013 at 10:28 AM, Elvis Stansvik  wrote:
Hi folks,
I had a look at the bugs reported over the past 6 months (496-503)
[1]. None of these 7 bugs have been assigned to anyone, and none have
been commented on by a commiter/maintainer. 
Most of them are fairly well described and have test cases/good
description, or at least an idea of a fix. Two of them include actual
patches. One of them seems to be a dupe.
 So my question is: Is the project still maintained? 
Not complaining, just interested in what the status is, since use
XMLBeans and like it a lot.
Best regards,Elvis Stansvik
[1] 
https://issues.apache.org/jira/issues/?jql=project%20%3D%20XMLBEANS%20AND%20created%20%3E%3D%202013-01-01%20AND%20created%20%3C%3D%202013-07-22%20ORDER%20BY%20created%20DESC%2C%20key%20DESC
[5]  

 

Links:
--
[1] mailto:elvst...@gmail.com
[2] mailto:jacob.dan...@gmail.com
[3]
http://www.mail-archive.com/dev%40xmlbeans.apache.org/msg02815.html
[4] mailto:elvst...@gmail.com
[5]
https://issues.apache.org/jira/issues/?jql=project%20%3D%20XMLBEANS%20AND%20created%20%3E%3D%202013-01-01%20AND%20created%20%3C%3D%202013-07-22%20ORDER%20BY%20created%20DESC%2C%20key%20DESC



Re: Java source escaping

2013-01-31 Thread Andreas Loew

Hi again, Dridi,

see below for more comments... ;-)

Am 28.01.2013 15:43, schrieb Dridi Boukelmoune:

Hi Andreas,

Thank you for your quick answer. I didn't want to go too deep on the
details but I guess I have to :)

I fear so...


On Mon, Jan 28, 2013 at 3:14 PM, Andreas Loew andreas.l...@oracle.com wrote:

Hi Dridi,

Am 28.01.2013 14:57, schrieb Dridi Boukelmoune:


I'm having trouble building a project on Linux because of the classes
generated by XmlBeans. The build works properly on a Solaris platform
using the same tools:

Java : Hotspot 1.5.0_16
Ant : 1.6.5
XmlBeans: 2.3.1.0

For the XmlBeans version, it comes with Weblogic 10.0:
com.bea.core.xml.beaxmlbeans_2.3.1.0.jar
com.bea.core.xquery.xmlbeans-interop_1.0.0.0.jar
com.bea.core.xquery.beaxmlbeans-interop_1.0.0.0.jar
com.bea.core.xml.xmlbeans_2.3.1.0.jar

I hope my problem is not related to Weblogic's version.

I don't think so (see below for the details) - I rather tend to think that
this is a locale/encoding issue in the XSD and/or between those platforms.



So I have an XSD file containing something like:
simpleType name=MyType
  restriction base=string
  enumeration value=A cliché/enumeration
  ...
  /restriction
/simpleType

With Linux, I get this output:
static final Enum A_CLICHÉ = Enum.forString(A cliché);

On the other hand, it produces this on Solaris:
static final Enum A_CLICH\311 = Enum.forString(A clich\351);

The java source code generated on Linux doesn't compile because of an
encoding mess I can't address now, so I'm currently trying to
understand how the code is generated. I haven't found yet which option
leads to either one or the other output that could have different
defaults based on the platform.

I hope someone can help me on this one.

Most probably, sorting out your locale/character encoding issues should
solve the issue.

First and foremost: Does the XSD in question with the French é include an
encoding declaration? Such as

?xml version=1.0 encoding=UTF-8?
xs:schema
 (...)
/xs:schema

Yes it states a wrong UTF-8 encoding when it's actually ISO-8859-15.
Hmm - further below you state you must not modify the source - which 
definitely is needed, because the encoding given in the XSD (if present) 
explicitly overrides any locales detected from the environment.


I was initially assuming that your XSD might not have specified any 
encoding - but if it does, and does so wrongly, clearly this is what 
needs to be changed...


If you must not modify the source, you need the people who are indeed 
maintaining this code to do so. I am not aware of any other workaround 
to override a wrong encoding declaration given in an XSD. That does not 
make real sense, as typically (other than in your very specific 
situation), the simple and easy solution just is to correct the XSD to 
specify the proper encoding...



If it does not, you need to explicitly mention the appropriate encoding of
that file in this place to make this portable.

If you don't, I expect the XMLBeans code generator to use the system's
default locale, which will be calculated on Unix platforms from environment
variables such as LANG, LC_CTYPE etc.?

LANG and LC_CTYPE are used, and part of the encoding mess I was
talking about. A mess because the locale names aren't the same on
Solaris and Linux (locale -a | grep fr_FR). And a mess because we have
a (complicated) shell script that drives the ant build a prepares a
proper environment depending on the project we're building.
Indeed. IMO, your build file should unfortunately need to explicitily 
handle these subtle differences if you want to use it on Solaris and 
Linux, regardless of the fact that even selecting the proper platform 
LANG / LC_CTYPE etc. values won't fix the wrong encoding in the XSD type 
of issue, but will make the rest of the build run in a reproducible way.



Do you call scomp from the command line, or do you use Ant or Maven to call
the code generator?

That would be ant.
Which would be able to take explicit Java encoding as -D command line 
parameter to the ant JVM, but the much better way to fix this is by 
fixing the build file to use correct Unix NLS (LANG /LC_CTYPE etc.) 
settings.



Also, how did you transport/copy the source code from the Solaris to the
Linux machine? Did you copy files in binary mode, or using scp (which might
have done recoding of text files on the fly based on language/encoding
settings on source and target machine)? So you should check that your XSD
files on both machines indeed are binary identical.

It's the same shell script that does a svn checkout after setting the
environment. So LANG and LC_CTYPE are set before the checkout and the
ant build.

Fine.


I hope that you should be able to simply add the appropriate encoding to
your XSD and be fine.

All the projects are built from ISO-8859-15 java sources. Also this is
an old legacy ant project, without any dependency management like ivy.
Fine, therefore your 

Re: Java source escaping

2013-01-31 Thread Dridi Boukelmoune
Hi Andreas,

Thanks, again, though it's the answer I feared :)

I'm really puzzled that it even works on Solaris and I don't
understand why it behaves differently on Linux. I'll try to browse the
source code to understand how the code is generated.

Best Regards,
Dridi

On Thu, Jan 31, 2013 at 3:39 PM, Andreas Loew andreas.l...@oracle.com wrote:
 Hi again, Dridi,

 see below for more comments... ;-)

 Am 28.01.2013 15:43, schrieb Dridi Boukelmoune:

 Hi Andreas,

 Thank you for your quick answer. I didn't want to go too deep on the
 details but I guess I have to :)

 I fear so...


 On Mon, Jan 28, 2013 at 3:14 PM, Andreas Loew andreas.l...@oracle.com
 wrote:

 Hi Dridi,

 Am 28.01.2013 14:57, schrieb Dridi Boukelmoune:

 I'm having trouble building a project on Linux because of the classes
 generated by XmlBeans. The build works properly on a Solaris platform
 using the same tools:

 Java : Hotspot 1.5.0_16
 Ant : 1.6.5
 XmlBeans: 2.3.1.0

 For the XmlBeans version, it comes with Weblogic 10.0:
 com.bea.core.xml.beaxmlbeans_2.3.1.0.jar
 com.bea.core.xquery.xmlbeans-interop_1.0.0.0.jar
 com.bea.core.xquery.beaxmlbeans-interop_1.0.0.0.jar
 com.bea.core.xml.xmlbeans_2.3.1.0.jar

 I hope my problem is not related to Weblogic's version.

 I don't think so (see below for the details) - I rather tend to think
 that
 this is a locale/encoding issue in the XSD and/or between those
 platforms.


 So I have an XSD file containing something like:
 simpleType name=MyType
   restriction base=string
   enumeration value=A cliché/enumeration
   ...
   /restriction
 /simpleType

 With Linux, I get this output:
 static final Enum A_CLICHÉ = Enum.forString(A cliché);

 On the other hand, it produces this on Solaris:
 static final Enum A_CLICH\311 = Enum.forString(A clich\351);

 The java source code generated on Linux doesn't compile because of an
 encoding mess I can't address now, so I'm currently trying to
 understand how the code is generated. I haven't found yet which option
 leads to either one or the other output that could have different
 defaults based on the platform.

 I hope someone can help me on this one.

 Most probably, sorting out your locale/character encoding issues should
 solve the issue.

 First and foremost: Does the XSD in question with the French é include an
 encoding declaration? Such as

 ?xml version=1.0 encoding=UTF-8?
 xs:schema
  (...)
 /xs:schema

 Yes it states a wrong UTF-8 encoding when it's actually ISO-8859-15.

 Hmm - further below you state you must not modify the source - which
 definitely is needed, because the encoding given in the XSD (if present)
 explicitly overrides any locales detected from the environment.

 I was initially assuming that your XSD might not have specified any encoding
 - but if it does, and does so wrongly, clearly this is what needs to be
 changed...

 If you must not modify the source, you need the people who are indeed
 maintaining this code to do so. I am not aware of any other workaround to
 override a wrong encoding declaration given in an XSD. That does not make
 real sense, as typically (other than in your very specific situation), the
 simple and easy solution just is to correct the XSD to specify the proper
 encoding...


 If it does not, you need to explicitly mention the appropriate encoding
 of
 that file in this place to make this portable.

 If you don't, I expect the XMLBeans code generator to use the system's
 default locale, which will be calculated on Unix platforms from
 environment
 variables such as LANG, LC_CTYPE etc.?

 LANG and LC_CTYPE are used, and part of the encoding mess I was
 talking about. A mess because the locale names aren't the same on
 Solaris and Linux (locale -a | grep fr_FR). And a mess because we have
 a (complicated) shell script that drives the ant build a prepares a
 proper environment depending on the project we're building.

 Indeed. IMO, your build file should unfortunately need to explicitily handle
 these subtle differences if you want to use it on Solaris and Linux,
 regardless of the fact that even selecting the proper platform LANG /
 LC_CTYPE etc. values won't fix the wrong encoding in the XSD type of issue,
 but will make the rest of the build run in a reproducible way.


 Do you call scomp from the command line, or do you use Ant or Maven to
 call
 the code generator?

 That would be ant.

 Which would be able to take explicit Java encoding as -D command line
 parameter to the ant JVM, but the much better way to fix this is by fixing
 the build file to use correct Unix NLS (LANG /LC_CTYPE etc.) settings.


 Also, how did you transport/copy the source code from the Solaris to the
 Linux machine? Did you copy files in binary mode, or using scp (which
 might
 have done recoding of text files on the fly based on language/encoding
 settings on source and target machine)? So you should check that your XSD
 files on both machines indeed are binary identical.

 

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: MyDocument can't be cast to MyDocumentImpl?

2013-01-30 Thread Michael Bishop
Hi Cezar,

I couldn't do it on the command line because it's a NetBeans module and
needs a NetBeans platform to run. I did the next best thing and wrote a
unit test around it. For whatever reason, you're correct. While writing
code in the test package, I noticed two instances of the same classes from
auto-completed import statements. In the actual source (not test) package,
only one instance of the class appeared. I don't know exactly how NetBeans
platform applications work with class loading in this regard. I could find
no reason that this class appeared in a unit test and not the live
application. I have a legacy suite in this NetBeans application where
older modules are stored. I have no idea why or how these classes are being
referenced, but they are. I removed the offending module from the legacy
suite and things worked fine.

Long story short, odd, NetBeans-related problem that took me some time to
track down. I still don't know the why, but the problem is eliminated.


On Wed, Jan 30, 2013 at 1:26 PM, Cezar Andrei cezar.and...@oracle.comwrote:

 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: Java source escaping

2013-01-28 Thread Andreas Loew

Hi Dridi,

Am 28.01.2013 14:57, schrieb Dridi Boukelmoune:

I'm having trouble building a project on Linux because of the classes
generated by XmlBeans. The build works properly on a Solaris platform
using the same tools:

Java : Hotspot 1.5.0_16
Ant : 1.6.5
XmlBeans: 2.3.1.0

For the XmlBeans version, it comes with Weblogic 10.0:
com.bea.core.xml.beaxmlbeans_2.3.1.0.jar
com.bea.core.xquery.xmlbeans-interop_1.0.0.0.jar
com.bea.core.xquery.beaxmlbeans-interop_1.0.0.0.jar
com.bea.core.xml.xmlbeans_2.3.1.0.jar

I hope my problem is not related to Weblogic's version.
I don't think so (see below for the details) - I rather tend to think 
that this is a locale/encoding issue in the XSD and/or between those 
platforms.



So I have an XSD file containing something like:
simpleType name=MyType
 restriction base=string
 enumeration value=A cliché/enumeration
 ...
 /restriction
/simpleType

With Linux, I get this output:
static final Enum A_CLICHÉ = Enum.forString(A cliché);

On the other hand, it produces this on Solaris:
static final Enum A_CLICH\311 = Enum.forString(A clich\351);

The java source code generated on Linux doesn't compile because of an
encoding mess I can't address now, so I'm currently trying to
understand how the code is generated. I haven't found yet which option
leads to either one or the other output that could have different
defaults based on the platform.

I hope someone can help me on this one.
Most probably, sorting out your locale/character encoding issues should 
solve the issue.


First and foremost: Does the XSD in question with the French é include 
an encoding declaration? Such as


?xml version=1.0 encoding=UTF-8?
xs:schema
(...)
/xs:schema

If it does not, you need to explicitly mention the appropriate encoding 
of that file in this place to make this portable.


If you don't, I expect the XMLBeans code generator to use the system's 
default locale, which will be calculated on Unix platforms from 
environment variables such as LANG, LC_CTYPE etc.?


Do you call scomp from the command line, or do you use Ant or Maven to 
call the code generator?


Also, how did you transport/copy the source code from the Solaris to the 
Linux machine? Did you copy files in binary mode, or using scp (which 
might have done recoding of text files on the fly based on 
language/encoding settings on source and target machine)? So you should 
check that your XSD files on both machines indeed are binary identical.


I hope that you should be able to simply add the appropriate encoding to 
your XSD and be fine.


Hope this helps  best regards,
Andreas

--
Andreas Loew | Senior Java Architect
Oracle Advanced Customer Services
ORACLE Germany


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



Re: Java source escaping

2013-01-28 Thread Dridi Boukelmoune
Hi Andreas,

Thank you for your quick answer. I didn't want to go too deep on the
details but I guess I have to :)

On Mon, Jan 28, 2013 at 3:14 PM, Andreas Loew andreas.l...@oracle.com wrote:
 Hi Dridi,

 Am 28.01.2013 14:57, schrieb Dridi Boukelmoune:

 I'm having trouble building a project on Linux because of the classes
 generated by XmlBeans. The build works properly on a Solaris platform
 using the same tools:

 Java : Hotspot 1.5.0_16
 Ant : 1.6.5
 XmlBeans: 2.3.1.0

 For the XmlBeans version, it comes with Weblogic 10.0:
 com.bea.core.xml.beaxmlbeans_2.3.1.0.jar
 com.bea.core.xquery.xmlbeans-interop_1.0.0.0.jar
 com.bea.core.xquery.beaxmlbeans-interop_1.0.0.0.jar
 com.bea.core.xml.xmlbeans_2.3.1.0.jar

 I hope my problem is not related to Weblogic's version.

 I don't think so (see below for the details) - I rather tend to think that
 this is a locale/encoding issue in the XSD and/or between those platforms.


 So I have an XSD file containing something like:
 simpleType name=MyType
  restriction base=string
  enumeration value=A cliché/enumeration
  ...
  /restriction
 /simpleType

 With Linux, I get this output:
 static final Enum A_CLICHÉ = Enum.forString(A cliché);

 On the other hand, it produces this on Solaris:
 static final Enum A_CLICH\311 = Enum.forString(A clich\351);

 The java source code generated on Linux doesn't compile because of an
 encoding mess I can't address now, so I'm currently trying to
 understand how the code is generated. I haven't found yet which option
 leads to either one or the other output that could have different
 defaults based on the platform.

 I hope someone can help me on this one.

 Most probably, sorting out your locale/character encoding issues should
 solve the issue.

 First and foremost: Does the XSD in question with the French é include an
 encoding declaration? Such as

 ?xml version=1.0 encoding=UTF-8?
 xs:schema
 (...)
 /xs:schema

Yes it states a wrong UTF-8 encoding when it's actually ISO-8859-15.

 If it does not, you need to explicitly mention the appropriate encoding of
 that file in this place to make this portable.

 If you don't, I expect the XMLBeans code generator to use the system's
 default locale, which will be calculated on Unix platforms from environment
 variables such as LANG, LC_CTYPE etc.?


LANG and LC_CTYPE are used, and part of the encoding mess I was
talking about. A mess because the locale names aren't the same on
Solaris and Linux (locale -a | grep fr_FR). And a mess because we have
a (complicated) shell script that drives the ant build a prepares a
proper environment depending on the project we're building.

 Do you call scomp from the command line, or do you use Ant or Maven to call
 the code generator?


That would be ant.

 Also, how did you transport/copy the source code from the Solaris to the
 Linux machine? Did you copy files in binary mode, or using scp (which might
 have done recoding of text files on the fly based on language/encoding
 settings on source and target machine)? So you should check that your XSD
 files on both machines indeed are binary identical.


It's the same shell script that does a svn checkout after setting the
environment. So LANG and LC_CTYPE are set before the checkout and the
ant build.

 I hope that you should be able to simply add the appropriate encoding to
 your XSD and be fine.


All the projects are built from ISO-8859-15 java sources. Also this is
an old legacy ant project, without any dependency management like ivy.
There is one single project that is built from UTF-8 java sources. It
has a dependency on common classes generated from a bogus ISO-8859-15
XSD. So it builds on Solaris (a miracle) because the java code is
escaped, which results in a simple ASCII file, compatible with UTF-8.

I can't modify the source code for contractual reasons, the only thing
I can do so far is tweaking the environment. That's why I was
wondering if it could be some feature with a default value varying on
the platform (environment variable, system property, jvm flag...).

Best Regards,
Dridi

 Hope this helps  best regards,
 Andreas

 --
 Andreas Loew | Senior Java Architect
 Oracle Advanced Customer Services
 ORACLE Germany


-
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-15 Thread badger mailinglist
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 use the SchemaTypeLoader.parse method, I struggle to get information
 about the schema from that object. I want to iterate through the attributes
 and elements declared in the XSD I'm parsing, but all I seem to get is w3
 xml schema stuff. Am I trying to do something that isn't supported, or am I
 just doing it wrong?

 Any help much appreciated,

 Cheers,

 Badger.

 On 8 January 2013 15:42, badger mailinglist badger.mailing.l...@gmail.com
 wrote:

 Hi,

 Currently, I take some XSDs (see below for example), generate classes for
 them (with scomp -out generatedClasses.jar testschema.xsd), then use those
 classes in code with some like:
 final XmlObject instance =
 TestSchemaDocument.Factory.newInstance(xmlOptions);

 This process now needs to be a bit more dynamic, so I'm trying to use
 something more like the following:

 final SchemaTypeLoader loader =
 XmlBeans.typeLoaderForClassLoader(SchemaDocument.class.getClassLoader());
 XmlOptions xmlOptions = new XmlOptions();
 final XmlObject fileParsedInstance = loader.parse(new
 File(C:\\testschema.xsd), null, new XmlOptions());


 However, I would expect the XmlObject returned in both cases to be the
 same. However, if I recursively iterate through the properties of these two
 objects, I get different results i.e. calling
 instance.schemaType().getProperties() gets different results in each of the
 cases.
 For the instance loaded from the class the getProperties() method returns
 one element with type 'TestSchema', which itself returns one element with
 type 'TestType' and so on as you recur.
 For the instance loaded directly from the xsd file the properties are all
 things like E=restriction|D=restriction@http

Re: using xmlbeans on client side (in conjunction with axis2); null returns although data is available

2012-11-26 Thread Tim Watts
On Mon, 2012-11-26 at 08:37 +0100, moh.sushi wrote:
 Hello together,
 
 i have a problem with using xmlbeans.
 Following situation is given.
 
 - remote wsdl available (see http://pastebin.com/5qnFScMx)
 - code generation using axis2 and databinding xmlbeans
 
 i can do a request and i get a response, too.
 
 The problem is while iterating through given response.
 I just want to get part of the response with xmlbeans therefore i post
 the question on this mailing list.
 
 this is toString-ouput of the response:
 
 (1)
 GetImageURLResponse xmlns=https://recettage.ria.neopod.fm-ged.com/ws;
   xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/;
   xmlns:xsd=http://www.w3.org/2001/XMLSchema;
   xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   return
   CODE_ORDERxyz/CODE_ORDER
   PICTURES
   item
   OCD2011-10-20/OCD
   PICTURE_ID1/PICTURE_ID
   URLhttps://host.fr/images/1.jpg/URL
   SCAN_DATE2011-11-18/SCAN_DATE
   /item
   item
   OCD2011-10-20/OCD
   PICTURE_ID2/PICTURE_ID
   URLhttps://host.fr/images/2.jpg/URL
   SCAN_DATE2011-10-31/SCAN_DATE
   /item
   item
   OCD2011-10-20/OCD
   PICTURE_ID3/PICTURE_ID
   URLhttps://host.fr/images/3.jpg/URL
   SCAN_DATE2011-11-18/SCAN_DATE
   /item
   /PICTURES
   /return
 /GetImageURLResponse
 
 the toString output of the return fragement
 (2)
 xml-fragment xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/;
 xmlns:xsd=http://www.w3.org/2001/XMLSchema;
 xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:ws=https://recettage.ria.neopod.fm-ged.com/ws;
   ws:return
   ws:CODE_ORDERyxz/ws:CODE_ORDER
   ws:PICTURES
   ws:item
   ws:OCD2011-10-20/ws:OCD
   ws:PICTURE_ID1/ws:PICTURE_ID
   ws:URLhttps://host.fr/images/1.jpg/ws:URL
   ws:SCAN_DATE2011-11-18/ws:SCAN_DATE
   /ws:item
   ws:item
   ws:OCD2011-10-20/ws:OCD
   ws:PICTURE_ID2/ws:PICTURE_ID
   ws:URLhttps://host.fr/images/2.jpg/ws:URL
   ws:SCAN_DATE2011-10-31/ws:SCAN_DATE
   /ws:item
   ws:item
   ws:OCD2011-10-20/ws:OCD
   ws:PICTURE_ID3/ws:PICTURE_ID
   ws:URLhttps://host.fr/images/3.jpg/ws:URL
   ws:SCAN_DATE2011-11-18/ws:SCAN_DATE
   /ws:item
   /ws:PICTURES
   /ws:return
 /xml-fragment
 
 
 Following code snippet i use:
 fully object GetImageURLResponseDocument response is given  (see 1)
 GetImageURLResponse imageResponse = response.getGetImageURLResponse();  (see 
 2)
 Order order = imageResponse.getReturn();  ==  null returns
 
 method body of getReturn is :
 public com.fm_ged.neopod.ria.recettage.ws.Order getReturn()
 {
 synchronized (monitor())
 {
 check_orphaned();
 com.fm_ged.neopod.ria.recettage.ws.Order target = null;
 target =
 (com.fm_ged.neopod.ria.recettage.ws.Order)get_store().find_element_user(RETURN$0,
 0);   = nothing is found therefore null
 if (target == null)
 {
 return null;
 }
 return target;
 }
 }
 
 The variable RETURN$0 is:
 private static final javax.xml.namespace.QName RETURN$0 = new
 javax.xml.namespace.QName(, return);
 

I think you need to use https://recettage.ria.neopod.fm-ged.com/ws; in
the first QName arg above.

 i use
 Axis 1.6.0
 xmlbeans-2.3.0.jar
 
 What is going wrong?
 Is the server response maybe wrong?
 Something wrong on my client side?
 
 Any help is appreciated!
 
 Thanks in advance!
 
 
 Regards,
 Sascha
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 



signature.asc
Description: This is a digitally signed message part


Re: using xmlbeans on client side (in conjunction with axis2); null returns although data is available

2012-11-26 Thread moh.sushi
Hi Tim,

thank yor for your answer.

going into generated source code, apply
https://recettage.ria.neopod.fm-ged.com/ws; in first arg for qname
= private static final javax.xml.namespace.QName RETURN$0 =
new
javax.xml.namespace.QName(https://recettage.ria.neopod.fm-ged.com/ws;,
return);

Repack jar-file (of generated classes)

and start test

Unfortunately, test fails
= java.lang.ClassCastException:
org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be cast to
com.fm_ged.neopod.ria.recettage.ws.Order
at 
com.fm_ged.neopod.ria.recettage.ws.impl.GetImageURLResponseDocumentImpl$GetImageURLResponseImpl.getReturn(GetImageURLResponseDocumentImpl.java:102)



Regards,
Sascha



On Mon, Nov 26, 2012 at 12:09 PM, Tim Watts t...@cliftonfarm.org wrote:
 On Mon, 2012-11-26 at 08:37 +0100, moh.sushi wrote:
 Hello together,

 i have a problem with using xmlbeans.
 Following situation is given.

 - remote wsdl available (see http://pastebin.com/5qnFScMx)
 - code generation using axis2 and databinding xmlbeans

 i can do a request and i get a response, too.

 The problem is while iterating through given response.
 I just want to get part of the response with xmlbeans therefore i post
 the question on this mailing list.

 this is toString-ouput of the response:

 (1)
 GetImageURLResponse xmlns=https://recettage.ria.neopod.fm-ged.com/ws;
   xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/;
   xmlns:xsd=http://www.w3.org/2001/XMLSchema;
   xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   return
   CODE_ORDERxyz/CODE_ORDER
   PICTURES
   item
   OCD2011-10-20/OCD
   PICTURE_ID1/PICTURE_ID
   URLhttps://host.fr/images/1.jpg/URL
   SCAN_DATE2011-11-18/SCAN_DATE
   /item
   item
   OCD2011-10-20/OCD
   PICTURE_ID2/PICTURE_ID
   URLhttps://host.fr/images/2.jpg/URL
   SCAN_DATE2011-10-31/SCAN_DATE
   /item
   item
   OCD2011-10-20/OCD
   PICTURE_ID3/PICTURE_ID
   URLhttps://host.fr/images/3.jpg/URL
   SCAN_DATE2011-11-18/SCAN_DATE
   /item
   /PICTURES
   /return
 /GetImageURLResponse

 the toString output of the return fragement
 (2)
 xml-fragment xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/;
 xmlns:xsd=http://www.w3.org/2001/XMLSchema;
 xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:ws=https://recettage.ria.neopod.fm-ged.com/ws;
   ws:return
   ws:CODE_ORDERyxz/ws:CODE_ORDER
   ws:PICTURES
   ws:item
   ws:OCD2011-10-20/ws:OCD
   ws:PICTURE_ID1/ws:PICTURE_ID
   ws:URLhttps://host.fr/images/1.jpg/ws:URL
   ws:SCAN_DATE2011-11-18/ws:SCAN_DATE
   /ws:item
   ws:item
   ws:OCD2011-10-20/ws:OCD
   ws:PICTURE_ID2/ws:PICTURE_ID
   ws:URLhttps://host.fr/images/2.jpg/ws:URL
   ws:SCAN_DATE2011-10-31/ws:SCAN_DATE
   /ws:item
   ws:item
   ws:OCD2011-10-20/ws:OCD
   ws:PICTURE_ID3/ws:PICTURE_ID
   ws:URLhttps://host.fr/images/3.jpg/ws:URL
   ws:SCAN_DATE2011-11-18/ws:SCAN_DATE
   /ws:item
   /ws:PICTURES
   /ws:return
 /xml-fragment


 Following code snippet i use:
 fully object GetImageURLResponseDocument response is given  (see 1)
 GetImageURLResponse imageResponse = response.getGetImageURLResponse();  (see 
 2)
 Order order = imageResponse.getReturn();  ==  null returns

 method body of getReturn is :
 public com.fm_ged.neopod.ria.recettage.ws.Order getReturn()
 {
 synchronized (monitor())
 {
 check_orphaned();
 com.fm_ged.neopod.ria.recettage.ws.Order target = null;
 target =
 (com.fm_ged.neopod.ria.recettage.ws.Order)get_store().find_element_user(RETURN$0,
 0);   = nothing is found therefore null
 if (target == null)
 {
 return null;
 }
 return target;
 }
 }

 The variable RETURN$0 is:
 private static final javax.xml.namespace.QName RETURN$0 = new
 

Re: using xmlbeans on client side (in conjunction with axis2); null returns although data is available

2012-11-26 Thread Tim Watts
On Mon, 2012-11-26 at 12:40 +0100, moh.sushi wrote:
 Hi Tim,
 
 thank yor for your answer.
 
 going into generated source code, apply
 https://recettage.ria.neopod.fm-ged.com/ws; in first arg for qname
 = private static final javax.xml.namespace.QName RETURN$0 =
 new
 javax.xml.namespace.QName(https://recettage.ria.neopod.fm-ged.com/ws;,
 return);
 
 Repack jar-file (of generated classes)
 
 and start test
 
 Unfortunately, test fails
 = java.lang.ClassCastException:
 org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be cast to
 com.fm_ged.neopod.ria.recettage.ws.Order
   at 
 com.fm_ged.neopod.ria.recettage.ws.impl.GetImageURLResponseDocumentImpl$GetImageURLResponseImpl.getReturn(GetImageURLResponseDocumentImpl.java:102)
 

Well, you shouldn't have to monkey with the generated code like that.
If it wasn't generated correctly you need to look into why that's
happening.  The ClassCastException may just be another side effect of
incorrectly generated code.

Another possibility is to make sure the client has
schemaorg_apache_xmlbeans available in its classpath.  This should be
produced from the xmlbeans compiler.  I'm no expert but I think the
XmlAnyType is what xmlbeans uses when it can't map an xml doc to a
schema and thus a bean type.  Which suggests the client may not have
these in its classpath (even if they're physically present on the
client).  But if it's in the root of the client jar and you're running
this from the jar then that should be sufficient.

Also, maybe consider using the latest version of XmlBeans if possible.
I've been using v2.5.0 so I may be talking apples to your oranges.

 
 
 Regards,
 Sascha
 
 
 
 On Mon, Nov 26, 2012 at 12:09 PM, Tim Watts t...@cliftonfarm.org wrote:
  On Mon, 2012-11-26 at 08:37 +0100, moh.sushi wrote:
  Hello together,
 
  i have a problem with using xmlbeans.
  Following situation is given.
 
  - remote wsdl available (see http://pastebin.com/5qnFScMx)
  - code generation using axis2 and databinding xmlbeans
 
  i can do a request and i get a response, too.
 
  The problem is while iterating through given response.
  I just want to get part of the response with xmlbeans therefore i post
  the question on this mailing list.
 
  this is toString-ouput of the response:
 
  (1)
  GetImageURLResponse xmlns=https://recettage.ria.neopod.fm-ged.com/ws;
xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/;
xmlns:xsd=http://www.w3.org/2001/XMLSchema;
xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
return
CODE_ORDERxyz/CODE_ORDER
PICTURES
item
OCD2011-10-20/OCD
PICTURE_ID1/PICTURE_ID
URLhttps://host.fr/images/1.jpg/URL
SCAN_DATE2011-11-18/SCAN_DATE
/item
item
OCD2011-10-20/OCD
PICTURE_ID2/PICTURE_ID
URLhttps://host.fr/images/2.jpg/URL
SCAN_DATE2011-10-31/SCAN_DATE
/item
item
OCD2011-10-20/OCD
PICTURE_ID3/PICTURE_ID
URLhttps://host.fr/images/3.jpg/URL
SCAN_DATE2011-11-18/SCAN_DATE
/item
/PICTURES
/return
  /GetImageURLResponse
 
  the toString output of the return fragement
  (2)
  xml-fragment xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/;
  xmlns:xsd=http://www.w3.org/2001/XMLSchema;
  xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xmlns:ws=https://recettage.ria.neopod.fm-ged.com/ws;
ws:return
ws:CODE_ORDERyxz/ws:CODE_ORDER
ws:PICTURES
ws:item
ws:OCD2011-10-20/ws:OCD
ws:PICTURE_ID1/ws:PICTURE_ID
ws:URLhttps://host.fr/images/1.jpg/ws:URL
ws:SCAN_DATE2011-11-18/ws:SCAN_DATE
/ws:item
ws:item
ws:OCD2011-10-20/ws:OCD
ws:PICTURE_ID2/ws:PICTURE_ID
ws:URLhttps://host.fr/images/2.jpg/ws:URL
ws:SCAN_DATE2011-10-31/ws:SCAN_DATE
/ws:item
ws:item
ws:OCD2011-10-20/ws:OCD
ws:PICTURE_ID3/ws:PICTURE_ID
ws:URLhttps://host.fr/images/3.jpg/ws:URL

Re: using xmlbeans on client side (in conjunction with axis2); null returns although data is available

2012-11-26 Thread Jacob Danner
Have you tried validating the payload? If there are errors that could
indicate what is causing the error.
Otherwise, I've only used XMLBeans with document/literal webservices
and I don't remember how rpc encoded array are handled.
-jacobd

On Mon, Nov 26, 2012 at 9:32 PM, Tim Watts t...@cliftonfarm.org wrote:
 On Mon, 2012-11-26 at 12:40 +0100, moh.sushi wrote:
 Hi Tim,

 thank yor for your answer.

 going into generated source code, apply
 https://recettage.ria.neopod.fm-ged.com/ws; in first arg for qname
 = private static final javax.xml.namespace.QName RETURN$0 =
 new
 javax.xml.namespace.QName(https://recettage.ria.neopod.fm-ged.com/ws;,
 return);

 Repack jar-file (of generated classes)

 and start test

 Unfortunately, test fails
 = java.lang.ClassCastException:
 org.apache.xmlbeans.impl.values.XmlAnyTypeImpl cannot be cast to
 com.fm_ged.neopod.ria.recettage.ws.Order
   at 
 com.fm_ged.neopod.ria.recettage.ws.impl.GetImageURLResponseDocumentImpl$GetImageURLResponseImpl.getReturn(GetImageURLResponseDocumentImpl.java:102)


 Well, you shouldn't have to monkey with the generated code like that.
 If it wasn't generated correctly you need to look into why that's
 happening.  The ClassCastException may just be another side effect of
 incorrectly generated code.

 Another possibility is to make sure the client has
 schemaorg_apache_xmlbeans available in its classpath.  This should be
 produced from the xmlbeans compiler.  I'm no expert but I think the
 XmlAnyType is what xmlbeans uses when it can't map an xml doc to a
 schema and thus a bean type.  Which suggests the client may not have
 these in its classpath (even if they're physically present on the
 client).  But if it's in the root of the client jar and you're running
 this from the jar then that should be sufficient.

 Also, maybe consider using the latest version of XmlBeans if possible.
 I've been using v2.5.0 so I may be talking apples to your oranges.



 Regards,
 Sascha



 On Mon, Nov 26, 2012 at 12:09 PM, Tim Watts t...@cliftonfarm.org wrote:
  On Mon, 2012-11-26 at 08:37 +0100, moh.sushi wrote:
  Hello together,
 
  i have a problem with using xmlbeans.
  Following situation is given.
 
  - remote wsdl available (see http://pastebin.com/5qnFScMx)
  - code generation using axis2 and databinding xmlbeans
 
  i can do a request and i get a response, too.
 
  The problem is while iterating through given response.
  I just want to get part of the response with xmlbeans therefore i post
  the question on this mailing list.
 
  this is toString-ouput of the response:
 
  (1)
  GetImageURLResponse xmlns=https://recettage.ria.neopod.fm-ged.com/ws;
xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/;
xmlns:xsd=http://www.w3.org/2001/XMLSchema;
xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
return
CODE_ORDERxyz/CODE_ORDER
PICTURES
item
OCD2011-10-20/OCD
PICTURE_ID1/PICTURE_ID
URLhttps://host.fr/images/1.jpg/URL
SCAN_DATE2011-11-18/SCAN_DATE
/item
item
OCD2011-10-20/OCD
PICTURE_ID2/PICTURE_ID
URLhttps://host.fr/images/2.jpg/URL
SCAN_DATE2011-10-31/SCAN_DATE
/item
item
OCD2011-10-20/OCD
PICTURE_ID3/PICTURE_ID
URLhttps://host.fr/images/3.jpg/URL
SCAN_DATE2011-11-18/SCAN_DATE
/item
/PICTURES
/return
  /GetImageURLResponse
 
  the toString output of the return fragement
  (2)
  xml-fragment xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/;
  xmlns:xsd=http://www.w3.org/2001/XMLSchema;
  xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xmlns:ws=https://recettage.ria.neopod.fm-ged.com/ws;
ws:return
ws:CODE_ORDERyxz/ws:CODE_ORDER
ws:PICTURES
ws:item
ws:OCD2011-10-20/ws:OCD
ws:PICTURE_ID1/ws:PICTURE_ID

  ws:URLhttps://host.fr/images/1.jpg/ws:URL
ws:SCAN_DATE2011-11-18/ws:SCAN_DATE
/ws:item
ws:item
ws:OCD2011-10-20/ws:OCD
ws:PICTURE_ID2/ws:PICTURE_ID

  ws:URLhttps://host.fr/images/2.jpg/ws:URL

Re: CDATA saving problem

2012-11-14 Thread VikingBlue

I tried with Following code, but nothing works, what did I miss?

XmlOptions xmlOptions = new XmlOptions();
xmlOptions.setUseCDataBookmarks();
xmlOptions.setSaveCDataEntityCountThreshold(0);
xmlOptions.setSaveCDataLengthThreshold(1);
XmlObject response = XmlObject.Factory.newInstance(xmlOptions);


NotesType.Note note = response.addNewNoteTyp();
XmlCursor c = note.newCursor();
c.toFirstChild();
c.toNextToken();
c.setBookmark(CDataBookmark.CDATA_BOOKMARK);
c.dispose();
note.setStringValue(testing);




Jerry Sy wrote:
 
 You also need to set setUseCDataBookmarks option to true as well. If 
 your original xml contains CDATA, that option will ensure it is retained 
 and will be present when you save the XML.
 As for setSaveCDataLengthThreshold and setSaveCDataEntityCountThreshold, 
 both conditions must be satisfied for CDATA tag to be added.
 
 Jerry
 
 On 07/27/2012 02:05 AM, Jurica Krizanic wrote:
 Hello,
 I am uxing XMLBeans 2.5.0 and having an issue with saving XML to the 
 file..
 When the XML is saved to the file, CDATA section marks are removed, 
 but content inside the CDATA remains in the file.

 I would like CDATA marks also remain in the file.

 I was trying to set XMLOptions with setSaveCDataLengthThreshold() and 
 setSaveCDataEntityCountThreshold() methods,
 browsing through already asked questions on the mailing list, but I 
 can't get it work correctly.

 Can someone provide any help?


 Thank you in advance!

 Best regards,
 Jurica Krizanic




 
 

-- 
View this message in context: 
http://old.nabble.com/CDATA-saving-problem-tp34219622p34681301.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


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



Re: XmlBeans dependency for XMLBeans-XPath

2012-11-02 Thread Cyrille P.

Yes i try using http://repo.maven.apache.org/maven2/org/apache/xmlbeans/ and
there is still the bugs.
http://search.maven.org seems to be the search interface for
http://repo.maven.apache.org

Cyrille

Cezar Andrei-3 wrote:
 
 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
 
 
 

-- 
View this message in context: 
http://old.nabble.com/XmlBeans-dependency-for-XMLBeans-XPath-tp34601143p34632214.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


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



Re: 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-30 Thread Cyrille P.

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
 
 
 
-- 
View this message in context: 
http://old.nabble.com/XmlBeans-dependency-for-XMLBeans-XPath-tp34601143p34618733.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


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



Re: 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



RE:

2012-09-26 Thread buzz lightyear

Hi Jacob,
Thanks for that - very grateful. I downloaded the revision and ran a build dist 
and found the generated files in builddir/build/src
Fantastic, thanks again,
Nick

 Date: Tue, 25 Sep 2012 10:44:25 -0700
 Subject: Re:
 From: jacob.dan...@gmail.com
 To: user@xmlbeans.apache.org
 CC: buzzheavyy...@hotmail.com
 
 Hi Nick,
 If you look in the manifest from oldxbean.jar you can get the svn info
 for the sources that were used to create the jar. In the latest trunk
 I see something like
 Apache XmlBeans version 2.3.0-r532896
  which means you could grab the r532896 revision and that should have
 the sources you are looking for.
 oldxbean.jar is used to 'bootstrap' the build and I used to have a
 much better understanding of what that meant exactly. I vaguely
 remember it had something to do with needing to compile the main
 schema xsd's as part of the build.
 
 HTH,
 -jacobd
 
 On Tue, Sep 25, 2012 at 10:07 AM, buzz lightyear
 buzzheavyy...@hotmail.com wrote:
  Hi,
 
  I've spent most of the day trying to track down the source of oldxbean.jar,
  in particular the source of the org.apache.xmlbeans.impl.xb package. Could
  somebody possibly point me in the right direction to a source archive. I've
  pulled down all of the archived xmlbeans distributions - no luck.
 
  Very grateful for any kind of answer - it's been a long day.
 
  Thanks in advance,
 
  Nick
 
 -
 To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org
 For additional commands, e-mail: user-h...@xmlbeans.apache.org
 
  

Re:

2012-09-25 Thread Jacob Danner
Hi Nick,
If you look in the manifest from oldxbean.jar you can get the svn info
for the sources that were used to create the jar. In the latest trunk
I see something like
Apache XmlBeans version 2.3.0-r532896
 which means you could grab the r532896 revision and that should have
the sources you are looking for.
oldxbean.jar is used to 'bootstrap' the build and I used to have a
much better understanding of what that meant exactly. I vaguely
remember it had something to do with needing to compile the main
schema xsd's as part of the build.

HTH,
-jacobd

On Tue, Sep 25, 2012 at 10:07 AM, buzz lightyear
buzzheavyy...@hotmail.com wrote:
 Hi,

 I've spent most of the day trying to track down the source of oldxbean.jar,
 in particular the source of the org.apache.xmlbeans.impl.xb package. Could
 somebody possibly point me in the right direction to a source archive. I've
 pulled down all of the archived xmlbeans distributions - no luck.

 Very grateful for any kind of answer - it's been a long day.

 Thanks in advance,

 Nick

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



Re: Trying to find a nice XML Bean with generic put functionality

2012-08-26 Thread Jacob Danner
I can't say I've needed xmlbeans for this, but I've used free marker
templates to do something similar based on map key/values.
Would that work for you?
-jacobd
On Aug 25, 2012 8:29 PM, Craig Burlock craig.burl...@gmail.com wrote:

 Hello everyone!

 Does anyone know of a bean / object with a put method that is designed
 to be XMLizable using the key name and it's value object?

 Something like this:

 *BeanObject root = new BeanObject();
 beanObject.put(name, Joe Smith);
 beanObject.put(gender, Male);
 beanObject.put(age, 22);*

 ...will produce this xml:

 *root
   nameJoe Smith/name
   genderMale/gender
   age22/age
 /root*

 I'm certain I've used a Java Object that does this may moons ago.

 The standard Java Map kinda works, but it produces excessive nodes and the
 node names aren't based on the key.

 I am wanting something generic because I would like to avoid creating new
 classes just so my xml is clean...

 Can anyone help me find the Object I am looking for (or is this my version
 of Skittle-Brew)?





Re: [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-11 Thread Pascal Heus
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



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

2012-08-09 Thread Dennis Sherman
+0

--
Dennis R. Sherman
Ex Libris (USA)Inc.
847-227-4840
dennis.sher...@exlibrisgroup.com
http://www.exlibrisgroup.com



 -Original Message-
 From: Cezar Andrei [mailto:cezar.and...@oracle.com]
 Sent: Wednesday, August 08, 2012 7:07 PM
 To: d...@xmlbeans.apache.org
 Cc: user@xmlbeans.apache.org
 Subject: Re: [VOTE] XMLBeans v2.6.0-RC3 to become official release
 
 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-09 Thread jerry . sy

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

On 08/08/2012 05: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: 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
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: [VOTE] XMLBeans v2.6.0-RC3 to become official release

2012-08-08 Thread Pascal Heus
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



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



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



Re: CDATA saving problem

2012-07-27 Thread jerry . sy
You also need to set setUseCDataBookmarks option to true as well. If 
your original xml contains CDATA, that option will ensure it is retained 
and will be present when you save the XML.
As for setSaveCDataLengthThreshold and setSaveCDataEntityCountThreshold, 
both conditions must be satisfied for CDATA tag to be added.


Jerry

On 07/27/2012 02:05 AM, Jurica Krizanic wrote:

Hello,
I am uxing XMLBeans 2.5.0 and having an issue with saving XML to the 
file..
When the XML is saved to the file, CDATA section marks are removed, 
but content inside the CDATA remains in the file.


I would like CDATA marks also remain in the file.

I was trying to set XMLOptions with setSaveCDataLengthThreshold() and 
setSaveCDataEntityCountThreshold() methods,
browsing through already asked questions on the mailing list, but I 
can't get it work correctly.


Can someone provide any help?


Thank you in advance!

Best regards,
Jurica Krizanic






Re: Updating from 2.2.0 to 2.5.0: Migrationpath and Compatibility issues

2012-06-21 Thread Jacob Danner
Hi Oliver,
I don't know of anything specific but the only issues I've had with
this sort of migration/upgrade were my own and were caused by using
different JDK versions when compiling some newer schemas with some
older dependent schemas. It was a simple fix to set the javac
target/source attribute in my ant file.

When you give this a try, please let the list know what if any issues
you encounter.

-jacobd

On Thu, Jun 21, 2012 at 2:08 AM, Oliver Meyer oliver.me...@dsa-ac.de wrote:
 Hi,

 in a project in which we are using xmlbeans 2.2.0 and used it to generate
 classes for multiple different schema files, we now need to update the
 xmlbeans lib (we just created a schema, for which 2.2.0 can no longer
 generate correct classes). Is there a document describing
 (in-)compatibilities between these versions and what to do to update?

 We are using xmlbeans mainly to read in xml files. Rarely we create files
 with it.

 I like to now specifically:
  1. Do I have to regenerate all schema specific libs from the .xsd files?
  2. Are there known incompatibilities in behaviour?
  3. Are xmlbeans 2.2.0 and 2.5.0 declared to be compatible? What kind of
 compatibility is meant here?

 I did not find any information concerning this migration use case on the
 apache page. If some one could point me to it, I would be more than happy to
 read. The only thing I could find, was the pointer to the common error of
 not adding the qname library to the class path. But, I was looking for a
 positive list of what to do, so that an update will work in the first place.

 I guess (but I like that to be confirmed) that update from 2.x to 2.x+y
 should work without regenerating, without compile time issues, and (if I do
 not depend on a buggy behaviour in 2.x) without changes in the application
 code, unless I like to use a new feature.

 Any pointers?
 Cheers,
 Oliver

 --
 oliver.me...@dsa-ac.de
 +49 (0)2408 9492 - 793

 DSA - Daten- und Systemtechnik GmbH
 Pascalstraße 28, 52076 Aachen, Germany
 http://www.dsa.de

 Sitz und Registergericht/Domicile and Court of Registry: Aachen
 HRB-Nr./Commercial Register No.: 11960
 Geschäftsführung/Board of Management:
 Dr. Eckhard Schulz, Dr. Volker Gehring, Dr. Ansgar Schleicher


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


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



Re: Scoped default namespaces

2012-06-10 Thread Kaan Yamanyar
Hi Jacob;


1) setSaveAggressiveNamespaces does not do what I ask: 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. However I have asked if I could
use the scoped namespaces as displayed in my example.*

2) There isn't a method named setSaveDefaultNamespace. If you
mean setUseDefaultNamespace(); it uses the default namespace only for one
element which is most used.

Cheers,
Kaan

2012/6/9 Jacob Danner jacob.dan...@gmail.com

 There are a couple other XMLOptions available like setSaveAggressive and
 setSaveDefault Namespace methods to render what you want.
 -jacobd
 On Jun 8, 2012 1:44 AM, Kaan Yamanyar k...@yamanyar.com wrote:

 Hi,

 Is there a possible way to make use of default scoped name spaces?
 I have not found any resources for this issue.


 instead of:

 alfa data=abc xmlns=http://test1.com/;
   mus:beta xmlns:mus=http://test2.com;
 mus:a1234567897/mus:a
 mus:s777666/mus:s
   /mus:beta
 /alfa

 I would like to have:

 alfa data=abc xmlns=http://test1.com/;
   beta xmlns=http://test2.com;
 a1234567897/a
 s777666/s
   /beta
 /alfa

 note:
  Map map = new HashMap();
  map.put(http://test1.com/,;);
  map.put(http://test2.com/,;);
  xo.setSaveSuggestedPrefixes(map);
 does not work


 Cheers,
 Kaan





-- 
*Saygılarımla,*
*Kaan Yamanyar*

k...@yamanyar.com
www.yamanyar.com


Re: Scoped default namespaces

2012-06-08 Thread Jacob Danner
There are a couple other XMLOptions available like setSaveAggressive and
setSaveDefault Namespace methods to render what you want.
-jacobd
On Jun 8, 2012 1:44 AM, Kaan Yamanyar k...@yamanyar.com wrote:

 Hi,

 Is there a possible way to make use of default scoped name spaces?
 I have not found any resources for this issue.


 instead of:

 alfa data=abc xmlns=http://test1.com/;
   mus:beta xmlns:mus=http://test2.com;
 mus:a1234567897/mus:a
 mus:s777666/mus:s
   /mus:beta
 /alfa

 I would like to have:

 alfa data=abc xmlns=http://test1.com/;
   beta xmlns=http://test2.com;
 a1234567897/a
 s777666/s
   /beta
 /alfa

 note:
  Map map = new HashMap();
  map.put(http://test1.com/,;);
  map.put(http://test2.com/,;);
  xo.setSaveSuggestedPrefixes(map);
 does not work


 Cheers,
 Kaan





Re: 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: Multiple schema jars

2012-01-10 Thread Jacob Danner
Hi Bob,
I'm not sure what you mean by lib dependency but thought this link
might be of some use
http://wiki.apache.org/xmlbeans/XmlBeansFaq#schemaDependencies

Are both baseschemas.jar and vendor1.jar on the classpath during execution?
Can you try doing a Class.getResource or something along those lines
and accessing a resource or file in baseschemas.jar before your call
to getClassA?
Please let me know if this works.

HTH,
-jacobd

On Tue, Jan 10, 2012 at 6:59 AM, Bob Harvey
robert.l.harvey...@gmail.com wrote:
 Hi, I am developing in Netbeans and need to provide our customer APIs a
 base XMLBean library (for example sake, call it baseschemas.jar. This
 base library will be used to support different vendors the ability to build
 their own customized XMLBean objects.

 In my testing, I have created a XMLBean library called Vendor1
 (vendor1.jar). In vendor1.jar, I have Class B which contains a class member,
 Class A, defined in baseschemas.jar. The Vendor1 Netbeans project module
 compiles with no problems (baseschemas.jar is a lib dependency). However, in
 my Netbeans app at runtime, when Class B attempts to access Class A
 (getClassA), a null pointer exception occurs:

 java.lang.NullPointerException
 at
 org.apache.xmlbeans.impl.schema.SchemaPropertyImpl.getType(SchemaPropertyImpl.java:92)
 at
 org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createElementType(SchemaTypeImpl.java:965)
 at
 org.apache.xmlbeans.impl.values.XmlObjectBase.create_element_user(XmlObjectBase.java:924)
 at org.apache.xmlbeans.impl.store.Xobj.getUser(Xobj.java:1669)
 at org.apache.xmlbeans.impl.store.Xobj.find_element_user(Xobj.java:2074)
 at vendors1.impl.ClassBImpl.getClassA(Unknown Source)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)
 at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
 at
 groovy.lang.MetaClassImpl$GetBeanMethodMetaProperty.getProperty(MetaClassImpl.java:3460)
 at
 org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:61)
 at
 org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:237)
 at
 org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetPropertySafe(AbstractCallSite.java:343)

 I have tried using XMLBeans 2.4 and 2.5 and the same result occurs.

 Any help is much appreciated,
 Thanks!

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



Re: Adding linked image to XLSX corrupts previous drawings

2012-01-03 Thread Jacob Danner
Hey Michael,
I don't have the knowledge of POI to really understand whats going on
here but I'll give it a shot.

         patriarch.createLinkedPicture(anchor, uri.toString());
What is uri.toString here? is uri and xmlbeans type? if so, what is it
a type of? What were you expecting the value to be?
it looks likes the code should create something like
a href=uri.toString() .../
is that correct?
If so, where does the image/link href get interpretted?

         workbook.write(outDoc);
Can you post the resulting code snippet of this section of the
workbook to highlight the error in the output?

Thanks,
-jacobd


On Tue, Jan 3, 2012 at 11:27 AM, Michael Benoit mbenoit2...@gmail.com wrote:
 When adding a linked image to an XLSX using POI that already has at least
 one drawing, the resulting file is corrupted but can be recovered. However
 the original drawings are gone.

 Here is a code fragment:
         Workbook workbook = getWorkbook(doc);
         Sheet sheet = workbook.getSheetAt(0);
         Drawing patriarch = sheet.createDrawingPatriarch();
         ClientAnchor anchor =
 workbook.getCreationHelper().createClientAnchor();
         anchor.setCol1(0);
         anchor.setRow1(0);
         anchor.setDx1(100);
         anchor.setDy1(100);
         patriarch.createLinkedPicture(anchor, uri.toString());
         workbook.write(outDoc);
         doc.close();
         outDoc.close();

 I know that POI does not consider this a bug on their end so I was wondering
 if this has to do with xmlbeans and if I could custom compile xmlbeans so
 that I don't have this problem.

 Thanks,
 Michael Benoit

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



Re: schemaorg_apache_xmlbeans.system.sB96777C4495A76B8788F8D7E0FEDDCED.TypeSystemHolder

2011-12-06 Thread MurphyR

Thank you. You are a life saver!!
You are correct, I did not pack the schemaorg_apache_xmlbeans\*.* in Jar.
After I did that and placed the jar in the lib folder, all iz well.

Thanks again.


Jacob Danner-2 wrote:
 
 I'm not sure of your usecase here, but how are you compiling and
 packaging your schemas?
 Is the compiled schema all in one jar? My guess is probably not, but
 can you confirm?
 -jacobd
 
 On Mon, Dec 5, 2011 at 4:30 PM, MurphyR murphyricha...@gmail.com wrote:

 Environment:
 Axis2, Tomcat 6, hibernate, SQLserver2008.

 Task
 I am exposing the PersonManager.AddPerson() method as a Webservice.

 Observations:
 I get the following error:

 Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem.
 Unable
 to load class with name
 schemaorg_apache_xmlbeans.system.sB96777C4495A76B8788F8D7E0FEDDCED.TypeSystemHolder.
 Make sure the generated binary files are on the classpath.
 at
 org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783)
 at
 org.openhie.openempi.configuration.xml.MpiConfigDocument.clinit(MpiConfigDocument.java:20)
 ... 31 more
 Caused by: java.lang.ClassNotFoundException:
 schemaorg_apache_xmlbeans.system.sB96777C4495A76B8788F8D7E0FEDDCED.TypeSystemHolder
 at
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
 at
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
 at
 org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:769)
 ... 32 more


 I placed the schemaorg_apache_xmlbeans directory in the
 WEB-INF\classes
 directory of the axis2 webapp and still I get the same error as above.
 Looks
 like it did not find it, I request to please let me know the correct
 path. I
 need help on this.

 Thanks in Advance
 --
 View this message in context:
 http://old.nabble.com/schemaorg_apache_xmlbeans.system.sB96777C4495A76B8788F8D7E0FEDDCED.TypeSystemHolder-tp32921399p32921399.html
 Sent from the Xml Beans - User mailing list archive at Nabble.com.


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

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

-- 
View this message in context: 
http://old.nabble.com/schemaorg_apache_xmlbeans.system.sB96777C4495A76B8788F8D7E0FEDDCED.TypeSystemHolder-tp32921399p32924608.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


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



Re: schemaorg_apache_xmlbeans.system.sB96777C4495A76B8788F8D7E0FEDDCED.TypeSystemHolder

2011-12-05 Thread Jacob Danner
I'm not sure of your usecase here, but how are you compiling and
packaging your schemas?
Is the compiled schema all in one jar? My guess is probably not, but
can you confirm?
-jacobd

On Mon, Dec 5, 2011 at 4:30 PM, MurphyR murphyricha...@gmail.com wrote:

 Environment:
 Axis2, Tomcat 6, hibernate, SQLserver2008.

 Task
 I am exposing the PersonManager.AddPerson() method as a Webservice.

 Observations:
 I get the following error:

 Caused by: java.lang.RuntimeException: Cannot load SchemaTypeSystem. Unable
 to load class with name
 schemaorg_apache_xmlbeans.system.sB96777C4495A76B8788F8D7E0FEDDCED.TypeSystemHolder.
 Make sure the generated binary files are on the classpath.
 at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:783)
 at
 org.openhie.openempi.configuration.xml.MpiConfigDocument.clinit(MpiConfigDocument.java:20)
 ... 31 more
 Caused by: java.lang.ClassNotFoundException:
 schemaorg_apache_xmlbeans.system.sB96777C4495A76B8788F8D7E0FEDDCED.TypeSystemHolder
 at
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
 at
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
 at org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(XmlBeans.java:769)
 ... 32 more


 I placed the schemaorg_apache_xmlbeans directory in the WEB-INF\classes
 directory of the axis2 webapp and still I get the same error as above. Looks
 like it did not find it, I request to please let me know the correct path. I
 need help on this.

 Thanks in Advance
 --
 View this message in context: 
 http://old.nabble.com/schemaorg_apache_xmlbeans.system.sB96777C4495A76B8788F8D7E0FEDDCED.TypeSystemHolder-tp32921399p32921399.html
 Sent from the Xml Beans - User mailing list archive at Nabble.com.


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


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



Re: XML basics

2011-11-13 Thread Jacob Danner
Hi Heather,
I'm not sure this is the best mailing list for your question as its
pretty specific to a particular set of technologies related to XML
Schema and java technologies.

I haven't ever used CSS with XML, only with HTML, but they work
roughly the same. CSS is just used to apply styling to an XML
instance. I would  think it better to use CSS3 as it is the latest
emerging standard

A good intro to XML is available via the standards body W3C at:
http://www.w3.org/standards/xml/core

Information on CSS is available from w3c as well
http://www.w3.org/Style/CSS/learning

XPath is a standard to refer to locations within an xml instance.
http://www.w3.org/TR/xpath/

If you did mean HTML, I like HTML5rocks.com

While not completely standards conforming, there is a pretty simple
explanation of using all of these technologies on
http://www.w3schools.com
Others from the list may have other recommendations for coming up to
speed with these technologies.
HTH,
-jacobd

On Sun, Nov 13, 2011 at 10:42 AM, just a beginner
heather.edmu...@aggiemail.usu.edu wrote:

 Hello!
  I'm just starting out my college education in technical writing, and for a
 class I've been researching XML. I'm understanding just the basics of XML,
 but realize it works well with CSS. Is it better to use CSS or CSS 2? Also,
 I keep running into the term xpath. Can someone explain what xpath is? All
 help will be greatly appreciated. Thanks!
 --
 View this message in context: 
 http://old.nabble.com/XML-basics-tp32835889p32835889.html
 Sent from the Xml Beans - User mailing list archive at Nabble.com.


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



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



Re: time to execute an xquery

2011-10-24 Thread tejaswi chennubhotlla
Thank you Jacob for your reply.

Yes, I have been searching the xmlbeans API but could not find one. I did
use the timestamps pre and post query execution but I am not getting the
same result everytime. My project is to optimize an xquery depending on the
target constraints. So I need to show that my optimized xquery executes
faster than the unoptimized xquery. Can you please suggest any other
procedure to get the execution time.

One more question. Is there any limitation on the size of the xml source
file? Can I use source files of size 10Mb or more?

Thank you

Tej

On Mon, Oct 24, 2011 at 12:38 AM, Jacob Danner jacob.dan...@gmail.comwrote:

 Are you looking for some kinf of API from xmlbeans?

 When I've wanted this information I've just tossed out some timestamps to
 the log pre and post query execution. Will that not work for your case?

 -jacobd
 On Oct 23, 2011 6:29 PM, tejaswi chennubhotlla tejaswi@gmail.com
 wrote:

 Hi All

 How do I know the time taken to execute an xquery on an xml file.

 Thank you

 Tej




  1   2   3   4   5   6   7   8   9   10   >