Connecting Tech Pros Worldwide Help | Site Map

how can I add next line?

  #1  
Old November 10th, 2008, 05:35 PM
qwerty007
Guest
 
Posts: n/a
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.

  #2  
Old November 10th, 2008, 05:55 PM
Martin Honnen
Guest
 
Posts: n/a

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/
  #3  
Old November 10th, 2008, 07:45 PM
qwerty007
Guest
 
Posts: n/a

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.
  #4  
Old November 10th, 2008, 07:55 PM
qwerty007
Guest
 
Posts: n/a

re: how can I add next line?


I should say, "how should I line break within the quotation mark?"
  #5  
Old November 11th, 2008, 12:05 PM
Martin Honnen
Guest
 
Posts: n/a

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/
  #6  
Old November 11th, 2008, 04:15 PM
qwerty007
Guest
 
Posts: n/a

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.
  #7  
Old November 11th, 2008, 04:35 PM
qwerty007
Guest
 
Posts: n/a

re: how can I add next line?


Sorry. Not XTL above, but XSL.
  #8  
Old November 11th, 2008, 04:55 PM
Johannes Koch
Guest
 
Posts: n/a

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.)
  #9  
Old November 11th, 2008, 06:35 PM
qwerty007
Guest
 
Posts: n/a

re: how can I add next line?


Here is the link of xsl.

http://www.cdisc.org/models/def/v1.0/define1-0-0.xsl
  #10  
Old November 11th, 2008, 06:35 PM
Martin Honnen
Guest
 
Posts: n/a

re: how can I add next line?


qwerty007 wrote:
Quote:
Here is the link of xsl.
>
http://www.cdisc.org/models/def/v1.0/define1-0-0.xsl
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/
  #11  
Old November 11th, 2008, 07:05 PM
qwerty007
Guest
 
Posts: n/a

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 |
  #12  
Old November 12th, 2008, 09:05 AM
Johannes Koch
Guest
 
Posts: n/a

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.)
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Float Left with auto width, jumps to next line if short dlite922 answers 15 March 6th, 2009 09:44 PM
Enter string to the next line ctrohana answers 1 February 28th, 2007 09:00 AM
Add next line of text in textbox? trint answers 1 November 17th, 2005 12:22 AM
How to write string in a file to the next line marslee@hotmail.com answers 4 July 17th, 2005 01:57 PM