xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Franco Lazzarino <f...@ufl.edu>
Subject Re: Schema retrieval error
Date Tue, 20 Jul 2004 19:58:06 GMT
I forgot to mention that all the elements that errors occur are defined
as 'xsd:any' elements in the schema.
<xsd:any namespace="##any" maxOccurs="unbounded"/>

but each schema associated with these elements is declared in the root
element of the document.

everything that is under the root (METS) namespace validates fine. the
elements associated with the non-root namespaces are the ones that are
not validating. it seems as if these schemas are not being accessed.

On Tue, 2004-07-20 at 12:48, Franco Lazzarino wrote:
> I believe that xmlbeans is not retrieving the proper schemas for
> namespaces that are used inside the document that are different than the
> namespace of the document element.
> 
> For example, when I parse the document and validate it using the code
> below I get the given output.
> 
> XML:
> <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
> <METS:mets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xmlns:METS="http://www.loc.gov/METS/"
> 	xmlns:xlink="http://www.w3.org/TR/xlink"
> 	xmlns:dc="http://purl.org/dc/elements/1.1/"
> 	xmlns:techmd="http://www.fcla.edu/dls/md/techmd/" 	
> 	xmlns:palmm="http://www.fcla.edu/dls/md/palmm/"
> 	xmlns:rightsmd="http://www.fcla.edu/dls/md/rightsmd/"
> 	xsi:schemaLocation="http://www.loc.gov/METS/
> http://www.loc.gov/standards/mets/mets.xsd
> 		http://purl.org/dc/elements/1.1/
> http://dublincore.org/schemas/xmls/simpledc20021212.xsd		
> 		http://www.fcla.edu/dls/md/techmd/
> http://www.fcla.edu/dls/md/techmd.xsd
> 		http://www.fcla.edu/dls/md/palmm/ http://www.fcla.edu/dls/md/palmm.xsd
> 		http://www.fcla.edu/dls/md/rightsmd/
> http://www.fcla.edu/dls/md/rightsmd.xsd"
> 		...
> 		...
> 		...
> 		<METS:mdWrap MIMETYPE="text/xml" MDTYPE="DC">
> 			<METS:xmlData>
> 				<dc:title>Crop statistics</dc:title>
> 				<dc:date>1931</dc:date>
> 			</METS:xmlData>
> 		</METS:mdWrap>
> 		...
> 		...
> 		...
> </METS:mets>
> 
> 
> CODE:
> XmlOptions options = new XmlOptions();
> Vector errors = new Vector();
> options.setErrorListener(errors);
> 
> MetsDocument root = MetsDocument.Factory.parse(file, options);
> 
> root.validate(options);
> for (Iterator iter = errors.iterator(); iter.hasNext();) {
> 	XmlError error = (XmlError) iter.next();
> 	System.out.println(error.getMessage());
> 	System.out.println();
> }
> 
> 
> OUTPUT:
> Element not allowed (strict wildcard, and no definition found):
> title@http://purl.org/dc/elements/1.1/ in element
> xmlData@http://www.loc.gov/METS/
> 	...
> 	...
> 	...
> 
> is this something that I am (not?) doing, or is it part of xmlbeans that
> is not finished yet?
> 
> -----------------------------
> Franco Lazzarino flaz@ufl.edu
> Florida Center for Library Automation http://www.fcla.edu
> 
> 
> 
> - ---------------------------------------------------------------------
> To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
> Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
> 
> 


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Mime
View raw message