Phil,
a couple of remarks:
1. It appears that the tutorial you were looking at -
http://xmlbeans.apache.org/documentation/tutorial_getstarted.html
- was written for XMLBeans 1.0.x. I have not used 1.0.x. I'm not sure if the
files referred to in the tutorial are distibuted with 1.0.x or not, but
: Problems getting started with xmlbeans
Based upon the schema, your code, and my experience I would expect you to get
something like the following.
purchase-order/
That said, Wing Yew Poon may have hit upon the problem when he mentioned that
you're looking at a tutorial for 1.0. I advise you
Paul,
since it appears that your former co-worker was thinking of a different bug
than the truncation problem you're seeing, there is no gain for you to live on
the bleeding edge of XMLBeans. Why don't you try using the released XMLBeans
2.5.0 and recompile your schema? Let us know if
Paul,
what is this BigDecimal truncation bug that you speak of?
- Wing Yew
_
From: Paul Cooper [mailto:pcoo...@emspic.org]
Sent: Thursday, September 23, 2010 6:59 PM
To: user@xmlbeans.apache.org
Subject: Error compiling schema
Greetings, list. Longtime user of older versions of
Soumya,
Peter was right. Your problem is that both schemas have the same target
namespace (i.e., no namespace), so you can't use them together, The second
schema happened to be loaded after the first and shadowed it. Thus when you
tried to parse the xml instance of the first schema, XMLBeans
Making file_id nillable in the schema does not help since the web service is
still going to output file_id/, not file_id xsi:nil=true/. (The web
service does not follow the schema, the schema is only for generating XMLBeans,
if I understood correctly.) I think file_id should not be of type
David,
XMLBeans 2.5.0 supports the same version of Saxon as XMLBeans 2.4.0 does. If
you read otherwise, that is a mistake.
I expect that the behavior you are seeing will be the same if you use XMLBeans
2.5.0 instead of 2.4.0, with Saxon being constant. It could be a bug in Saxon,
given that the
Jason,
I believe that if you specify 1.5, the generated source
can be used with 1.6. Please try it and see.
- Wing Yew
-Original Message-
From: Jason Berk [mailto:jb...@purdueefcu.com]
Sent: Thursday, March 04, 2010 10:42 AM
To: user@xmlbeans.apache.org
Subject: xmlbeans with java 6
is using java 1.6 in the build path which breaks the ant task.
I guess I could use 1.6 and in eclipse specify 1.5 compatibility...but
that seems wrong
Make sense?
Jason
-Original Message-
From: Wing Yew Poon [mailto:wing.yew.p...@oracle.com]
Sent: Thursday, March 04, 2010 1:50 PM
To: user
Hi Aman,
building XMLBeans requires a bootstrap process, where we use an
existing (older) xbean.jar to compile the schema for XML Schema,
as there are classes that use the XMLBeans-generated java classes
for that schema.
You can check
Matthew,
you might try posting to the Axis2 mailing list.
- Wing Yew
_
From: Matthew Gamble [mailto:mgam...@primustel.ca]
Sent: Thursday, February 25, 2010 6:48 AM
To: user@xmlbeans.apache.org
Subject: Re: xsi:type stripped under Tomcat?
Doing some further testing on my own, I've
Nick,
this is a pure Java question, nothing to do with XMLBeans really.
You are using the BigDecimal(double) constructor; you probably
want to use the BigDecimal(String) constructor.
The phrase to keep in mind is: decimal representation of binary
floating point value.
See
It is not weird. And there is nothing weird with XMLBeans.
The XMLBeans error tells you exactly what the problem is.
If you encounter an error from XMLBeans, I'd advise you to first look to see
what you may be doing wrong, instead of thinking XMLBeans is doing something
wrong.
In this case, your
nameFirst Name Last Name/name
is simply not valid xml.
That is why you get an exception when you try to parse it.
The '' needs to be escaped, e.g., as amp;.
The setSaveSubstituteCharacters option has nothing to do
with unmarshalling, only with marshalling.
-Original Message-
From:
Just an idea: I have sometimes found that using a different JDK helps, e.g.,
use JRockit instead of Sun's JDK.
_
From: Dave Shuck [mailto:dsh...@gmail.com]
Sent: Wednesday, December 02, 2009 3:16 PM
To: user@xmlbeans.apache.org
Subject: Suggestions for out of memory error on xml bean
Well, the error message is pretty clear.
The xmlbeans your runtime is using has an earlier version than
the version of xmlbeans used to compile your schema.
You can use schema jars compiled with older versions of xmlbeans
than your runtime, but not with newer. The situation is analogous
to that
Jacob is correct. Only the '' needs to be escaped, not the ''.
XML predefines exactly 5 entity references:
lt;
amp;
gt;
quot;
apos;
but only lt; and amp; must be used instead of the literal characters in
element content; the others are optional, with the exception that the
3-character sequence
Bartolomeo,
CDATA just means character data; a CDATA section demarcates a block
of character data. The character data still have to be in some character
encoding. If your xml declaration has an encoding attribute that tells
the xml parser what character encoding your document is using, then
the
Bala,
can you please post your schema, xml instance, and java code?
Thanks,
Wing Yew
_
From: bchalla [mailto:balu_cha...@yahoo.co.in]
Sent: Wednesday, July 01, 2009 10:04 AM
To: user@xmlbeans.apache.org
Subject: ID and IDREF validation error
Hi, I am getting a strange problem saying
I don't use maven and it's too hard for me to read the classpath you include,
but you not only need saxon9.jar and saxon9-dom.jar, you need xbean_xpath.jar.
The xbean_xpath.jar comes with the XMLBeans 2.4.0 binary distribution.
And yes, it is a classpath issue.
- Wing Yew
_
From:
and 9.1.0.6 saxon jars.
A 2.3.0 xbean.jar is not going to recognize the glue code in a 2.4.0
xbean_xpath.jar, nor Saxon 9.
_
From: Wing Yew Poon
Sent: Monday, June 15, 2009 10:42 AM
To: user@xmlbeans.apache.org
Subject: RE: Xpath/Saxon classpath issue?
I don't use maven and it's too
P.S. I find it a little bewildering that xmlbeans doesn't utilise Maven given
its Apache status.
There is no law that says that Apache projects must use Maven.
Ant is an Apache project too.
XMLBeans has been using Ant for years, and it serves its purpose just fine.
...@internode.on.net]
Sent: Monday, June 15, 2009 4:26 PM
To: Wing Yew Poon
Cc: user@xmlbeans.apache.org
Subject: RE: Xpath/Saxon classpath issue?
Hi Wing Yew,
On 16/06/2009, at 3:42 AM, HYPERLINK
mailto:user-digest-h...@xmlbeans.apache.orguser-digest-h...@xmlbeans.apache.org
wrote:
I don't use maven
In XML, the character data inside an element must not contain a raw
unescaped open angle bracket (); this character is always interpreted
as the start of a tag. If you need to use this character, you can
escape it using the built-in entity reference lt; (or the numeric or
hexadecimal numeric
Bryan,
XMLBeans 2.4.0 supports Saxon 9 and has been tested specifically with
Saxon 9.0.0.4; it does not support Saxon 8 because of incompatible
API changes from Saxon 8.8 to 9.0. XMLBeans 2.3.0 supports Saxon 8.8,
as you know.
The behavior you describe sounds like a bug. Please open an issue in
Is there a way to create a document type XmlObject which has the root
element elem1 and it shows up in the xmlText() along with the previously
selected contents?
Kapil,
it may help if you read
http://xmlbeans.apache.org/docs/2.0.0/guide/conJavaTypesGeneratedFromUserDerived.html.
First of all,
Geir,
is RuleType a simple type?
- Wing Yew
From: geir.ovst...@dnv.com [mailto:geir.ovst...@dnv.com]
Sent: Tuesday, March 10, 2009 8:11 AM
To: user@xmlbeans.apache.org
Subject: Missing methods in code generation
Hi,
With reference to the following page from
Shawn,
that indicates that you're missing the Saxon stuff on your classpath.
You need the glue code XMLBeans supplies (xbean_xpath.jar) along
with saxon9.jar and saxon9-dom.jar.
Also, to clarify, it would seem that this is not a build problem,
this is a runtime problem. So it is your runtime
Asaf,
If I understand you right, you have compiled the schema (using scomp),
resulting in a jar (containing the generated XMLBeans classes and other
artifacts), which is in your runtime classpath, and you want to access the
schema document at runtime. The following methods should be helpful to
Alessandro,
if you're referring to the site,
http://xmlbeans.webappshosting.com/schemaToolsV2, sadly, it is not being
maintained.
You can still use the standard utilities that come in the bin directory of the
xmlbeans distribution.
- Wing Yew
From: Alessandro
Jeremy,
I don't understand why you have a problem.
As Cezar wrote, if you do
inst2xsd file0.xml file1.xml file2.xml
you get
schema0.xsd
schema1.xsd
schema2.xsd
[Btw, you can specify
-outDir [dir] - Directory for output files. Default is '.'
-outPrefix [file_name_prefix] - Prefix for
; the first 3 correspond to the 3 instances (but
not necessarily in that order), and the 4th, schema3.xml,
correspond to a schema for all 3 instances together.
Nevertheless, you do get xsds for each instance (together
with one for all instances combined).
-Original Message-
From: Wing Yew
called schema0.xsd. Maybe this is a
bug?
-Original Message-
From: Wing Yew Poon [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2008 5:00 PM
To: user@xmlbeans.apache.org
Subject: RE: Multiple output files with inst2xsd?
Jeremy,
I don't understand why you have a problem.
As Cezar wrote
Shishupal,
this is a basic XML Schema question, nothing to do with XMLBeans really.
The structure you want is indeed a complex type, so you cannot declare its type
to be xs:string, which is a simple type. Also, you're trying to define the type
in-line within the element declaration (i.e., as an
Hagai,
you can use XmlCursor to navigate to the position where you want to
add a comment and call insertComment(String).
See http://xmlbeans.apache.org/docs/2.0.0/guide/conNavigatingXMLwithCursors.html
and
://xmlbeans.apache.org/sourceAndBinaries/index.html
I copied the Saxon jars from the svn check out to the binary download
and still got the same problem.
So:
* svn co works
* Binary download fails
Thanks
Tom
Wing Yew Poon wrote:
Tom,
what versions of XMLBeans
Denis,
when you compile your schema in xmlbeans (using scomp), you get a jar.
Inside this jar, there will be a copy of the xsd file containing your
schema. SchemaType.getSourceName() returns a string which is the path
to this file in the jar. One of the points Radu was making is that you
should
quot; is a predefined entity reference in XML. It is equivalent in XML
to the character in character data. That is the whole point of the
entity. If you want the literal quot; then you should escape it as
amp;quot;.
- Wing Yew
From: Roch B [mailto:[EMAIL
Namespaces are your friends. Why do you want to get rid of them?
From: temp temp [mailto:[EMAIL PROTECTED]
Sent: Friday, February 29, 2008 3:03 PM
To: user@xmlbeans.apache.org
Subject: saving xml withour namesapce
Xml Beans saves xml with the namespace.
Pascal,
in
a xmlns=mynamespace
b/
/a
what you have is every element within and including a being qualified as
having the namespace mynamespace. Thus, the XPath must qualify the
elements too. This is only logical.
There are a couple of ways you can qualify the elements in the XPath.
You can
Denis,
Jacob is correct. When you scomp an xsd, the xsd itself is archived
inside the jar that is produced. SchemaType.getSourceName() will return
a String containing the path to the xsd (in this jar), relative to
schemaorg_apache_xmlbeans/src/.
You are not meant to decode this string. Perhaps you
Pascal,
I don't know which README you refer to. It is possible that it is
out-of-date.
If you read the FAQ, you will see that for XMLBeans 2.3, to work with
Saxon (8.8 is supported), you need saxon8.jar and saxon8-dom.jar, along
with xbean_xpath.jar and the other jars in the XMLBeans distribution.
Dave,
the xs:any can have a namespace attribute, which, if not present,
defaults to ##any, which means that the content can be in any
namespace whatsoever or no namespace.
I think that solves your problem.
- Wing Yew
-Original Message-
From: dave [mailto:[EMAIL PROTECTED]
Sent: Tuesday,
As previously explained, the pretty print feature does not preserve
white space. If you think about it, it's an unavoidable trade-off
(that is to say, one that cannot always be avoided).
On the other hand, the pretty print feature only affects the
marshalling.
The true infoset is still
Are you referring to writing an xml-fragment?
If you have an XmlObject, not the document, but a child object, you can
certainly save it, and it would be marshalled as an xml-fragment.
- Wing Yew
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday,
Yes, Dave, you should be fine with just the xbean.jar and
jsr173_1.0_api.jar. If you intend to invoke any but the simplest
xpath/xquery expressions, you need xbean_xpath.jar, saxon8.jar
and saxon8-dom.jar. You can use Saxon 8.8. That is known to work
with XMLBeans 2.3.
xbean_xpath.jar contains the
The reason XmlTokenSource.xmlText() does not include the xml header
is because it returns a string rather than writing to an OutputStream
as save(OutputStream) does, for example, so the encoding is not known.
When you call save(OutputStream) or similar methods, then the xml
header will be written
Garth,
what you need is XmlOptionCharEscapeMap.
See
http://xmlbeans.apache.org/docs/2.1.0/reference/org/apache/xmlbeans/XmlO
ptionCharEscapeMap.html.
E.g.,
XmlOptionCharEscapeMap escapes = new XmlOptionCharEscapeMap();
escapes.addMapping('A', XmlOptionCharEscapeMap.HEXADECIMAL);
Joe,
I am able to run the XQueryXPath samples just fine with the XMLBeans
2.3.0 release.
I have saxon8.jar and saxon8-dom.jar in my classpath. I am using Saxon
8.8.
The jars needed are documented in the XMLBeans FAQ:
http://wiki.apache.org/xmlbeans/XmlBeansFaq#whatJars
- Wing Yew
The error is exactly as it says:
Invalid date value: 2006-10-16 11:15:33
You want something like 2006-10-16T11:15:33.
- Wing Yew
-Original Message-
From: Steven Crosley [mailto:[EMAIL PROTECTED]
Sent: Friday, October 19, 2007 10:39 AM
To: user@xmlbeans.apache.org
Subject: DateTime
of optionally directing to the
boolean type setter method to write the value as a numeric value.
Cheers, Albert
At 05:16 AM 10/10/2007, you wrote:
Yes I get mustUnderstand=true instead of mustUnderstand=1
Valerie
Wing Yew Poon [EMAIL PROTECTED
At 05:16 AM 10/10/2007, you wrote:
Yes I get mustUnderstand=true instead of mustUnderstand=1
Valerie
Wing Yew Poon [EMAIL PROTECTED
Valerie,
what exactly is the incorrect behavior you are seeing?
Are you saying that the xml that is marshalled is incorrect after
calling the setter? i.e., you call setMustUnderstand(true) and the xml
shows mustUnderstand=true instead of mustUnderstand=1?
- Wing Yew
This is not a bug.
java.util.Calendar.MONTH is 0-based.
See
http://java.sun.com/j2se/1.4.2/docs/api/constant-values.html#java.util.Calendar.JANUARY
http://java.sun.com/j2se/1.4.2/docs/api/constant-values.html#java.util.Calendar.JANUARY
.
- Wing Yew
From:
/values/XmlObjectBase.java
in the svn repository.
- Wing Yew
-Original Message-
From: Wing Yew Poon [mailto:[EMAIL PROTECTED]
Sent: Friday, August 17, 2007 11:01 AM
To: user@xmlbeans.apache.org; [EMAIL PROTECTED]
Subject: RE: General question
From the archives:
--
From
From the archives:
--
FromRadu Preotiuc-Pietro [EMAIL PROTECTED]
Subject RE: Serialization (again)
DateWed, 12 Oct 2005 22:53:03 GMT
I think the definitive answer is:
- generated Java classes are serializable and the serialization format
is XML, so that when you
Bo,
the typesystemname attribute is not for the purpose of specifying the
package name for your generated classes; it is for specifying the
package
name of the TypeSystemHolder class, which is a class that is not
generated
in the src, but only as a compiled class file in the jar.
For the purpose
Orville,
XMLBeans uses the schema.
In your schema, the type of the LevelOne element is defined as a
sequence.
In a sequence, the order of the elements matter. XMLBeans is working
correctly. If you don't want the order to matter, you should rewrite
your schema, e.g.,
xs:element name=LevelOne
Diego,
1.
If you do
scomp -src srcdir -srconly -d bindir schema
then the java files are generated in the srcdir you specify and the
binary files,
including the TypeSystemHolder.class, are generated in the bindir you
specify.
When you compile and use the java files, make sure you include the files
Garth,
if you open the xbean.jar from the release, you will find a
manifest under meta-inf, and if you open the manifest, you will
see the svn revision number in the version: 2.2.0-r413705.
So the release was built from revision 413705.
- Wing Yew
-Original Message-
From: Garth Patil
Arun Kumar,
try doing the following instead:
Calendar calendar = Calendar.getInstance();
calendar.clear(); // this clears the fields, including
Calendar.ZONE_OFFSET
calendar.set(Calendar.YEAR, 2008);
dateOfBirthType.setBirthYear(calendar);
- Wing Yew
It says right there -
To unsubscribe, e-mail: [EMAIL PROTECTED]
- doesn't that work?
-Original Message-
From: Jun Victorio [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 12, 2006 8:56 AM
To: user@xmlbeans.apache.org
Subject: RE: how to unregister
Same as me, been trying for ages but
Andrey,
user questions should be posted to the user list.
You might find it useful to look through the posts on that list,
as your question may already have been answered.
You can look at http://xmlbeans.apache.org/samples/index.html
for samples.
- Wing Yew
-Original Message-
From: Konus
Robert,
you can accomplish what you want using XmlObject.selectPath().
Take a look at the samples under XQueryXPath, in particular,
org.apache.xmlbeans.samples.xquery.SelectPath.
- Wing Yew
-Original Message-
From: Robert W. Wade [mailto:[EMAIL PROTECTED]
Sent: Monday, October 09, 2006
Yes, it should be.
From: asaf lahav
[mailto:[EMAIL PROTECTED] Sent: Sunday, September 17, 2006
4:37 AMTo: user@xmlbeans.apache.orgSubject: Backward
compatibility
Is XMLBeans 2.2.0
backward compatible to XMLBeans 2.0.0?
>>Register now for BEA World 2006 --- See
I would say that that is the expected behavior.
XMLBeans is schema-aware.
XPath is not. XPath operates on what is in your xml document, and if the
attribute
is not there, it won't find it.
- Wing Yew
-Original Message-
From: cbryant [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 29,
Perhaps you are not logged in?
Anyone is free to find issues. You must register and login if you want
to create, comment, vote, or watch issues.
- Wing Yew
-Original Message-
From: Ken Robinson [mailto:[EMAIL PROTECTED]
Sent: Friday, August 04, 2006 9:37 AM
To: user@xmlbeans.apache.org
Title: How i can keep the CDATA elements
XMLBeans does not preserve CDATA
sections.
This has been addressed most recently on this mailing list
by the following posts:
From: Lewis, David [mailto:[EMAIL PROTECTED]
Sent: July 20, 2006 3:19
PMTo: user@xmlbeans.apache.orgCc: Murphy,
Maarten,
I believe you are correct that xmlbeans 2.0.0 did not escape the ''
in ]] when it's not the end of a CDATA section.
This was fixed in 2.1.0.
See http://issues.apache.org/jira/browse/XMLBEANS-192.
Frank,
since you obviously have looked at xmlbeans src, take a look at
[mailto:[EMAIL PROTECTED]Skickat: må 2006-07-24
14:02Till: user@xmlbeans.apache.orgÄmne: RE: Help with
xmlbeans 2.2.0
yes, I didn't have sasxon-dom.jar at first, but added it and it
still fails with classcast exception.-Original Message-From:
Wing Yew Poon [mailto:[EMAIL PROTECTED]]Sent
Tony,
do you have both saxon8.jar and saxon8-dom.jar in your classpath?
- Wing Yew
-Original Message-
From: Tony Dean [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 22, 2006 5:00 PM
To: dev@xmlbeans.apache.org; user@xmlbeans.apache.org
Subject: RE: Help with xmlbeans 2.2.0
Radu,
Jon,
since you were using xmlbeans 2.1 before, presumably you have
xbean.jar and jsr173_1.0_api.jar in your classpath, together with
xbean_xpath.jar and saxon8.jar; now you need saxon8-dom.jar as well.
If you have all the jars in your classpath and are experiencing
your problem, then I don't know
Arif,
Nathan is right.
If you look at the scomp script, it basically calls java on
org.apache.xmlbeans.impl.tool.SchemaCompiler with your arguments.
Look at the xmlbeans source in the svn repository.
SchemaCompiler.java is under the src/xmlcomp/ hierarchy.
SchemaCompiler has a static nested class
Is there a circulating list of the bug fixes and enhancements for
v2.2?
I think the message below may answer your question.
- Wing Yew
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, June 12, 2006 9:43 AM
To: [EMAIL PROTECTED]
Subject: svn commit:
Ian,
what version of XMLBeans are you using?
do you build XMLBeans yourself (with JDK 1.5)? or do you use a binary
distribution?
- Wing Yew
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 06, 2006 7:44 AM
To: user@xmlbeans.apache.org
Subject:
#toString(), but toPlainString() was added to
BigDecimal
in JDK 1.5 and is not available in 1.4, and XMLBeans supports JDK 1.4.
I think http://issues.apache.org/jira/browse/XMLBEANS-175 is essentially
the
same issue that you raise.
- Wing Yew
-Original Message-
From: Wing Yew Poon
Sent: Tuesday
Andreas,
If I understand correctly, what you want to do is to get the text of
a mixed content element (xsd:complexType name=ElemType_source
mixed=true).
XMLBeans does not generate a getter/setter for the text which may or may
not
be inside the element.
Please see the thread in
Hi Dan,
You rightly point out a current deficiency in the setup
instructions on the website. I hope this will be remedied
soon.
I think that at a minimum, you should have xbean.jar and
jsr173_1.0_api.jar in your classpath. If in addition, you want to use Saxon for
XPath/XQuery, you need to
Radu,
it is possible to escape a range of characters using the
XmlOptionCharEscapeMap:
XmlOptionCharEscapeMap charEsc = new XmlOptionCharEscapeMap();
charEsc.addMappings('A', 'Z',
XmlOptionCharEscapeMap.HEXADECIMAL);
System.out.println(charEsc.getEscapedString('A'));
')?
Or is there some better why to receive all nodes
(with idRef-Attribute) refering to my node xo?
- thanks for your help - Siggi
Wing Yew Poon wrote:
Siggi,
I think you're right. I guess what you need is a variable bound
to the node represented by the XmlObject that you're
Lucas,
if you just do scomp (without any arguments), you will get
the usage message.
Among other things, it tells you:
-d [dir] - target binary directory for
.class and .xsb files -src [dir] - target directory for
generated .java files -srconly - do not compile .java
files or jar the
Alistair,
XmlOption.setSaveAggresiveNamespaces looks a handy method but the
2.1.0
API says it's deprecated and to use use
XmlOptions.setSaveAggresiveNamespaces instead!
Is this a typo?
if you read the javadoc carefully, what is deprecated is
setSaveAggresiveNamespaces
(one 's' in the
Niklas,
I think that, when using the xmlbean ant task, you set the
binary output path by setting the classgendir attribute.
See http://xmlbeans.apache.org/docs/2.0.0/guide/antXmlbean.htmlfor
details.
- Wing Yew
From: Niklas Modin Sent: Tuesday,
August 02, 2005 1:49 PMTo:
Stephen,
this is an explanation of some scomp options:
-srconly means generate java source, do not compile;
-d gives destination directory for binary artifacts (.class and .xsb);
-src gives destination directory for generated java source;
-out is similar to -d except the results are packaged in a
84 matches
Mail list logo