How to insert a break line in XML

Posted by Yvamsi9 under XML on 4/4/2012 | Points: 10 | Views : 49626 | Status : [Member] | Replies : 16
<?xml version="1.0"?>
<?xml-stylesheet type="text/css"?>
<Data>

<Name> vamsi </Name>
<Id> 452689 </Id>

</Data>


Hi this is my XML file the output is: vamsi 452689

But here i need the output as: vamsi
452689

How to insert a new line character in XML so that i can get the output as im expected.I tried with <br> , <br/> and CDATA also im helpless, can anyone please tell me how to do that ! :)




Responses

Posted by: Sakthi.Singaravel on: 4/4/2012 [Member] Silver | Points: 25

Up
0
Down
Hi vamsi

Plz add display: block; in ur style sheet for each block...


Regards,
Singaravel M

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Yvamsi9 on: 4/4/2012 [Member] Starter | Points: 25

Up
0
Down
Hi sakthi,
I'm writing it in a plain .txt file and saving it as .xml file, So i don't have any style sheet any modifications should be made in this file only. so please tell the code to add in the xml file for inserting a new line . Im new to XML if im wrong please correct me . :)

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/4/2012 [Member] Silver | Points: 25

Up
0
Down
Hi vamsi,

<?xml version="1.0"?>
<?xml-stylesheet type="text/css"?>
<Data>
<Name> vamsi &#xA; </Name>
<Id> 452689 &#xA; </Id>
</Data>

You can directly add xml pre-defined entity &#xA; This is used for new line


Regards,
Singaravel M

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/4/2012 [Member] Silver | Points: 25

Up
0
Down
Hi Vamsi,

r u got answer..?



Regards,
Singaravel M

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Yvamsi9 on: 4/4/2012 [Member] Starter | Points: 25

Up
0
Down
Hi sakthi,
Sorry to say this It's not working here. I'm not getting the new line. Im getting the output as:vamsi 452689 only,
I'm not getting the new line.
Expected Output:vamsi
452689 I want my output to be like this.

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/4/2012 [Member] Silver | Points: 25

Up
0
Down
Hi Vamsi,

See this link..

http://support.bitrock.com/article/how-to-add-a-new-line-in-xml


Regards,
Singaravel M

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Yvamsi9 on: 4/5/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Sakthi,
I had tried that but it's not getting in the new line , that code is not working :(

Thanks,
Vamsi Yadu

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/6/2012 [Member] Silver | Points: 25

Up
0
Down
hi vamsi,

I also tried, but didn't get answer...

r u got it..?

Regards,
Singaravel M

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Yvamsi9 on: 4/6/2012 [Member] Starter | Points: 25

Up
0
Down
No Not yet i didn't get the solution :( :( :(

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 4/6/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

use this

<![CDATA[<br/>]]>



R D Patel

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 4/6/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

More

http://forums.devshed.com/xml-programming-19/inserting-line-breaks-in-xsl-68602.html

R D Patel

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/6/2012 [Member] Silver | Points: 25

Up
0
Down
Hi Patel,

i m also told <![CDATA[<br/>]]> , but it not working..
Vamsi wants not using xsl or any stylesheets..

Regards,
Singaravel M

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hemanthlaxmi on: 4/6/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Please try this
<![CDATA[
Line 1 <br />
Line 2 <br />
Line 3 <br />
]]>

For Break Between the Two Tags.

If this helps you .
Please "Mark as Answer"

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 4/6/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

This also don't workl

R D Patel

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naves8 on: 12/6/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

I am also facing the same issue ( Inserting a New line).
Tried with &#10, &#a. Also i need to auto-fit the height of the row after inserting a new line. When i double click inside a cell and step outside then it auto fits the height.

Anyone please help me in this issue.

Thanks,
Naveen Kumar T S

Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naves8 on: 12/7/2012 [Member] Starter | Points: 25

Up
0
Down
Hi Vamsi,

I think you can try with wraptext="1" in the Alignment tag of style.
It worked for me.

<Styles>
<Style ss:ID="s4">
<Alignment ss:Horizontal="Left" ss:WrapText="1" />
</Style>
</Styles>

Use the style s4, in the place where u want to print the text in next line.
And don't forget to use &#10(&#xA - New line chracter).

Hope it will work for you:)


Yvamsi9, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response