John L. Clark wrote:
> I am trying to sort out some weird behavior with respect to including
> system configurations and augmenting detection capabilities.  In
> particular, I have included a system configuration and added another
> detection section to the parent configuration.  My first problem is that
> with the additional detection section, the included detection no longer
> seems to work.  Is there any way to add new detection functionality to
> a previous set?

No, there is no way to augment an existing detection rule. You need to 
totally redefine it.



> My second problem is that a given detection rule doesn't seem to match,
> and I'm not entirely sure why.  The detection rule is of the form:
> 
>   <cfg:detect>
>     <cfg:dtdSystemId>http://some.where/some.dtd</cfg:dtdSystemId>
>   </cfg:detect>
> 
> But this is not matching an external entity reference of the form:
> 
>   <!DOCTYPE root PUBLIC "-//Group//Some PubidLiteral//EN"
>   "http://some.where/some.dtd";>
> 
> It is not entirely clear from the documentation (perhaps the bug lies
> there), but it might be that <cfg:dtdSystemId> only matches the
> SystemLiteral[0] of a SYSTEM external entity reference and that
> <cfg:dtdPublicId> only matches the PubidLiteral of a PUBLIC external
> entity reference.  If this is the case, then I seek the ability to match
> on the SystemLiteral of the PUBLIC external entity reference.  This may
> be a non-issue, as it may be true that I can always match on the
> PubidLiteral instead, but I am concerned about allocating PubidLiterals
> (but not SystemLiterals) to information sets which I am developing.
> 

---
<cfg:dtdSystemId>http://some.where/some.dtd</cfg:dtdSystemId>
---

matches both

---
<!DOCTYPE root PUBLIC "-//Group//Some PubidLiteral//EN"
"http://some.where/some.dtd";>
---

and

---
<!DOCTYPE root SYSTEM "http://some.where/some.dtd";>
---

Your problem may be elsewhere because, in an attempt to reproduce your 
problem, I have changed the detection rule in sdocbook.xxe from:

---
<detect>
   <dtdPublicId substring="true">DTD Simplified DocBook XML</dtdPublicId>
</detect>
---

to:

---
<detect>
<dtdSystemId>http://www.oasis-open.org/docbook/xml/simple/4.1.2.5/sdocbook.dtd</dtdSystemId>
</detect>
---

and I was able to correctly open my Simplified DocBook documents. That 
is, I was not able to reproduce the problem you described.


Reply via email to