how can I add next line?

Q

qwerty007

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.
 
M

Martin Honnen

qwerty007 said:
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="tokenize(@Comment, '\s+')">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<br/>
</xsl:if>
</xsl:for-each>
</td>
 
Q

qwerty007

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.
 
M

Martin Honnen

qwerty007 said:
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.
 
Q

qwerty007

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.
 
J

Johannes Koch

qwerty007 said:
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.
 
Q

qwerty007

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

Johannes Koch

qwerty007 said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top