Skip to main content

XJC configuration maxOccurs=">5000"

4 replies [Last post]
mac24nz
Offline
Joined: 2007-11-27

Hi.

How do I change the configuration for XJC? I have a schema which allows more than 5000 elements

xjc -xmlschema -p this.is.my.package ThisIsMySchema.XML

my schema
....

....

which results in:
parsing a schema...
[ERROR] Current configuration of the parser doesn't allow a maxOccurs attribute
value to be set greater than the value 5.000.
line 1728 of file:/C:/ThisIsMySchema.XML

Failed to parse a schema.

I'm assuming there is a little config file, that I'm just not seeing...I'd really appreciate some help.

Thanks

Martin

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jimmy Zhang

VTD-XML 2.9, the next generation XML Processing API for SOA and Cloud computing, has been released. Please visit https://sourceforge.net/projects/vtd-xml/files/ to download the latest version.
a.. Strict Conformance
a.. VTD-XML now fully conforms to XML namespace 1.0 spec
b.. Performance Improvement
a.. Significantly improved parsing performance for small XML files
c.. Expand Core VTD-XML API
a.. Adds getPrefixString(), and toNormalizedString2()
d.. Cutting/Splitting
a.. Adds getSiblingElementFragment()
e.. A number of bug fixes and code enhancement including:
a.. Fixes a bug for reading very large XML documents on some platforms
b.. Fixes a bug in parsing processing instruction
c.. Fixes a bug in outputAndReparse()
[att1.html]

Martin Grebac

Hi,
this is a parser issue, not XJC. IIRC, this is a security setting. You
should either change the maxOccurs to "unbounded" in your schema, or
configure your parser to allow such high values
(FEATURE_SECURE_PROCESSING), or pass -nv option to XJC. -nv bypasses
jaxp (and validation) and uses xsom for parsing.
MartiNG

On 26.4.10 12:51, metro@javadesktop.org wrote:
> Hi.
>
> How do I change the configuration for XJC? I have a schema which allows more than 5000 elements
>
> xjc -xmlschema -p this.is.my.package ThisIsMySchema.XML
>
> my schema
> ....
>
> ....
>
> which results in:
> parsing a schema...
> [ERROR] Current configuration of the parser doesn't allow a maxOccurs attribute
> value to be set greater than the value 5.000.
> line 1728 of file:/C:/ThisIsMySchema.XML
>
> Failed to parse a schema.
>
> I'm assuming there is a little config file, that I'm just not seeing...I'd really appreciate some help.
>
> Thanks
>
> Martin[b][/b][b][/b][i][/i]
> [Message sent by forum member 'mac24nz']
>
> http://forums.java.net/jive/thread.jspa?messageID=399038
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
> For additional commands, e-mail: users-help@metro.dev.java.net
>
>

--
Martin Grebac, http://blogs.sun.com/mgrebac

Web Technologies& Standards
Sun Microsystems Czech

ICQ: 93478885

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net

mac24nz
Offline
Joined: 2007-11-27

how would one go about configuring my parser?
I like the idea of checking my xml against my schema as it is defined.
The option -nv did however generate the java classes. Thank you.

phax
Offline
Joined: 2006-11-13

I had the same problem with JAXB 2.2.7 but solved it by adding Xerces 2.11.0 und xml-apis 1.4.0.1 to the XJC classpath!