You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Steven Grossman (JIRA)" <xe...@xml.apache.org> on 2006/05/18 15:04:06 UTC

[jira] Commented: (XERCESJ-1132) "Validation error: cvc-elt.1: Cannot find the declaration of element 'phonebook'." where Java 1.5.0 validator works.

    [ http://issues.apache.org/jira/browse/XERCESJ-1132?page=comments#action_12412340 ] 

Steven Grossman commented on XERCESJ-1132:
------------------------------------------

i believe this belongs in the JAXP validation component - created issue XERCESJ-1163 

> "Validation error: cvc-elt.1: Cannot find the declaration of element 'phonebook'." where Java 1.5.0 validator works.
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: XERCESJ-1132
>          URL: http://issues.apache.org/jira/browse/XERCESJ-1132
>      Project: Xerces2-J
>         Type: Bug

>   Components: XML Schema API
>     Versions: 2.7.1
>  Environment: OS X, Java 1.5.0
>     Reporter: Scott Lamb

>
> I'm trying to make use of the newish javax.xml.validation APIs. I can get them to work with the Xerces built in to Java 1.5 but not with Xerces 2.7.1. I've got a project still on Java 1.4, so I need to get a non-bundled Xerces working.
> I'm testing with the sample code available from <http://www-128.ibm.com/developerworks/xml/library/x-jaxp/>
> [slamb@dhcp-105 /tmp]$ java -version
> java version "1.5.0_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-83)
> Java HotSpot(TM) Client VM (build 1.5.0_05-48, mixed mode, sharing)
> $ curl -O ftp://www6.software.ibm.com/software/developer/library/x-jaxp-all-about.zip
> $ unzip x-jaxp-all-about.zip
> $ javac TestDOMValidation.java
> Xerces 2.7.1's SchemaFactory implementation errors out:
> java \
>     -classpath $HOME/.maven/repository/xerces/jars/xercesImpl-2.7.1.jar:. \
>     -Djaxp.debug=true \
>     -Djavax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema=org.apache.xerces.jaxp.validation.XMLSchemaFactory \
>     TestDOMValidation simple.xml simple.xsd
> JAXP: find factoryId =javax.xml.parsers.DocumentBuilderFactory
> JAXP: found jar resource=META-INF/services/javax.xml.parsers.DocumentBuilderFactory using ClassLoader: sun.misc.Launcher$AppClassLoader@a9c85c
> JAXP: found in resource, value=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
> JAXP: created new instance of class org.apache.xerces.jaxp.DocumentBuilderFactoryImpl using ClassLoader: sun.misc.Launcher$AppClassLoader@a9c85c
> JAXP: using thread context class loader (sun.misc.Launcher$AppClassLoader@a9c85c) for search
> JAXP: Looking up system property 'javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema'
> JAXP: The value is 'org.apache.xerces.jaxp.validation.XMLSchemaFactory'
> JAXP: instanciating org.apache.xerces.jaxp.validation.XMLSchemaFactory
> JAXP: loaded it from jar:file:/Users/slamb/.maven/repository/xerces/jars/xercesImpl-2.7.1.jar!/org/apache/xerces/jaxp/validation/XMLSchemaFactory.class
> JAXP: factory 'org.apache.xerces.jaxp.validation.XMLSchemaFactory' was found for http://www.w3.org/2001/XMLSchema
> Validation error: cvc-elt.1: Cannot find the declaration of element 'phonebook'.
> but the one built in to Java 1.5 works correctly:
> $ java -Djaxp.debug=true TestDOMValidation simple.xml simple.xsd
> JAXP: find factoryId =javax.xml.parsers.DocumentBuilderFactory
> JAXP: loaded from fallback value: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
> JAXP: created new instance of class com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl using ClassLoader: sun.misc.Launcher$AppClassLoader@a9c85c
> JAXP: using thread context class loader (sun.misc.Launcher$AppClassLoader@a9c85c) for search
> JAXP: Looking up system property 'javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema'
> JAXP: The property is undefined.
> JAXP: found null in $java.home/jaxp.properties
> JAXP: no META-INF/services/javax.xml.validation.SchemaFactory file was found
> JAXP: attempting to use the platform default XML Schema validator
> JAXP: instanciating com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl
> JAXP: loaded it from jar:file:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar!/com/sun/org/apache/xerces/internal/jaxp/validation/xs/SchemaFactoryImpl.class
> JAXP: factory 'com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl' was found for http://www.w3.org/2001/XMLSchema
> JAXP: find factoryId =javax.xml.transform.TransformerFactory
> JAXP: loaded from fallback value: com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
> JAXP: created new instance of class com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl using ClassLoader: sun.misc.Launcher$AppClassLoader@a9c85c
> Document validates fine.
> xmllint also works fine with these files:
> $ xmllint --schema simple.xsd simple.xml
> [...]
> simple.xml validates

-- 
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: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org