Project

Profile

Help

Support #5601

closed

Latter defined entity is honored rather than former one in Saxon-PE 11.3

Added by Toshihiko Makita over 2 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2022-07-13
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

I'm testing Saxon-PE 10.8 and 11.3 for user project. When I convert XML file with entity reference, the former entity definition is not honored and the latter defined entity is honored in Saxon-PE 11.3.

I attached the sample file archive: diff-2022-07-13.zip

Reproducing procedure

  1. Unzip diff-2022-07-13.zip
  2. Maintain JDK path and Saxon-PE path in xmllist/test-pe-10.8.ps1 and test-pe-11.3-edit.ps1
  3. At folder xmllist, open PowerShell
  4. Enter command "./test-pe-10.8.ps1". This command will generate output-10.8.xml from input.xml.
  5. Enter command "./test-pe-11.3-edit.ps1". This command will generate output-11.3.xml from input.xml.
  6. Compare the both results.

My test results

Input XML file

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book PUBLIC "-//AHF//DTD J2008 4.2-based AHF XML DTD for SM//EN" "ahfsm2-4.dtd">
<book>
    Ohm=&ohrm;
</book>

Entity definition

Entity ohrm is defined in iso-num.ent and AHFproc.ent.

iso-num.ent

<!ENTITY ohrm	"&#x2126;"> <!-- OHM SIGN -->

AHFproc.ent

<!ENTITY ohrm	"&#x03A9;"> <!-- Omega -->

Also AHFproc.ent is written after iso-inum.ent.

ahfsm2-4.dtd

<!ENTITY % ISOnum PUBLIC "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML" "iso-num.ent">
%ISOnum;
...
<!ENTITY % AHFproc PUBLIC "-//AHF//ENTITIES for Process//EN//XML" "AHFproc.ent">
%AHFproc;

Output results

output-10.8.xml (The former defined one is adopted)

output-11.3.xml (The latter defined one is adopted)

I think that Saxon-PE 11.3 does not conform XML entity definition rule: the first defined one will be adopted. If there is my misunderstanding, please let me know.

Regards,


Files

saxon-10.8.png (35.8 KB) saxon-10.8.png Toshihiko Makita, 2022-07-13 08:51
saxon-11.3.png (35 KB) saxon-11.3.png Toshihiko Makita, 2022-07-13 08:52
diff-2022-07-13.zip (10.9 KB) diff-2022-07-13.zip Toshihiko Makita, 2022-07-13 08:53

Please register to edit this issue

Also available in: Atom PDF