Hi,
I have a default value specified in the definition of the element. But the
generated class returns the default value only if the element exists in the
xml document.
schema:
complexType name=SomeType
sequence
element name=name type=string minOccurs=1/
element name=interval type=long
I have two xsds. One imports the other one and contains a type that
inherits from a type within the imported file. XmlBeans properly
generates a class that extends the base class. When I use XmlBeans to
create a document, XmlBeans does not properly set the xsi:type. If I
place the inherited
Hi,
I'd like to save a XMLBean with the declaration and encoding and read it
back (using parse?).
The method xmlText just saves a xmlfragment with no declaration so later
when I try to read it back with parse it fails.
Is there any code example for this?
thx,
Dário
--
Dário Abdulrehman
PGP
Try the save(file) method on the xmlobject.
-jacobd
On Thu, Feb 21, 2008 at 7:07 AM, Dário Abdulrehman
[EMAIL PROTECTED] wrote:
Hi,
I'd like to save a XMLBean with the declaration and encoding and read it
back (using parse?).
The method xmlText just saves a xmlfragment with no declaration
Problem solved, thanks.
I noticed that when using save with a StringWriter the XML declaration is
not written whereas if I use a File it is.
On Thu, Feb 21, 2008 at 3:33 PM, Jacob Danner [EMAIL PROTECTED]
wrote:
Try the save(file) method on the xmlobject.
-jacobd
On Thu, Feb 21, 2008 at
I just put some sample XML inside xs:documentaion
element in my XML schema. This sample XML refers to
some undeclared namespace prefix. The XMLBeans
renders
such XSD file invalid when validated against. Am
just curious why?
Of course, removing this ns prefix solved the
problem though.
Hi Dave,
everything inside and xsd:documentation needs to be well:formed xml.
This means any elements declared in the documentation should be
declared properly.
I believe its actually the rules of XML that require prefixes to be defined.
In other words you will have this problem when you do
In XMLSchema, there is a difference between the element not being there
and the element being present, but with the default value. If your
application needs to perform the same action for both cases, you would
have to code this decision in your application. You can avoid
maintaining a separate
8 matches
Mail list logo