OK. Next version of XXE will allow detecting a document type based on attributes found in the root element. The detection may be based on attribute names and/or attribute values.
(* Internal reasons prevent the implementation from using any element other than the root element. * Speed constraints prevent the implementation from using the power of XPath expressions.) Camille B?gnis wrote: > Hussein Shafie a ?crit : > > [...] > >>In the example above, the detection would be based on the presence of an >>attribute of the root element. This is currently not implemented but >>would pose no conceptual or technical problem. If there is sufficient >>interest, we could implement this feature. > > I support this stringly as it would also be very useful for DocBook > variants http://www.docbook.org/tdg5/en/html/ch05.html#s-notdocbook Daniel Dekany wrote: > I guess if you extend the detection mechanism it will be utilized by > many. Like I already wanted to send a feature request in this topic. I > wanted config detection based on the *value* of an attribute (or if an > NMTOKEN occurs in its value), but it seems not be possible. And maybe > PI-s could be usable for detection as well. > > You used to say that one could customize XXE to meet his > needs/conventions. OK, but the problem is, if someone installs the > customized DocBook config that was made for project A, which has its > own particularities, then that config will be used for all DocBook > documents, not only for those that belong to project A. To work this > around, currently I said that project A documentation uses exactly > DocBook V4.5 and then I use the DTD public ID for the detection, and > hope that those who install the addon will not run into other V4.5 > DocBook-s too often. In fact, I already have another custom DocBook > for project B, which only to let XXE using the proper config on my XEE > installation (which must handle documents from both projects) uses > DocBook v4.4 instead of v4.5. > > Now if I could mark somehow which project the DocBook document belongs > to, that would solve this. Like, I could use a <book > conformance="projectA">...</book>. Or a PI maybe, like <?editor > conventions="projectA" ?> (but I'm not sure how good idea that is).

