-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDF: "NOTE" and "NOTE X" labels runs into content #522
Comments
I've found the reason of this issue. <xsl:if test="$namespace = 'ogc'">
<xsl:attribute name="font-weight">bold</xsl:attribute>
<!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
</xsl:if> for the added feature I've tried to add manually this fragment into the presentation xml: <render>
<preprocess-xslt>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:strip-space elements="*"/>
<!-- note/name -->
<xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<xsl:if test="normalize-space() != ''">:<tab/>
</xsl:if>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
</preprocess-xslt>
</render> and after that PDF looks correct: @opoudjis could you check why |
@Intelligent2013 All extensions in Metanorma XML are now supposed to go under
|
@opoudjis could you point me to the generated presentation XML with the |
I'm not finding either preprocess-xslt or render in my code. Going back to the original issue, #472, I see I was going to add a Because I'm completely confused as to the chain of events: @Intelligent2013 you assumed I was already going to insert that test Stylesheet into production code, and I assumed you were going to wait for us to coordinate a production cycle to do so. Right? If so, I will now have to scramble to put this into production, for OGC only. As I said very very clearly in #473, I DO NOT HAVE THE TIME to roll this out for all flavours, and I do not anticipate ever getting the time to unless this is expressly prioritised. |
I'm going to put this in //metanorma-extension/render/preprocess-xslt : I don't want random bits of extension code scattered throughout the XML, I want them all in one place. As you can see clearly from metanorma/isodoc#473, this is a huge task, and I am doing the bare minimum to get this one stylesheet fragment working. If you want me working on the full ticket, don't give me 15 urgent tickets and two new flavours to implement. These tasks are prioritised according to available resourcing. |
Implemented generic loader and processor of preprocess-xslt, now to instantiate for OGC... |
Sent sample to @Intelligent2013 to confirm this now works for him. @Intelligent2013 One concern I do have: for HTML/DOC, the Presentation XML remains distinct from the HTML, and therefore the transform needs to preserve all nodes it does not have a rule for:
Because you're integrating this into your single pass of XSLT, I take it that I should suppress those lines for anything you run, right? Meaning
I'm also hoping that my namespacing in the XSLT means you don't need to manipulate it further. |
A further complication, although this I think means life is easier for you. The way I've set up the code, all processing of Presentation XML is run through my XSLT pre-processing, before I pass it on to format-specific processing. That means that you don't need to run the preprocess-xslt, because I already do. (I hadn't already realised it, but the XSL:FO parser shares a preprocessor with the HTML and DOC, and that is the preprocessor I have updated.) This means that you can ignore the preprocess-xslt, because what you are passed from Metanorma has already run it. OTOH, it means that if I pass you the output Presentation XML file, you do have to run it to get the same results. |
Yes, I've thought clearly that the XSLT integrated into XML in the production mode, not just proof-of-concept.
Yes, right. I don't need the identical transformation template (
<preprocess-xslt format="pdf">
<xsl:stylesheet ... xmlns:mn="http://riboseinc.com/isoxml"...>
...
<xsl:template match="mn:note/mn:name">
<xsl:copy><xsl:apply-templates select="@*|node()"/><xsl:if test="normalize-space() != ''">:<mn:tab/></xsl:if></xsl:copy>
</xsl:template>
</xsl:stylesheet>
</preprocess-xslt> It means, that I have to replace
Ok, then I'll close metanorma/mn2pdf#190 and stop working on preprocess issue. |
Except! You generate the PDF from files written to disk.
This means that I have to write out the Presentation XML file specific to PDF that I generate to disk, and have you process that, as T-SP-Q.708B-2016-E.presentation.pdf.xml, distinct from the original T-SP-Q.708B-2016-E.presentation.xml |
The file you will be parsing in mnconvert will always be written out to /tmp ( |
@opoudjis just for info, mnconvert parses the presentation XML with semantic layer in this order:
|
@opoudjis I've generated presentation XML and it looks so: <name>NOTE 1</name>
<p id="_">For translation into XML It's ok? Should I add |
|
PDF generates ok now: @opoudjis thank you! |
Thank you @opoudjis @Intelligent2013 ! |
The text was updated successfully, but these errors were encountered: