You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by amit shetty <am...@hotmail.com> on 2004/03/22 06:27:34 UTC

parsing and analysing schemas in 2.0.1

Hey folks, I have tried a lot, searched a lot, and I am not able to figure 
out how to do this. Would
really appreciate it if you guys could help me on this.
I need to load an XSD and go through its contents for my project. I am also 
restricted to version 2.0.1 of xerces. Any help on this would be really 
appreciated!
Thanks in advance!
Amit

_________________________________________________________________
Find a broadband plan that fits. Great local deals on high-speed Internet 
access. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: maxOccurs="99999"

Posted by Bob Foster <bo...@objfac.com>.
Thanks. Good to know.

Bob

Michael Glavassevich wrote:
> Hi Bob,
> 
> Applications are already able to set an upper bound on maxOccurs. All you
> have to do is register a SecurityManager [1][2] on an instance of the
> parser and call setMaxOccurNodeLimit(int) on the SecurityManager
> with the desired limit.
> 
> [1] http://xml.apache.org/xerces2-j/properties.html#security-manager
> [2] http://xml.apache.org/xerces2-j/javadocs/xerces2/org/apache/xerces/util/SecurityManager.html
> 
> On Mon, 22 Mar 2004, Bob Foster wrote:
> 
> 
>>It would be far better to pick a smaller upper bound by default and
>>require an option to be set to go over it. This would allow you to
>>produce an error message like "maxOccurs too large; use 'unbounded'
>>instead" that the user could understand.
>>
>>Bob
> 
> 
> ---------------------------
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: maxOccurs="99999"

Posted by Michael Glavassevich <mr...@apache.org>.
Hi Bob,

Applications are already able to set an upper bound on maxOccurs. All you
have to do is register a SecurityManager [1][2] on an instance of the
parser and call setMaxOccurNodeLimit(int) on the SecurityManager
with the desired limit.

[1] http://xml.apache.org/xerces2-j/properties.html#security-manager
[2] http://xml.apache.org/xerces2-j/javadocs/xerces2/org/apache/xerces/util/SecurityManager.html

On Mon, 22 Mar 2004, Bob Foster wrote:

> It would be far better to pick a smaller upper bound by default and
> require an option to be set to go over it. This would allow you to
> produce an error message like "maxOccurs too large; use 'unbounded'
> instead" that the user could understand.
>
> Bob

---------------------------
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


maxOccurs="99999"

Posted by Bob Foster <bo...@objfac.com>.
Just a comment. Xerces' handling of large maxOccurs values seems pretty 
broken. When I debugged into it, I discovered that the outofmemory 
exceptions were caused by Xerces trying to allocate, IIRC, a table with 
dimensions 199999*199999.

Yes, you can always tell the user to use "unbounded", but Xerces should 
not fail with an utterly predictable OutOfMemoryException (which, by the 
way, can fail silently if it happens in a background thread in some 
environments) for this case.

It would be far better to pick a smaller upper bound by default and 
require an option to be set to go over it. This would allow you to 
produce an error message like "maxOccurs too large; use 'unbounded' 
instead" that the user could understand.

Bob


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: parsing and analysing schemas in 2.0.1

Posted by Paul Truda <bi...@tpg.com.au>.
I'm glad that there is at least ONE person as confussed and frustrated 
as I am!! :)) Sorry I cannot help. It all seems such a lot of effort, 
just to read a flat file doesn't it??

Kind regards
 Paul Truda

amit shetty wrote:

> Hey folks, I have tried a lot, searched a lot, and I am not able to 
> figure out how to do this. Would
> really appreciate it if you guys could help me on this.
> I need to load an XSD and go through its contents for my project. I am 
> also restricted to version 2.0.1 of xerces. Any help on this would be 
> really appreciated!
> Thanks in advance!
> Amit
>
> _________________________________________________________________
> Find a broadband plan that fits. Great local deals on high-speed 
> Internet access. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>
>

-- 
From
Paul Truda
Bistra/CCCP/Trudata
please reply to paultruda@bistra.com.au
phone 02 9403 1400
fax 02 9403 1447
web www.bistra.com.au



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org