You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by ja...@ws.apache.org on 2004/07/19 04:06:40 UTC
[jira] Created: (JAXME-16) tag generating extra case 0 statement in ContentHandlerImpl#startElement
Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/JAXME-16
Here is an overview of the issue:
---------------------------------------------------------------------
Key: JAXME-16
Summary: <xs:all> tag generating extra case 0 statement in ContentHandlerImpl#startElement
Type: Bug
Status: Unassigned
Priority: Major
Project: JaxMe
Versions:
current (nightly)
Assignee:
Reporter: Patrick Hourigan
Created: Sun, 18 Jul 2004 7:05 PM
Updated: Sun, 18 Jul 2004 7:05 PM
Environment: Ant v1.6.0
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
Win XP
Description:
I have an XSD as below.
<xs:simpleType name="AdId">
<xs:annotation>
<xs:documentation>
Foo foo foo
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[Y][0-9]{7}"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="AdDetails">
<xs:annotation>
<xs:documentation>
Fooo foo foo
</xs:documentation>
</xs:annotation>
<xs:all>
<xs:element name="ad_id" type="ypoladstat:AdId"/>
</xs:all>
</xs:complexType>
When I run this trough the standard ant jaxme target, I get the AdDetailsHandlerImpl generated (along with the other gen'd code).
The problem is the gen'd content handler won't compile, because od an extra case 0 statement, see my code below.
public void startElement(String pNamespaceURI, String pLocalName, String pQName, Attributes pAttr) throws SAXException {
switch (__level++) {
case 0:
setResult(newResult());
if (pAttr != null) {
for (int _1 = 0; _1 < pAttr.getLength(); _1++) {
super.addAttribute(pAttr.getURI(_1), pAttr.getLocalName(_1), pAttr.getValue(_1));
}
}
break;
case 1:
if ("http://sensis.com.au/C3/YPOL/graphics/ypoladstat".equals(pNamespaceURI)) {
if ("ad_id".equals(pLocalName)) {
switch (__state) {
case 0:
case 0:
__state = 3;
__handler = getData().getAtomicHandler();
__handler.startDocument();
__handler.startElement(pNamespaceURI, pLocalName, pQName, pAttr);
break;
default:
validationEvent(ValidationEvent.WARNING, "The element " + pQName + " was unexpected at this place.", ValidationEvents.EVENT_UNEXPECTED_CHILD_STATE);
break;
}
}
}
break;
default:
if (__handler == null) {
super.startElement(pNamespaceURI, pLocalName, pQName, pAttr);
} else {
__handler.startElement(pNamespaceURI, pLocalName, pQName, pAttr);
}
}
}
When I change the XSD to use <xs:sequence> instead of <xs:all> the content handler code is generated fine.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org
[jira] Closed: (JAXME-16) tag generating extra case 0 statement in ContentHandlerImpl#startElement
Posted by ja...@ws.apache.org.
Message:
The following issue has been closed.
Resolver: Jochen Wiedmann
Date: Sat, 24 Jul 2004 5:26 PM
Duplicate of JAXME-15
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/JAXME-16
Here is an overview of the issue:
---------------------------------------------------------------------
Key: JAXME-16
Summary: <xs:all> tag generating extra case 0 statement in ContentHandlerImpl#startElement
Type: Bug
Status: Closed
Priority: Major
Resolution: DUPLICATE
Project: JaxMe
Versions:
current (nightly)
Assignee:
Reporter: Patrick Hourigan
Created: Sun, 18 Jul 2004 7:05 PM
Updated: Sat, 24 Jul 2004 5:26 PM
Environment: Ant v1.6.0
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
Win XP
Description:
I have an XSD as below.
<xs:simpleType name="AdId">
<xs:annotation>
<xs:documentation>
Foo foo foo
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[Y][0-9]{7}"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="AdDetails">
<xs:annotation>
<xs:documentation>
Fooo foo foo
</xs:documentation>
</xs:annotation>
<xs:all>
<xs:element name="ad_id" type="ypoladstat:AdId"/>
</xs:all>
</xs:complexType>
When I run this trough the standard ant jaxme target, I get the AdDetailsHandlerImpl generated (along with the other gen'd code).
The problem is the gen'd content handler won't compile, because od an extra case 0 statement, see my code below.
public void startElement(String pNamespaceURI, String pLocalName, String pQName, Attributes pAttr) throws SAXException {
switch (__level++) {
case 0:
setResult(newResult());
if (pAttr != null) {
for (int _1 = 0; _1 < pAttr.getLength(); _1++) {
super.addAttribute(pAttr.getURI(_1), pAttr.getLocalName(_1), pAttr.getValue(_1));
}
}
break;
case 1:
if ("http://sensis.com.au/C3/YPOL/graphics/ypoladstat".equals(pNamespaceURI)) {
if ("ad_id".equals(pLocalName)) {
switch (__state) {
case 0:
case 0:
__state = 3;
__handler = getData().getAtomicHandler();
__handler.startDocument();
__handler.startElement(pNamespaceURI, pLocalName, pQName, pAttr);
break;
default:
validationEvent(ValidationEvent.WARNING, "The element " + pQName + " was unexpected at this place.", ValidationEvents.EVENT_UNEXPECTED_CHILD_STATE);
break;
}
}
}
break;
default:
if (__handler == null) {
super.startElement(pNamespaceURI, pLocalName, pQName, pAttr);
} else {
__handler.startElement(pNamespaceURI, pLocalName, pQName, pAttr);
}
}
}
When I change the XSD to use <xs:sequence> instead of <xs:all> the content handler code is generated fine.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org