RE: Imported, included schemas

2008-03-19 Thread Denis.Sitnitsa
getResourceByName.

What is this?
Method of what? 

-Original Message-
From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 19, 2008 12:49 AM
To: user@xmlbeans.apache.org
Subject: Re: Imported, included schemas

I think that this has been covered, but getSourceName() returns the path
to the Schema file inside the jar that it came from, there is no
guarantee that decoding it returns anything meaningful. What you can
do is use getResourceByName() to get to the text of the Schema file.

But the original location of the file is not saved in the jar and the
stack of imports and includes is never computed as such. Sorry! :-)

Radu

On Tue, 2008-03-18 at 06:10 -0700, [EMAIL PROTECTED] wrote:
 Hi All!
 
 I'm using XMLBeans to validate xsd schemas, according to specified 
 rules.
 I need to implement the feature to show where the user can find 
 exception.
 
 I'm trying to get file name using SchemaType.getSourceName() method.
 
 As I have understood, I have the result converted by QNameHelper.java 
 class.
 
 Is it possible to ease decode it? Is there any helper methods to do 
 it?
 
 And, finally:
 
 Is it possible to see some stack of imports, includes? For example I

 open a.xsd for validation, it imports b.xsd. Then b.xsd imports c.xsd 
 and c.xsd includes d.xsd which contain an exception.
 
 The best would be the result: a.xsd - b.xsd - c.xsd - d.xsd, for 
 now I can just show a.xsd - d.xsd, by getting path of 
 property.getContainerType().getSourceName, where property is 
 validating property or type.getSourceName if I validate a type.
 
 Thanks a lot.
 
 Regards,
 Denis.
 
 plain text document attachment (disclaim.txt), Legal Disclaimer
 Visit our website at http://www.ubs.com
 
 This message contains confidential information and is intended only 
 for the individual named.  If you are not the named addressee you 
 should not disseminate, distribute or copy this e-mail.  Please notify

 the sender immediately by e-mail if you have received this e-mail by 
 mistake and delete this e-mail from your system.
   
 E-mails are not encrypted and cannot be guaranteed to be secure or 
 error-free as information could be intercepted, corrupted, lost, 
 destroyed, arrive late or incomplete, or contain viruses.  The sender 
 therefore does not accept liability for any errors or omissions in the

 contents of this message which arise as a result of e-mail
transmission.
 If verification is required please request a hard-copy version.  This 
 message is provided for informational purposes and should not be 
 construed as a solicitation or offer to buy or sell any securities or 
 related financial instruments.
 

Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mails are not encrypted and cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses.  The sender
therefore does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities
or related financial instruments.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



java.lang.IllegalStateException: Cursor has been disposed

2008-03-19 Thread Chris Snow
I have a message that is throwing java.lang.IllegalStateException:
Cursor has been disposed

 

I can't see what I am doing wrong.  Any help would be most appreciated.

 

Thanks in advance ...

 

 

public Instruction fromMessage(Message msg) throws
MessageConversionException {

 

TextMessage textMessage = (TextMessage)msg;

Instruction instruction = null;

MainInstructionWrapperDocument
instructionDocument = null;

 

try {

System.out.println(
InstructionRequestConverterImpl: fromMessage() );

//System.out.println(
textMessage.getText() );



XmlOptions options = new
XmlOptions();

options.setSaveOuter();



ArrayList validationErrors = new
ArrayList();

XmlOptions validationOptions = new
XmlOptions();

 
validationOptions.setErrorListener(validationErrors);



instructionDocument =
MainInstructionWrapperDocument.Factory.parse( textMessage.getText() );



boolean isValid =
instructionDocument.validate(validationOptions);

 

if (!isValid)

{

Iterator iter =
validationErrors.iterator();

while (iter.hasNext())

{

System.out.println(  +
iter.next() + \n);

}

}



// The next line throws:

// java.lang.IllegalStateException:
Cursor has been disposed

 

Instruction[] instructionArray = 

 
(Instruction[])instructionDocument.getMainInstructionWrapper().selectPat
h( instructionXpath );



instruction = instructionArray[0];
// only one child instruction per wrapper

} 

