[rules-users] About ExtensibleXmlParser

tangrui.cn at gmail.com tangrui.cn at gmail.com
Tue Dec 14 08:29:32 EST 2010


Hi list,

In the method resolveSchema of ExtensibleXmlParser class, I think there's a
problem.

I'm using a changeset.xml, which has such a header

<change-set xmlns="http://drools.org/drools-5.0/change-set"
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
    xs:schemaLocation="http://drools.org/drools-5.0/change-set *
/META-INF/schema/change-set-1.0.0.xsd*">

I want to fetch the xsd file from the path /META-INF/schema, but failed.

According to the method statement following, to find a xsd file name, the
systemId was substring-ed using lastIndexOf method. In this case no matter
what path I use to replace the bold text, only change-set-1.0.0.xsd will be
picked. Then the method will find the file under /META-INF, META-INF and
class path. That means even I've written the path
/META-INF/schema/change-set-1.0.0.xsd, but /META-INF/change-set-1.0.0.xsd
will be used.

        String xsd;
        int index = systemId.lastIndexOf( "/" );
        if ( index == -1 ) {
            index = systemId.lastIndexOf( "\\" );
        }
        if ( index != -1 ) {
            xsd = systemId.substring( index + 1 );
        } else {
            xsd = systemId;
        }
-- 
唐睿
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20101214/e5d16551/attachment.html 


More information about the rules-users mailing list