speedata / publisher

speedata Publisher - a professional database Publishing system
https://www.speedata.de/
GNU Affero General Public License v3.0
300 stars 36 forks source link

Paragraph Output #186

Closed ViWaldi closed 6 years ago

ViWaldi commented 6 years ago

What am I doing wrong? Why is there so many spaces between paragraphs? Why does the Fontface-Tag do not switch the font? Why does speedata process the lists inside a paragraph? And why does speedata process the B-, I- and U-Tags but not the Color-Tag? Or may I not mix data and layout?

Data is:

<data>
    <Pos>
        <Nr>0815</Nr>
        <Beschreibung>
            <Paragraph>
                <Fontface fontfamily="head1">
                    <B>
                        <Value>Überschrift 1</Value>
                    </B>
                </Fontface>
            </Paragraph>
            <Paragraph>
                <Fontface fontfamily="head2">
                    <B>
                        <Value>Überschrift 2</Value>
                    </B>
                </Fontface>
            </Paragraph>
            <Paragraph>
                <Value>Hallo </Value>
                <B>
                    <Value>Welt</Value>
                </B>
                <Value>!</Value>
            </Paragraph>
            <Paragraph>
            <UL>
                <LI><Value>a</Value></LI>
                <LI><Value>b</Value></LI>
                <LI><Value>c</Value></LI>
            </UL>
            </Paragraph>
            <Paragraph>
                <Value>hier noch etwas </Value>
                <I>
                    <Value>kursives</Value>
                </I>
            </Paragraph>
            <Paragraph>
                <Value>und noch was </Value>
                <Color name="marked">
                    <Value>markiertes</Value>
                </Color>
            </Paragraph>
            <Paragraph>
                <Value>und was </Value>
                <U>
                    <Value>unterstrichenes</Value>
                </U>
            </Paragraph>
            <Paragraph>
                <Value>mal sehen ob es klappt</Value>
            </Paragraph>
        </Beschreibung>
    </Pos>
</data>

Layout file is:

<?xml version="1.0" encoding="UTF-8"?>

<Layout xmlns="urn:speedata.de:2009/publisher/en" xmlns:sd="urn:speedata:2009/publisher/functions/en">

    <Options mainlanguage="German" />

    <Trace grid="no"/>

    <SetGrid nx="30" height="12pt"/>
    <DefineColor name="weiß" value="#fff"/>
    <DefineColor name="grau" value="#eee"/>
    <DefineColor name="marked" model="rgb" r="100" g="0" b="0"/>
    <DefineFontfamily name="head1" fontsize="14" leading="18">
        <Regular fontface="TeXGyreHeros-Regular" />
        <Bold fontface="TeXGyreHeros-Bold"/>
        <Italic fontface="TeXGyreHeros-Italic"/>
    </DefineFontfamily>
    <DefineFontfamily name="head2" fontsize="12" leading="16">
        <Regular fontface="TeXGyreHeros-Regular" />
        <Bold fontface="TeXGyreHeros-Bold"/>
        <Italic fontface="TeXGyreHeros-Italic"/>
    </DefineFontfamily>
    <DefineFontfamily name="klein" fontsize="8" leading="10">
        <Regular fontface="TeXGyreHeros-Regular" />
        <Bold fontface="TeXGyreHeros-Bold"/>
        <Italic fontface="TeXGyreHeros-Italic"/>
    </DefineFontfamily>

    <Pagetype name="page" test="true()">
        <Margin left="10mm" right="5mm" top="10mm" bottom="10mm"/>
        <PositioningArea name="Pos">
            <PositioningFrame width="30" height="64" row="1" column="1"/>
        </PositioningArea>
    </Pagetype>

    <Record element="data">
        <PlaceObject area="Pos">
            <Table stretch="max" padding="4pt" border-collapse="collapse">
                <Columns>
                    <Column width="5"/>
                    <Column width="25"/>
                </Columns>
                <ForAll select="Pos">
                    <Tr valign="top" >
                        <Td align="left" border-top="0.45pt" border-right="0.45pt" border-left="0.45pt" >
                            <Paragraph>
                                <B>
                                    <Value>Data</Value>
                                </B>
                            </Paragraph>
                        </Td>
                        <Td border-left="0.45pt" border-right="0.45pt" border-bottom="0.45pt" border-top="0.45pt">
                            <Paragraph fontface="klein">
                                <Value select="Beschreibung"/>
                            </Paragraph>
                        </Td>
                    </Tr>
                    <ForAll select="Beschreibung/Paragraph" >
                        <Tr>
                            <Td border-left="0.45pt" border-right="0.45pt" />
                            <Td border-left="0.45pt" border-right="0.45pt">
                                <Paragraph fontface="klein">
                                    <Value select="."/>
                                </Paragraph>
                            </Td>
                        </Tr>
                    </ForAll>
                    <Tr valign="top" >
                        <Td align="left" border-top="0.45pt" border-right="0.45pt" border-left="0.45pt" border-bottom="0.45pt" >
                            <Paragraph>
                                <B>
                                    <Value>Layout</Value>
                                </B>
                            </Paragraph>
                        </Td>
                        <Td border-left="0.45pt" border-right="0.45pt" border-bottom="0.45pt" border-top="0.45pt">
                            <Paragraph>
                                <Fontface fontfamily="head1">
                                    <B>
                                        <Value>Überschrift 1</Value>                        
                                    </B>
                                </Fontface>
                            </Paragraph>
                            <Paragraph>
                                <Fontface fontfamily="head2">
                                    <B>
                                        <Value>Überschrift 2</Value>
                                    </B>
                                </Fontface>
                            </Paragraph>
                            <Paragraph>
                                <Value>Hallo </Value>
                                <B>
                                    <Value>Welt</Value>
                                </B>
                                <Value>!</Value>
                            </Paragraph>
                            <Paragraph>
                                <Value>hier noch etwas </Value>
                                <I>
                                    <Value>kursives</Value>
                                </I>
                            </Paragraph>
                            <Paragraph>
                                <Value>und noch was </Value>
                                <Color name="marked">
                                    <Value>markiertes</Value>
                                </Color>
                            </Paragraph>
                            <Paragraph>
                                <Value>und was </Value>
                                <U>
                                    <Value>unterstrichenes</Value>
                                </U>
                            </Paragraph>
                            <Paragraph>
                                <Value>mal sehen ob es klappt</Value>
                            </Paragraph>
                        </Td>
                    </Tr>
                </ForAll>
            </Table>
        </PlaceObject>
    </Record>
</Layout>
pgundlach commented 6 years ago

Only a few HTML tags are taken into account. Fontface and color are not among these. The things like <Value> and ` and such belong into the layout file. Ask back again beginning of August, I am currently on vacataion.

pgundlach commented 6 years ago

I'll close this issue. There are a few HTML tags supported, but this is just a basic collection. If you need more support for HTML, please open a new ticket.

You should not mix layout inside the data file. I suggest to wrap the headings in a h1, h2, ... tag and style them in the layout file.

ViWaldi commented 6 years ago

You're right. One should not mix the data and layout, but it seemed like the easy way to put the layout into the data. Because the user put the layout in the data (text field).

For examle: The user mark or underline date of invoice or make some words bold or makes enumeration of properties for the product.

In addition, it works already with bold and italics, why not with other tags in Paragraph-tag (Color,U,Fontface, etc.)

pgundlach commented 6 years ago

I could/will support more HTML tags in the data (which is what most online editors output) if time permits.