On 2/25/24 23:49, Leif Halvard Silli wrote:
First  I am thankful for the direction about how to possibly use the Ebook format as a workaround!

Still, some questions:

1) Does Ebook support Xinclude?

Yes.




I ask because, those chapter files also contain sub and sub sub chapters.

And it would be quite much work if I would have to recreate the entire file structure of the project. Much simpler if Ebook accepts that each chapter file contains Xinclude included file.

If what I've suggested involves any work beside automatically generating the .ebook file (basically just listing all your XHTML pages) then my suggestion may not be used to solve your "check links in compound documents" problem.



2) As for the last variant, namely to flatten the ebook to a single file: Why can't you instead fix the XHTML preview command?

Because we don't understand what is the problem with the XHTML Preview command.

Here we use the XHTML Preview command all the time and it works great for us. Not to check links but to see how the page would look in the browser with our "corporate" CSS stylesheet. (Hence the name "Preview") See "Preview Settings", https://www.xmlmind.com/xmleditor/_distrib/doc/xhtml/menu.html#previewSettings

Please send us a sample HTML page containing links, xincluding sub-documents and referencing external images and please explain what you expect the XHTML Preview command to do.

We have nothing against improving the XHTML Preview command but if you use case is too specific or if your RFE is best implemented using other means (e.g. implement an actual link checker orthogonal to the XHTML Preview command), we will not implement your RFE.




As I described initially, in our case XHTML preview fails to create a working single document, the problem being that many URLs fails to be converted to URLs that function in the flattened document. This goes for links at least (but right now aI forgot if it also goes for image URLs).

Sorry but we don't understand this.




Do you need more documentation of XHTML Previev's problem with URLs?

Yes.






Leif Halvard Silli


Den 18. februar 2024 11:15:50 CET, skrev Hussein Shafie <huss...@xmlmind.com>:

    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 
<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 
<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
    <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?


--
Hussein SHAFIE, Product Manager, huss...@xmlmind.com
XMLmind Software, 35 rue Louis Leblanc, 78120 Rambouillet, France
Phone: +33 (0)9 52 80 80 37, Fax: +33 (0)9 57 80 80 37, www.xmlmind.com


--
XMLmind XML Editor Support List
xmleditor-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to