catch (Exception e) {

// TODO: log

e.printStackTrace();

throw new
MessageConversionException(e.getMessage());

}

return instruction;

}



RE: java.lang.IllegalStateException: Cursor has been disposed

2008-03-19 Thread Chris Snow
I've found it...

 

selectPath( instructionXpath ); 

 

returns void!

 

 



From: Chris Snow [mailto:[EMAIL PROTECTED] 
Sent: 19 March 2008 10:02
To: user@xmlbeans.apache.org
Subject: java.lang.IllegalStateException: Cursor has been disposed

 

I have a message that is throwing java.lang.IllegalStateException:
Cursor has been disposed

 

I can't see what I am doing wrong.  Any help would be most appreciated.

 

Thanks in advance ...

 

 

public Instruction fromMessage(Message msg) throws
MessageConversionException {

 

TextMessage textMessage = (TextMessage)msg;

Instruction instruction = null;

MainInstructionWrapperDocument
instructionDocument = null;

 

try {

System.out.println(
InstructionRequestConverterImpl: fromMessage() );

//System.out.println(
textMessage.getText() );



XmlOptions options = new
XmlOptions();

options.setSaveOuter();



ArrayList validationErrors = new
ArrayList();

XmlOptions validationOptions = new
XmlOptions();

 
validationOptions.setErrorListener(validationErrors);



instructionDocument =
MainInstructionWrapperDocument.Factory.parse( textMessage.getText() );



boolean isValid =
instructionDocument.validate(validationOptions);

 

if (!isValid)

{

Iterator iter =
validationErrors.iterator();

while (iter.hasNext())

{

System.out.println(  +
iter.next() + \n);

}

}



// The next line throws:

// java.lang.IllegalStateException:
Cursor has been disposed

 

Instruction[] instructionArray = 

 
(Instruction[])instructionDocument.getMainInstructionWrapper().selectPat
h( instructionXpath );



instruction = instructionArray[0];
// only one child instruction per wrapper

} 

catch (Exception e) {

// TODO: log

e.printStackTrace();

throw new
MessageConversionException(e.getMessage());

}

return instruction;

}



RE: Imported, included schemas

2008-03-19 Thread Denis.Sitnitsa
What is this?
I mean method getResourceByName().
What is it belong to?
Which class? 

-Original Message-
From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 19, 2008 12:49 AM
To: user@xmlbeans.apache.org
Subject: Re: Imported, included schemas

I think that this has been covered, but getSourceName() returns the path
to the Schema file inside the jar that it came from, there is no
guarantee that decoding it returns anything meaningful. What you can
do is use getResourceByName() to get to the text of the Schema file.

But the original location of the file is not saved in the jar and the
stack of imports and includes is never computed as such. Sorry! :-)

Radu

On Tue, 2008-03-18 at 06:10 -0700, [EMAIL PROTECTED] wrote:
 Hi All!
 
 I'm using XMLBeans to validate xsd schemas, according to specified 
 rules.
 I need to implement the feature to show where the user can find 
 exception.
 
 I'm trying to get file name using SchemaType.getSourceName() method.
 
 As I have understood, I have the result converted by QNameHelper.java 
 class.
 
 Is it possible to ease decode it? Is there any helper methods to do 
 it?
 
 And, finally:
 
 Is it possible to see some stack of imports, includes? For example I

 open a.xsd for validation, it imports b.xsd. Then b.xsd imports c.xsd 
 and c.xsd includes d.xsd which contain an exception.
 
 The best would be the result: a.xsd - b.xsd - c.xsd - d.xsd, for 
 now I can just show a.xsd - d.xsd, by getting path of 
 property.getContainerType().getSourceName, where property is 
 validating property or type.getSourceName if I validate a type.
 
 Thanks a lot.
 
 Regards,
 Denis.
 
 plain text document attachment (disclaim.txt), Legal Disclaimer
 Visit our website at http://www.ubs.com
 
 This message contains confidential information and is intended only 
 for the individual named.  If you are not the named addressee you 
 should not disseminate, distribute or copy this e-mail.  Please notify

 the sender immediately by e-mail if you have received this e-mail by 
 mistake and delete this e-mail from your system.
   
 E-mails are not encrypted and cannot be guaranteed to be secure or 
 error-free as information could be intercepted, corrupted, lost, 
 destroyed, arrive late or incomplete, or contain viruses.  The sender 
 therefore does not accept liability for any errors or omissions in the

 contents of this message which arise as a result of e-mail
