[prev in list] [next in list] [prev in thread] [next in thread]
List: xmlbeans-dev
Subject: [jira] Commented: (XMLBEANS-401) SchemaParticle.getIntMaxOccurs
From: "Wing Yew Poon (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date: 2009-03-05 0:15:56
Message-ID: 347883890.1236212156242.JavaMail.jira () brutus
[Download RAW message or body]
[ https://issues.apache.org/jira/browse/XMLBEANS-401?page=com.atlassian.jira.plugi \
n.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679008#action_12679008 ]
Wing Yew Poon commented on XMLBEANS-401:
----------------------------------------
Shashank, as Radu said, the problem is with your code. And as Cezar said, you should \
post your request for help to the user mailing list instead of opening a bogus bug \
report. What you're essentially saying is: "Here, this is my code, this is what I \
want it to do, but it doesn't, so please change my code and make it work." I'll give \
you a hint then:
Suppose
SchemaType st = ...; // type of "purchase-order" global element in your \
easypo.xsd
SchemaParticle sp = st.getContentModel(); // this is the sequence, \
sp.getParticleType() == SchemaParticle.SEQUENCE
SchemaParticle[] elems = sp.getParticleChildren(); // these are the elements \
in the sequence SchemaParticle name = elems[0]; // the element with name="name"
What is the value of (name.getIntMaxOccurs() > 1)? It is true, since \
maxOccurs="unbounded" for this element, and getIntMaxOccurs() returns the max value \
for int in this case (2147483647). What is the value of (name.getMaxOccurs() != \
null)? It is false, since, as the javadoc says, getMaxOccurs()
"Returns the maxOccurs value for this particle, or null if it is unbounded. If it's \
not specified explicitly, this returns BigInteger.ONE."
> SchemaParticle.getIntMaxOccurs doesn't return the correct value for some particular \
> xsd shema(attached)
> -------------------------------------------------------------------------------------------------------
>
> Key: XMLBEANS-401
> URL: https://issues.apache.org/jira/browse/XMLBEANS-401
> Project: XMLBeans
> Issue Type: Bug
> Components: Compiler
> Affects Versions: Version 2.4.1
> Environment: Standalone java program with OS win xp
> Reporter: Shashank Gupta
> Attachments: Copy of easypo.xsd, ParseXsd.java
>
>
> I am trying to compile the xsd and retrieve information(like name, type, \
> isMultivalue ) about the leaf nodes. The SchemaParticle.getIntMaxOccurs is not \
> returning the right value. I have attached both the sample program and the xsd \
> file. The other thing i have noticed that if i remove the elements line-item and \
> shipper then SchemaParticle.getIntMaxOccurs returns right value.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic