Hello!

I`ve a little problem with 
setExternalSchemaLocation(setExternalNoNamespaceSchemaLocation) function from 
XalanSourceTreeParserLiaison class.

I'm using xalan-C++ for doing some actions with some set of xml-files.

Some of these files must validating against schema, which location specify in 
config file ("external" schema). Other files must be validating against 
schema, which location specify in parsed xml file (via xsi:shemaLocation 
attribute, "internal" schema)

How can I switch between these schema location ("external"/"internal")? I 
mean, if I use

theLiaison->setExternalNoNamespaceSchemaLocation("blah.xsd")

for file (before parsing) foo.xml, then all next parsing files bar1.xml, 
bar2.xml... bar666.xml etc. will be validating against this "external" schema 
(blah.xsd), but it must validate against "internal" schema. How "turn off" 
external schema validation?

For example:
class foo
{
        /*...*/

        //parse xml file
        XalanDocument*bar(const char*);
        
        //check what kind of validation we need ("external" or "internal")
        bool isNeedExternalSchemaLocation(const char*);
        /*...*/
        
        XalanSourceTreeParserLiaison*m_Liaison;

        //externalSchemaLocation URI
        const XalnDOMChar*extSchema;
}

XalanDocument*foo::bar(const char*file)
{
    const LocalFileInputSource inpsource(XalanDOMString(file).c_str());

    if(isNeedExternalSchemaLocation(file))
        //turn on "external" schema location
        m_Liaison->setExternalNoNamespaceSchemaLocation(extSchema);
    else
        //turn on "internal" schemaLocation (or "turn off" 
externalSchemaLocation) ... BUT HOW???  


    return m_Liaison->parseXMLStream(inpsource);
}

I search answer for this question on xalan-c-users, xerces-c-users lists, also 
i`m trying look in source code, but without results(( Can you help me or  
suggest direction?
Thanks in advance)
PS Sorry for my English )

Reply via email to