transmission.
 If verification is required please request a hard-copy version.  This 
 message is provided for informational purposes and should not be 
 construed as a solicitation or offer to buy or sell any securities or 
 related financial instruments.
 

Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mails are not encrypted and cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses.  The sender
therefore does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities
or related financial instruments.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Imported, included schemas

2008-03-19 Thread Denis.Sitnitsa
returns the path to the Schema file inside the jar that it came from 

I don't use jar files.
I open my xsd schemas with my types, elements, etc

-Original Message-
From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 19, 2008 12:49 AM
To: user@xmlbeans.apache.org
Subject: Re: Imported, included schemas

I think that this has been covered, but getSourceName() returns the path
to the Schema file inside the jar that it came from, there is no
guarantee that decoding it returns anything meaningful. What you can
do is use getResourceByName() to get to the text of the Schema file.

But the original location of the file is not saved in the jar and the
stack of imports and includes is never computed as such. Sorry! :-)

Radu

On Tue, 2008-03-18 at 06:10 -0700, [EMAIL PROTECTED] wrote:
 Hi All!
 
 I'm using XMLBeans to validate xsd schemas, according to specified 
 rules.
 I need to implement the feature to show where the user can find 
 exception.
 
 I'm trying to get file name using SchemaType.getSourceName() method.
 
 As I have understood, I have the result converted by QNameHelper.java 
 class.
 
 Is it possible to ease decode it? Is there any helper methods to do 
 it?
 
 And, finally:
 
 Is it possible to see some stack of imports, includes? For example I

 open a.xsd for validation, it imports b.xsd. Then b.xsd imports c.xsd 
 and c.xsd includes d.xsd which contain an exception.
 
 The best would be the result: a.xsd - b.xsd - c.xsd - d.xsd, for 
 now I can just show a.xsd - d.xsd, by getting path of 
 property.getContainerType().getSourceName, where property is 
 validating property or type.getSourceName if I validate a type.
 
 Thanks a lot.
 
 Regards,
 Denis.
 
 plain text document attachment (disclaim.txt), Legal Disclaimer
 Visit our website at http://www.ubs.com
 
 This message contains confidential information and is intended only 
 for the individual named.  If you are not the named addressee you 
 should not disseminate, distribute or copy this e-mail.  Please notify

 the sender immediately by e-mail if you have received this e-mail by 
 mistake and delete this e-mail from your system.
   
 E-mails are not encrypted and cannot be guaranteed to be secure or 
 error-free as information could be intercepted, corrupted, lost, 
 destroyed, arrive late or incomplete, or contain viruses.  The sender 
 therefore does not accept liability for any errors or omissions in the

 contents of this message which arise as a result of e-mail
transmission.
 If verification is required please request a hard-copy version.  This 
 message is provided for informational purposes and should not be 
 construed as a solicitation or offer to buy or sell any securities or 
 related financial instruments.
 

Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mails are not encrypted and cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses.  The sender
therefore does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities
or related financial instruments.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Imported, included schemas

2008-03-19 Thread Wing Yew Poon
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 not count on using this string to figure out the path to your
original xsd file.
Recently Cezar posted the following code sample to this list:

SchemaType st = SchemaDocument.type; // or any schemaType that
is compiled into a jar using scomp
InputStream is =
st.getTypeSystem().getSourceAsStream(st.getSourceName());
Reader r = new InputStreamReader(is);

Now you can read the contents of your xsd file (using the copy in
the compiled jar). I think that's the other point Radu was suggesting.
- Wing Yew

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 19, 2008 7:23 AM
To: user@xmlbeans.apache.org
Subject: RE: Imported, included schemas

returns the path to the Schema file inside the jar that it came from 

I don't use jar files.
I open my xsd schemas with my types, elements, etc

-Original Message-
From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 19, 2008 12:49 AM
To: user@xmlbeans.apache.org
Subject: Re: Imported, included schemas

