how can I add next line?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • qwerty007

    how can I add next line?

    Hi all,

    I'm creating a table and need to add few lines in a row. But I can not
    find which syntax I have to use.

    For instance, I have this string,

    <ItemDef OID = "Automobile " Name = "Sedan" def:Label = "Car Size"
    DataType = "text" Length = "20" Comment = "Camry Accord Azera
    Maxima">
    </ItemDef>

    and this will output in a table (in a cell) as

    Camry Accord Azera Maxima


    But now I want the comment to output in a cell as

    Carmy
    Accord
    Azera
    Maxima

    Is there any syntax to return the value within a cell or a row?

    Thank you.

  • Martin Honnen

    #2
    Re: how can I add next line?

    qwerty007 wrote:
    Hi all,
    >
    I'm creating a table and need to add few lines in a row. But I can not
    find which syntax I have to use.
    >
    For instance, I have this string,
    >
    <ItemDef OID = "Automobile " Name = "Sedan" def:Label = "Car Size"
    DataType = "text" Length = "20" Comment = "Camry Accord Azera
    Maxima">
    </ItemDef>
    >
    and this will output in a table (in a cell) as
    >
    Camry Accord Azera Maxima
    >
    >
    But now I want the comment to output in a cell as
    >
    Carmy
    Accord
    Azera
    Maxima
    >
    Is there any syntax to return the value within a cell or a row?
    What kind of cell is that? A HTML table cell? How do you generate the
    HTML table cell, with XSLT? Is that XSLT 1.0 or 2.0? With 2.0 you can
    easily do e.g.
    <td>
    <xsl:for-each select="tokeniz e(@Comment, '\s+')">
    <xsl:value-of select="."/>
    <xsl:if test="position( ) != last()">
    <br/>
    </xsl:if>
    </xsl:for-each>
    </td>


    --

    Martin Honnen

    Comment

    • qwerty007

      #3
      Re: how can I add next line?

      Thank you for your fast reply.

      To answer your question, I'm using XSLT 1.0. What I use if pure XML
      code with .css and .xsl. I don't use HTML at all. My purpose is to
      report data from Excel files. But when I import data from Excel, and
      put them into a table defined in .xsl from CDISC (http://cdisc.org/
      standards/index.html)

      In my excel file, I have a COMMENT column for the data. At the comment
      cell for each date, I put a sentence or lines of data. I think there
      may be a syntax to line break so that list of data comes out like

      Carmy
      Accord
      Azera
      Maxima

      instead of

      Camry Accord Azera Maxima

      Thank you.

      Comment

      • qwerty007

        #4
        Re: how can I add next line?

        I should say, "how should I line break within the quotation mark?"

        Comment

        • Martin Honnen

          #5
          Re: how can I add next line?

          qwerty007 wrote:
          To answer your question, I'm using XSLT 1.0. What I use if pure XML
          code with .css and .xsl. I don't use HTML at all.

          Well if you use XSLT to transform XML to HTML then you do use HTML. Or
          do you use XSLT to transform XML to XML? What is the target XML format?
          To suggest how to introduce line breaks we need to know.



          --

          Martin Honnen

          Comment

          • qwerty007

            #6
            Re: how can I add next line?

            Thanks Martin,

            I'm using XSLT to trasform XML to XML. I have this excel file
            containing specifications of SAS coding. When I submit this to my
            client, I have to submit in .xml so they can read it from Internet
            Explorer. But my client want me to follow the styles (.XLT, .CSS) from
            CDISC

            (http://cdisc.org/standards/index.html)

            I'm adding comments how some date variables were derived from date-
            month-year. As a child attribute, I have DADTC as a date variable. If
            I use following code for the table (table is specified by XLT and
            CSS), Comment will be out as ||STDTD STDTM STDMY|| in the column.

            <ItemDef OID = "DADTC" Name = "DADTC" Comment = "STDTD STDTM STDMY"></
            ItemDef>

            But I need to make it as
            |STDTD |
            |STDTM |
            |STDMY |

            in the comment column. So what I assuming is that there might be a
            syntax that I can put within the quotation mark to break lines. That
            was what I was asking. Is it clearer now?

            Thanks in advance.

            Comment

            • qwerty007

              #7
              Re: how can I add next line?

              Sorry. Not XTL above, but XSL.

              Comment

              • Johannes Koch

                #8
                Re: how can I add next line?

                qwerty007 schrieb:
                To answer your question, I'm using XSLT 1.0. What I use if pure XML
                code with .css and .xsl. I don't use HTML at all.
                So what sort of "tables" and "columns" are you talking about?
                My purpose is to
                report data from Excel files. But when I import data from Excel, and
                put them into a table defined in .xsl from CDISC (http://cdisc.org/
                standards/index.html)
                Where exatly on this web site is the .xsl defining the table you're
                talking about? The resources linked from the one you provided the URL
                for seem to be either HTML, PDF or spreadsheet resources, not
                transformation style sheets.

                --
                Johannes Koch
                In te domine speravi; non confundar in aeternum.
                (Te Deum, 4th cent.)

                Comment

                • qwerty007

                  #9
                  Re: how can I add next line?

                  Here is the link of xsl.


                  Comment

                  • Martin Honnen

                    #10
                    Re: how can I add next line?

                    qwerty007 wrote:That stylesheet has
                    <xsl:output method="html" version="4.0" encoding="ISO-8859-1"
                    indent="yes"/>
                    so it transforms XML to HTML 4.

                    --

                    Martin Honnen

                    Comment

                    • qwerty007

                      #11
                      Re: how can I add next line?

                      Oh, Thanks. Since it's my first time making XML upon the client's
                      request, I'm teaching myself for now.

                      Then is there no way to break line within quotation marks?

                      <ItemDef OID = "DADTC" Name = "DADTC" Comment = "STDTD STDTM
                      STDMY"></
                      ItemDef>

                      So output comes out as following instead of output in series within a
                      column(ex. |STDTD STDTM STDMY|)?

                      |STDTD |
                      |STDTM |
                      |STDMY |

                      Comment

                      • Johannes Koch

                        #12
                        Re: how can I add next line?

                        qwerty007 schrieb:
                        Oh, Thanks. Since it's my first time making XML upon the client's
                        request, I'm teaching myself for now.
                        >
                        Then is there no way to break line within quotation marks?
                        >
                        <ItemDef OID = "DADTC" Name = "DADTC" Comment = "STDTD STDTM
                        STDMY"></
                        ItemDef>
                        >
                        So output comes out as following instead of output in series within a
                        column(ex. |STDTD STDTM STDMY|)?
                        >
                        |STDTD |
                        |STDTM |
                        |STDMY |
                        If you use <http://www.cdisc.org/models/def/v1.0/define1-0-0.xsl>, the
                        result will be something like

                        <td>STDTD STDTM STDMY</td>

                        Browsers will apply normal line-wrapping behaviour. So this will
                        probably rendered

                        |STDTD STDTM STDMY|

                        or

                        |STDTD |
                        |STDTM |
                        |STDMY |

                        depending on the width of the table cell.

                        --
                        Johannes Koch
                        In te domine speravi; non confundar in aeternum.
                        (Te Deum, 4th cent.)

                        Comment

                        Working...