I have XML files that use embedded entity declarations. In the result file I need to replace the entity names with the actual file they are pointing to. But AFAIK entities cannot be pointed to in an XSLT stylesheet, as they are supposed to be handled by the XML parser.
Sample source file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic SYSTEM "../../../App/Converted-DTD.dtd" [
<!-- Begin Document Specific Declarations -->
<!NOTATION pdf SYSTEM "">
<!ENTITY image1 SYSTEM "graphics/img-1.svg" NDATA pdf>
<!ENTITY image2 SYSTEM "graphics/img-2.svg" NDATA pdf>
<!-- End Document Specific Declarations -->
]>
<topic>
<title>My test topic</title>
<body>
<p>This is an image:
<image entity="image1"/></p>
<p>This is another image
<image entity="image2"/></p>
</body>
</topic>
What I need is a file that changes the entity reference to an actual href:
<topic>
<title>My test topic</title>
<body>
<p>This is an image:
<image href="graphics/img-1.svg"/></p>
<p>This is another image
<image href="graphics/img-2.svg"/></p>
</body>
</topic>
I cannot rely on the entities being declared in a DTD as every file has different entities pointing to different files.
Maybe it is trivial but I could not find a way to get to the embedded document specific declarations.