When using http://apache.org/xml/properties/schema/external-schemaLocation
I have found I need to use space seperate "URI XSD" like

"schema-uri file-uri schema-uri file-uri"

 
Here's some code from xsdvalidate 

http://www.xmlsh.org/CommandXsdvalidate

        if( mSchemaList != null ) {
                        StringBuffer sb = new StringBuffer();
                        for( String s : mSchemaList ){
                                if( sb.length() > 0 )
                                        sb.append(" ");
                                sb.append( s );
                                
                        }
                        
        
                        parser.setProperty(
        
"http://apache.org/xml/properties/schema/external-schemaLocation";,
                                        sb.toString() );
                                
                }

----------------------------------------
David A. Lee
d...@calldei.com
http://www.xmlsh.org

From: Dianne Richards [mailto:dianne...@gmail.com] 
Sent: Monday, July 18, 2011 12:22 PM
To: j-users@xerces.apache.org
Subject: Accessing a local schema file(s)

Hi - I'm trying to access a local schema file using the property
http://apache.org/xml/properties/schema/external-schemaLocation. It doesn't
seem to work. Currently I'm using the property
http://java.sun.com/xml/jaxp/properties/schemaSource with the following
code:

FileInputStream schema = 
                new FileInputStream(new
File("G:/workspace_2.1.x/test/src/test/xml/any/bse/base.xsd"));
parser.setProperty
            ("http://java.sun.com/xml/jaxp/properties/schemaSource";,
                schema); 

This works. But, I want to be able to specify 2 schemas, which is valid for
the schemaLocation and the documentation for
http://apache.org/xml/properties/schema/external-schemaLocation says is
possible. But, I can't even get 1 to work. I've tried the following
different combinations for the property value:

file:///G:/workspace_2.1.x/test/src/test/xml/any/bse base.xsd
file:///G:/workspace_2.1.x/test/src/test/xml/any/bse/base.xsd
file:/G:/workspace_2.1.x/test/src/test/xml/any/bse base.xsd
file:/G:/workspace_2.1.x/test/src/test/xml/any/bse/base.xsd

Is this supposed to work - specifying a local file url? If so, am I doing
something wrong?

Thanks for your help - Dianne 


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-users-h...@xerces.apache.org

Reply via email to