On 10/25/2011 11:41 AM, Philippe Nobili wrote: > > We have a small XXE addon to let our users edits partially the content > of some specific XML files. The problem we face is the following: > > + We have a valid XML schema for this type of XML files, but for > historical reasons, there is no reference to any XML namespace in our > XML instances (xmlns is missing). > > Our XXE addon detects correctly the appropriate configuration based on > top element. Then, it correctly points to the correct XML schema, CSS > styles, etc etc/ > > All this works great, providing that we manually add the missing XML > namespace attribute to our XML instances, e.g.: > *xmlns="http://www.cggveritas.com/geovation/module/g2"* > > Is there a way to "fake" this declaration and make XXE believes that the > XML instances contain a properly formed xmlns attribute ? Or is there > any other way around ? (for backward-compatibility issues, we simply > cannot modify the XML instances and add this attribute....). >
I see no other solution than: [1] Translate your W3C XML Schema to a DTD. This DTD should specify the root element of your document using something like: --- <!ELEMENT g2> <!ATTLIST g2 xmlns CDATA #FIXED "http://www.cggveritas.com/geovation/module/g2"> --- [2] In your .xxe configuration file, add something like: --- <cfg:dtd systemId="g2.dtd"/> --- References: * http://www.xmlmind.com/xmleditor/_distrib/doc/configure/dtd.html -- XMLmind XML Editor Support List [email protected] http://www.xmlmind.com/mailman/listinfo/xmleditor-support

