[ 
https://issues.apache.org/jira/browse/JAXME-101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Himanshu Rathod updated JAXME-101:
----------------------------------

    Attachment: circular2.xsd
                circular1.xsd

> JaxMe XS does not handle circular dependencies correctly
> --------------------------------------------------------
>
>                 Key: JAXME-101
>                 URL: https://issues.apache.org/jira/browse/JAXME-101
>             Project: JaxMe
>          Issue Type: Bug
>          Components: JaxMeXS
>    Affects Versions: 0.5
>         Environment: Windows Vista
>            Reporter: Himanshu Rathod
>         Attachments: circular1.xsd, circular2.xsd, jaxme-xslogicalparser.patch
>
>
> See attached sample XSD files for example of circular dependency.  
> Here is the sample program used to parse the schema:
> import java.io.File;
> import java.io.FileInputStream;
> import org.apache.ws.jaxme.xs.XSParser;
> import org.apache.ws.jaxme.xs.XSSchema;
> import org.apache.ws.jaxme.xs.XSType;
> import org.xml.sax.InputSource;
> public class Main {
>       public static void main(String[] args) throws Exception {
>               String fileName = "circular1.xsd";
>               File f = new File(fileName);
>               FileInputStream fs = new FileInputStream(f);
>               InputSource is = new InputSource(fs);
>               is.setSystemId(f.toURL().toString());
>               XSParser parser = new XSParser();
>               parser.setValidating(false);
>               XSSchema schema = parser.parse(is);
>               System.out.println("Schema = " + schema);
>               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());
>               }
>       }
> }
> Here is the exception received when running the code above on the attached 
> files:
> Exception in thread "main" 
> org.apache.ws.jaxme.xs.parser.impl.LocSAXException: At 
> file:/C:/Users/Himanshu/eclipse_workspace/JaxmeTest/circular1.xsd, line 4, 
> column 28: A global type 
> {http://TEST/1.0/edu.emory.cci.xml.schema.circular1}Type1 is already defined.
>       at org.apache.ws.jaxme.xs.impl.XSSchemaImpl.add(XSSchemaImpl.java:322)
>       at 
> org.apache.ws.jaxme.xs.impl.XSLogicalParser.add(XSLogicalParser.java:409)
>       at 
> org.apache.ws.jaxme.xs.impl.XSLogicalParser.parse(XSLogicalParser.java:590)
>       at 
> org.apache.ws.jaxme.xs.impl.XSContentHandlerImpl.endDocument(XSContentHandlerImpl.java:80)
>       at 
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.java:769)
>       at 
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.endEntity(XMLDocumentScannerImpl.java:560)
>       at 
> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.endEntity(XMLEntityManager.java:1779)
>       at 
> com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1758)
>       at 
> com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipSpaces(XMLEntityScanner.java:1259)
>       at 
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(XMLDocumentScannerImpl.java:1247)
>       at 
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
>       at 
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
>       at 
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
>       at 
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
>       at 
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
>       at 
> org.apache.ws.jaxme.xs.impl.XSLogicalParser.runContentHandler(XSLogicalParser.java:322)
>       at 
> org.apache.ws.jaxme.xs.impl.XSLogicalParser.parse(XSLogicalParser.java:724)
>       at org.apache.ws.jaxme.xs.XSParser.parse(XSParser.java:178)
>       at edu.emory.cci.jaxmetest.Main.main(Main.java:26)

-- 
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: jaxme-dev-unsubscr...@ws.apache.org
For additional commands, e-mail: jaxme-dev-h...@ws.apache.org

Reply via email to