how can I add next line? 
November 10th, 2008, 05:35 PM
| | | |
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. | 
November 10th, 2008, 05:55 PM
| | | | re: how can I add next line?
qwerty007 wrote: Quote:
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>
--
Martin Honnen http://JavaScript.FAQTs.com/ | 
November 10th, 2008, 07:45 PM
| | | | 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. | 
November 10th, 2008, 07:55 PM
| | | | re: how can I add next line?
I should say, "how should I line break within the quotation mark?" | 
November 11th, 2008, 12:05 PM
| | | | re: how can I add next line?
qwerty007 wrote: Quote:
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 http://JavaScript.FAQTs.com/ | 
November 11th, 2008, 04:15 PM
| | | | 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. | 
November 11th, 2008, 04:35 PM
| | | | re: how can I add next line?
Sorry. Not XTL above, but XSL. | 
November 11th, 2008, 04:55 PM
| | | | re: how can I add next line?
qwerty007 schrieb: Quote:
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? Quote:
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.) | 
November 11th, 2008, 06:35 PM
| | | | re: how can I add next line? | 
November 11th, 2008, 06:35 PM
| | | | 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 http://JavaScript.FAQTs.com/ | 
November 11th, 2008, 07:05 PM
| | | | 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 | | 
November 12th, 2008, 09:05 AM
| | | | re: how can I add next line?
qwerty007 schrieb: Quote:
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.) |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,662 network members.
|