I think that this has been covered, but getSourceName() returns the path
to the Schema file inside the jar that it came from, there is no
guarantee that decoding it returns anything meaningful. What you can
do is use getResourceByName() to get to the text of the Schema file.

But the original location of the file is not saved in the jar and the
stack of imports and includes is never computed as such. Sorry! :-)

Radu

On Tue, 2008-03-18 at 06:10 -0700, [EMAIL PROTECTED] wrote:
 Hi All!
 
 I'm using XMLBeans to validate xsd schemas, according to specified 
 rules.
 I need to implement the feature to show where the user can find 
 exception.
 
 I'm trying to get file name using SchemaType.getSourceName() method.
 
 As I have understood, I have the result converted by QNameHelper.java 
 class.
 
 Is it possible to ease decode it? Is there any helper methods to do 
 it?
 
 And, finally:
 
 Is it possible to see some stack of imports, includes? For example I

 open a.xsd for validation, it imports b.xsd. Then b.xsd imports c.xsd 
 and c.xsd includes d.xsd which contain an exception.
 
 The best would be the result: a.xsd - b.xsd - c.xsd - d.xsd, for 
 now I can just show a.xsd - d.xsd, by getting path of 
 property.getContainerType().getSourceName, where property is 
 validating property or type.getSourceName if I validate a type.
 
 Thanks a lot.
 
 Regards,
 Denis.
 
 plain text document attachment (disclaim.txt), Legal Disclaimer
 Visit our website at http://www.ubs.com
 
 This message contains confidential information and is intended only 
 for the individual named.  If you are not the named addressee you 
 should not disseminate, distribute or copy this e-mail.  Please notify

 the sender immediately by e-mail if you have received this e-mail by 
 mistake and delete this e-mail from your system.
   
 E-mails are not encrypted and cannot be guaranteed to be secure or 
 error-free as information could be intercepted, corrupted, lost, 
 destroyed, arrive late or incomplete, or contain viruses.  The sender 
 therefore does not accept liability for any errors or omissions in the

 contents of this message which arise as a result of e-mail
transmission.
 If verification is required please request a hard-copy version.  This 
 message is provided for informational purposes and should not be 
 construed as a solicitation or offer to buy or sell any securities or 
 related financial instruments.
 

Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mails are not encrypted and cannot be guaranteed to be secure or 
error-free as information could be intercepted, corrupted, lost, 
destroyed, arrive late or incomplete, or contain viruses.  

Algorithm for saving CDATA blocks in XML Beans 2.2 ?

2008-03-19 Thread Steve Davis
I see that XML Beans 2.3 provides some control over when the saver
generates CDATA. The XML Options setSaveCDataLengthThreshold and
setSaveCDataEntityCountThreshold allow any of the following
configurations:

Every text is CDATA
Only text that has an entity is CDATA
Only text longer than x chars is CDATA
Only text that has y entitazable chars is CDATA
Only text longer than x chars and has y entitazable chars is CDATA

My question is what is the behavior of the saver in XML Beans 2.2? When
does it decide to use CDATA blocks?

Thanks, 
Steve

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Algorithm for saving CDATA blocks in XML Beans 2.2 ?

2008-03-19 Thread Cezar Andrei
Steve,

The javadoc for setSaveCDataLengthThreshold and
setSaveCDataEntityCountThreshold seems to be quite clear:

 * CDATA will be used if the folowing condition is true:
 * textLength  cdataLengthThreshold  entityCount 
cdataEntityCountThreshold
 * The default value of cdataLengthThreshold is 32.
 * The default value of cdataEntityCountThreshold is 5.

