XSParser.parse()unable to parse schema with ArrayType attribute.
----------------------------------------------------------------
Key: JAXME-55
URL: http://issues.apache.org/jira/browse/JAXME-55
Project: JaxMe
Type: Bug
Components: JaxMeXS
Versions: current (nightly)
Environment: WIN 2000 Server, JDK 1.4.2_06.
Reporter: Kumar Raja
Hi,
I am very new to JAXME and I trying to parse a schema using the XSParser and I
running into few problems with few xsd files which has the ArrayType attribute
and one example is given below with the schema, code and the exception.
** I might be missing something and if so please advice.
Please help on this and thanking you in advance.
-Kumar.
Code Snippet
------------
import java.io.FileInputStream;
import org.xml.sax.InputSource;
import org.apache.ws.jaxme.xs.XSParser;
import org.apache.ws.jaxme.xs.*;
public class MyParser {
public static void main(String[] args) throws Exception {
FileInputStream fs = new FileInputStream(args[0]);
InputSource is = new InputSource(fs);
//is.setSystemId(fs.toURL().toString()); // This is important, if you
use a DTD,
// external entities, schema validation, ...
// in other words: Other files
XSParser parser = new XSParser();
parser.setValidating(false);
XSSchema schema = parser.parse(is);
Object[] childs = schema.getChilds();
for (int i = 0; i < childs.length; i++)
{
Object o = childs[i];
System.out.println(o.getClass());
if (o instanceof XSType)
System.out.println(" name " +
((XSType)o).getName().getLocalName() );
}
}
}
SCHEMA 1
-------------
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:impl="http://localhost:7001/axis/EchoHeaders.jws"
xmlns:intf="http://localhost:7001/axis/EchoHeaders.jws"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://localhost:7001/axis/EchoHeaders.jws">
<complexType name="ArrayOf_soapenc_string">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" arrayType="soapenc:string[]" />
</restriction>
</complexContent>
</complexType>
</schema>
Exception for SCHEMA 1
--------------------------
Exception in thread "main" java.lang.IllegalStateException: Unknown attribute of
org.apache.ws.jaxme.xs.xml.impl.XsTAttributeImpl: arrayType
at org.apache.ws.jaxme.xs.parser.impl.AbstractXsSAXParser.startElement(A
bstractXsSAXParser.java:206)
at org.apache.ws.jaxme.xs.parser.impl.AbstractXsSAXParser.startElement(A
bstractXsSAXParser.java:246)
at org.apache.ws.jaxme.xs.parser.impl.AbstractXsSAXParser.startElement(A
bstractXsSAXParser.java:249)
at org.apache.ws.jaxme.xs.parser.impl.AbstractXsSAXParser.startElement(A
bstractXsSAXParser.java:249)
at org.apache.ws.jaxme.xs.parser.impl.AbstractXsSAXParser.startElement(A
bstractXsSAXParser.java:249)
at org.apache.ws.jaxme.xs.impl.XSContentHandlerImpl.startElement(XSConte
ntHandlerImpl.java:152)
at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
at org.apache.xerces.validators.common.XMLValidator.callStartElement(XML
Validator.java:1214)
at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumen
tScanner.java:1806)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.disp
atch(XMLDocumentScanner.java:1182)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)
at org.apache.ws.jaxme.xs.impl.XSLogicalParser.parse(XSLogicalParser.jav
a:662)
at org.apache.ws.jaxme.xs.XSParser.parse(XSParser.java:156)
at MyParser.main(MyParser.java:22)
-----------------------
SCHEMA 2
----------
<schema xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:ifws"
xmlns:intf="urn:ifws" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ifws"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://xml.apache.org/xml-soap"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="ArrayOf_xsd_string">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="soapenc:string[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="ObjList">
<sequence>
<element name="name" type="xsd:string"/>
<element name="id" type="xsd:long"/>
</sequence>
</complexType>
<complexType name="ArrayOfObjList">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="impl:ObjList[]"/>
</restriction>
</complexContent>
</complexType>
<complexType name="UdaStruct">
<sequence>
<element name="name" type="xsd:string"/>
<element name="type" type="xsd:string"/>
<element name="value" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfUdaStruct">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="impl:UdaStruct[]"/>
</restriction>
</complexContent>
</complexType>
</schema>
--
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
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]