You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "John (JIRA)" <xm...@xml.apache.org> on 2010/04/06 14:57:34 UTC

[jira] Created: (XMLBEANS-433) Incorrect symbol position detection

Incorrect symbol position detection
-----------------------------------

                 Key: XMLBEANS-433
                 URL: https://issues.apache.org/jira/browse/XMLBEANS-433
             Project: XMLBeans
          Issue Type: Bug
          Components: Validator
    Affects Versions: Version 2.5
         Environment: java version "1.6.0_15" Java(TM) SE Runtime Environment (build 1.6.0_15-b03) Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02, mixed mode)
            Reporter: John


While trying to validate an beforehand invalid XMLSchema:

<xs:schema targetNamespace="http://openuri.org/easypo"
    xmlns:po="http://openuri.org/easypo"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
    <xs:element name="integration-design-patterns">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="integration-pattern" type="po:integration-pattern" minOccurs="1" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="integration-pattern">
        <xs:sequence>
            <xs:element name="pattern-name" type="xs:string" />
            <xs:element name="description" type="xs:string" />
            <xs:element name="full-oop-support-required" type="xs:boolean" />
            <xs:element name="implementation-dependencies" type="po:implementation-dependencies" xmlns: minOccurs="0" maxOccurs="3"/>
            <xs:element name="implemented-frameworks" type="po:implemented-frameworks" minOccurs="0" maxOccurs="10"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="implementation-dependencies">
    	<xs:sequence>
            <xs:element name="pattern-name" type="xs:string" minOccurs="1"/>
        </xs:sequence>
            </xs:complexType>
    <xs:complexType name="implemented-frameworks">
        <xs:sequence>
            <xs:element name="framework" type="po:framework" minOccurs="1" maxOccurs="10"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="framework">
    	<xs:sequence>
    		<xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string" />
    		<xs:element name="language" minOccurs="1" maxOccurs="1" type="xs:string" />
    	</xs:sequence>
    </xs:complexType>
</xs:schema>

which itself contains an invalid "xmlns: " token, was processed by Validator in a following way:

/home/webautomator/xmlbeans-2.5.0/samples/test/design-patterns.xsd not loadable: org.apache.xmlbeans.XmlException: /home/webautomator/xmlbeans-2.5.0/samples/test/design-patterns.xsd:17:106: error: Unexpected character encountered (lex state 10): 'm'
/home/webautomator/xmlbeans-2.5.0/samples/test/integra.xml not loadable: org.apache.xmlbeans.XmlException: /home/webautomator/xmlbeans-2.5.0/samples/test/integra.xml:9:3: error: Unexpected character encountered while in a closing tag: 'x'
org.apache.xmlbeans.XmlException: /home/webautomator/xmlbeans-2.5.0/samples/test/integra.xml:9:3: error: Unexpected character encountered while in a closing tag: 'x'
	at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3486)
	at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1276)
	at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1263)
	at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345)
	at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:252)
	at org.apache.xmlbeans.impl.tool.InstanceValidator.extraMain(InstanceValidator.java:191)
	at org.apache.xmlbeans.impl.tool.InstanceValidator.main(InstanceValidator.java:51)
Caused by: org.xml.sax.SAXParseException: Unexpected character encountered while in a closing tag: 'x'
	at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.reportFatalError(Piccolo.java:1038)
	at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:723)
	at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3454)
	... 6 more

A good thing is that it finds a proper 17:106 position, but it is the end of invalid token, nut it's beginning. The problem is that I do not have a tag 'x', "integra.xml:9:3: error: Unexpected character encountered while in a closing tag: 'x'", and 'm' symbol is appears to be interpreted not as a part of invalid token.

As a result an invalid exception info came up. John 

-- 
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