Cezar

 -Original Message-
 From: Steve Davis [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 19, 2008 2:11 PM
 To: user@xmlbeans.apache.org
 Subject: Algorithm for saving CDATA blocks in XML Beans 2.2 ?
 
 I see that XML Beans 2.3 provides some control over when the saver
 generates CDATA. The XML Options setSaveCDataLengthThreshold and
 setSaveCDataEntityCountThreshold allow any of the following
 configurations:
 
 Every text is CDATA
 Only text that has an entity is CDATA
 Only text longer than x chars is CDATA
 Only text that has y entitazable chars is CDATA
 Only text longer than x chars and has y entitazable chars is CDATA
 
 My question is what is the behavior of the saver in XML Beans 2.2?
When
 does it decide to use CDATA blocks?
 
 Thanks,
 Steve
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


Notice:  This email message, together with any attachments, may contain 
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated 
entities,  that may be confidential,  proprietary,  copyrighted  and/or legally 
privileged, and is intended solely for the use of the individual or entity 
named in this message. If you are not the intended recipient, and have received 
this message in error, please immediately return this by email and then delete 
it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Algorithm for saving CDATA blocks in XML Beans 2.2 ?

2008-03-19 Thread Steve Davis
Cezar,

If I am not mistaken, the older XML Beans version 2.2 does not does not
support these options.
Please clarify.

Thanks,
Steve

-Original Message-
From: Cezar Andrei [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 19, 2008 4:38 PM
To: user@xmlbeans.apache.org
Subject: RE: Algorithm for saving CDATA blocks in XML Beans 2.2 ?

Steve,

The javadoc for setSaveCDataLengthThreshold and
setSaveCDataEntityCountThreshold seems to be quite clear:

 * CDATA will be used if the folowing condition is true:
 * textLength  cdataLengthThreshold  entityCount 
cdataEntityCountThreshold
 * The default value of cdataLengthThreshold is 32.
 * The default value of cdataEntityCountThreshold is 5.

Cezar

 -Original Message-
 From: Steve Davis [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 19, 2008 2:11 PM
 To: user@xmlbeans.apache.org
 Subject: Algorithm for saving CDATA blocks in XML Beans 2.2 ?
 
 I see that XML Beans 2.3 provides some control over when the saver 
 generates CDATA. The XML Options setSaveCDataLengthThreshold and 
 setSaveCDataEntityCountThreshold allow any of the following
 configurations:
 
 Every text is CDATA
 Only text that has an entity is CDATA
 Only text longer than x chars is CDATA Only text that has y 
 entitazable chars is CDATA Only text longer than x chars and has y 
 entitazable chars is CDATA
 
 My question is what is the behavior of the saver in XML Beans 2.2?
When
 does it decide to use CDATA blocks?
 
 Thanks,
 Steve
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



What's wrong with the following XML??

2008-03-19 Thread Dan Hwang
Hello,

I've beening using inst2xsd script to generate xsd from xml.
I added relationships block to add some new features.
After regenerating the xsd, I noticed that subComponents has been changed.

   before
   ...
   xs:element name=subComponents
   xs:complexType
   xs:sequence
   xs:element name=subComponent maxOccurs=unbounded
minOccurs=0
   ...
   after
   ...
   xs:element name=subComponents
   xs:complexType
   xs:choice maxOccurs=unbounded minOccurs=0
   xs:element name=subComponent
   ...



I'm running the following to generate xsd.
   ./xmlbeans-2.0.0/bin/inst2xsd -design rd -enumerations never
-simple-content-types string rail.xml


rail.xml--
?xml version=1.0 encoding=UTF-8?
rail
   keyword
   first/
   second/
   third/
   /keyword
   relationships
   displayType/
   relationship
   type/
   content/
   /relationship
   /relationships
   component
   sequence/
   name/
   header
   graphic
   image/
   altText/
   URL/
   /graphic
   html
   text/
   URL/
   /html
   /header
   subComponents
   subComponent/
   subComponent
   sequence/
   /subComponent
   /subComponents
   /component
/rail

--

Thanks for your help~
-Dan

PS: I noticed that putting the relationships block underneath the
component seems to leave the subComponents unchanged...
However, there's gotta be something wrong with the way I'm using it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Algorithm for saving CDATA blocks in XML Beans 2.2 ?

2008-03-19 Thread Cezar Andrei
Indeed the options weren't available but the algorithm and default
values are the same.

Cezar

 -Original Message-
 From: Steve Davis [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 19, 2008 3:49 PM
 To: user@xmlbeans.apache.org
 Subject: RE: Algorithm for saving CDATA blocks in XML Beans 2.2 ?
 
 Cezar,
 
 If I am not mistaken, the older XML Beans version 2.2 does not does
not
 support these options.
 Please clarify.
 
 Thanks,
 Steve
 
 -Original Message-
 From: Cezar Andrei [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 19, 2008 4:38 PM
 To: user@xmlbeans.apache.org
 Subject: RE: Algorithm for saving CDATA blocks in XML Beans 2.2 ?
 
 Steve,
 
 The javadoc for setSaveCDataLengthThreshold and
 setSaveCDataEntityCountThreshold seems to be quite clear:
 
  * CDATA will be used if the folowing condition is true:
  * textLength  cdataLengthThreshold  entityCount 
 cdataEntityCountThreshold
  * The default value of cdataLengthThreshold is 32.
  * The default value of cdataEntityCountThreshold is 5.
 
 Cezar
 
  -Original Message-
  From: Steve Davis [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, March 19, 2008 2:11 PM
  To: user@xmlbeans.apache.org
  Subject: Algorithm for saving CDATA blocks in XML Beans 2.2 ?
 
  I see that XML Beans 2.3 provides some control over when the saver
  generates CDATA. The XML Options setSaveCDataLengthThreshold and
  setSaveCDataEntityCountThreshold allow any of the following
  configurations:
 
  Every text is CDATA
  Only text that has an entity is CDATA
  Only text longer than x chars is CDATA Only text that has y
  entitazable chars is CDATA Only text longer than x chars and has y
  entitazable chars is CDATA
 
  My question is what is the behavior of the saver in XML Beans 2.2?
 When
  does it decide to use CDATA blocks?
 
  Thanks,
  Steve
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 Notice:  This email message, together with any attachments, may
contain
 information  of  BEA Systems,  Inc.,  its subsidiaries  and
affiliated
 entities,  that may be confidential,  proprietary,  copyrighted
and/or
 legally privileged, and is intended solely for the use of the
individual
 or entity named in this message. If you are not the intended
recipient,
 and have received this message in error, please immediately return
this
 by email and then delete it.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


Notice:  This email message, together with any attachments, may contain 
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated 
entities,  that may be confidential,  proprietary,  copyrighted  and/or legally 
privileged, and is intended solely for the use of the individual or entity 
named in this message. If you are not the intended recipient, and have received 
this message in error, please immediately return this by email and then delete 
it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: What's wrong with the following XML??

2008-03-19 Thread Jacob Danner
I can see why inst2xsd tool is doing that.

subComponents
  subComponent/
  subComponent
  sequence/
  /subComponent
  /subComponents

The tools sees:
subcomponent /

and subComponentsequence / ...
As 2 different types, if you want to correct that, you can try making
them both subComponent Elements as
  subComponent
  sequence/
...

HTH,
-jacobd

On Wed, Mar 19, 2008 at 2:12 PM, Dan Hwang [EMAIL PROTECTED] wrote:
 Hello,

  I've beening using inst2xsd script to generate xsd from xml.
  I added relationships block to add some new features.
  After regenerating the xsd, I noticed that subComponents has been changed.

before
...
xs:element name=subComponents
xs:complexType
xs:sequence
xs:element name=subComponent maxOccurs=unbounded
  minOccurs=0
...
after
...
xs:element name=subComponents
xs:complexType
xs:choice maxOccurs=unbounded minOccurs=0
xs:element name=subComponent
...



  I'm running the following to generate xsd.
./xmlbeans-2.0.0/bin/inst2xsd -design rd -enumerations never
  -simple-content-types string rail.xml


  rail.xml--
  ?xml version=1.0 encoding=UTF-8?
  rail
keyword
first/
second/
third/
/keyword
relationships
displayType/
relationship
type/
content/
/relationship
/relationships
component
sequence/
name/
header
graphic
image/
altText/
URL/
/graphic
html
text/
URL/
/html
/header
subComponents
subComponent/
subComponent
sequence/
/subComponent
/subComponents
/component
  /rail

  --

  Thanks for your help~
  -Dan

  PS: I noticed that putting the relationships block underneath the
  component seems to leave the subComponents unchanged...
  However, there's gotta be something wrong with the way I'm using it.

  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]





-- 
I'm competing in a Half-Ironman distance triathlon to raise money for
the fight against cancer!
Please help support my efforts by going to:
http://www.active.com/donate/tntwaak/jacobd

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]