Re: How to check links in compound documents?

Hussein Shafie <[email protected]> Sun, 18 Feb 2024 11:15:50 +0100
Newsgroups gmane.editors.xxe.general
Message-ID <[email protected]>
Sorry but I'm not 100% sure to understand your use case. However, may be 
you could try this:

1) Create an Ebook 
(http://www.xmlmind.com/ebookc/_distrib/doc/manual/webhelp3/primer.html) 
just for the purpose of checking links between your "large compound 
XHTML documents".

Such Ebook can be created automatically using a very simple script 
because it mainly consists of a list of <chapter>s. For example:

---
<book xmlns="http://www.xmlmind.com/schema/ebook"
       xmlns:ebk="http://www.xmlmind.com/schema/ebook">

   <head>
     <title>Whatever</title>
   </head>

   <chapter href="subdoc1.xhtml"/>
   <chapter href="subdoc2.xhtml"/>
   <chapter href="subdoc3.xhtml"/>
   ...
   <chapter href="subdocN.xhtml"/>

</book>
---

2) Once this is done, open this Ebook in XXE.

a) Use "Ebook|Check Ebook" to check the links in your "large compound 
XHTML documents".

b) Optionally, use "Ebook|Convert Document|Convert to Single HTML Page". 
This may be useful if you want to run a third-party link checker on the 
generated HTML page.

References:

- "XMLmind Ebook Compiler Manual", 
http://www.xmlmind.com/ebookc/_distrib/doc/manual/webhelp3/index.html

- "XMLmind XML Editor - Creating an Ebook out of a Set of HTML Pages", 
https://www.xmlmind.com/xmleditor/_distrib/doc/ebook/index.html


On 1/24/24 22:34, Leif Halvard Silli wrote:
> 
>       My use case:
> 
> We have some large compound XHTML documents - a main document with lots 
> of subsections embedded via Xinclude.
> 
> The documens ave cross reference links. And there always seems to be 
> some links that are - or become - broken.
> 
> And so I would liked to have a link checker to check for broken links.
> 
> (We use Prince XML to generate our PDFs, and I can say that (with the 
> exception of the dead/broken links), links works the same inside the XXE 
> editor as in the Prince XML generated PDFs. Whereas if I try to use FOP 
> to create the PDFs, then most of the links will not work.)
> 
> 
>       What I tried:
> 
> (1) The XHTML preview option plus an external link checker.
> 
> The XHTML menu have a Preview item which I hoped would create one, big, 
> «flattened» document, which I could then run some link checker on.
> 
> The problem: The resulting document doesn't actually get (completely) 
> «flattened» - at least not when it comes to links. And so the majority 
> of links, stops working in this «flattened» variant of the documents.
> 
> (Still this might be my safest bet - if only I remove "subdoc.xhtml" 
> from href="subdoc.xhtml#fragment", then I will end up with a link - 
> href="#fragment", that should work. But this is a rather cumbersome 
> "method".)
> 
> (2) XXE’s built in link validation
> 
> XXE has a link validation tool - AKA a link checker. But in our compound 
> XHTML documents, the link validation tool does not work - at least it 
> does not work in a useful way. Becuase, the links that I need to check, 
> are found in subdocuments. But at least by default, the link validator 
> only reports broken links if link (aka the <a href> elemen) is found 
> directly in the main document itself. And, in addition, it seems like 
> the link validation does not check links that leads to other files. 
> Also, the link validation does not check the links that occur in 
> subdocuments. Thus, I have not found a way to make use of the built in 
> link validation.
> 
> 
>       What I ask:
> 
> Is there more to the link validation tool? Is it possible for me to 
> configure it differently? If not, could it be updated to validate links 
> in compound documents?
> 
> Alternatively/Additionally, is it also possible to wish that XHTML 
> Preview could produce _really_ flattened Xinclude documents?
> 


--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support