How to add br within xml data??
Hi!
I am new to XML.
I want to use xml data and transform it to html using xslt.
The data is somewhat like -
<A>
1. adfsdfsdfs
2. cdcvdvsd
3. dcdsvdsv
</A>
but in html file it displays it like -
1. adfsdfsdfs2. cdcvdvsd3. dcdsvdsv
i.e., the comlplete text in form of one paragraph.
I want it in the indexed text as it is.
I tried with CDATA but it did no miracle. I even tried following:
<A><html>
<br>1.adfsdfsdfs</br>
<br>2.cdcvdvsd</br>
<br>3.dcdsvdsv</br>
</html>
</A>
Please help me.
Thanks,
Priyanka
# 1 Re: How to add br within xml data??
You haven't posted your XSL sheet which makes the following comments somewhat speculative on my part.
Hi!
<A><html>
<br>1.adfsdfsdfs</br>
<br>2.cdcvdvsd</br>
<br>3.dcdsvdsv</br>
</html>
</A>
This does not work because the XSL processor sees the br and html elements as perfectly ordinary XML elements and transforms them using the default template, which just prints all text. To make it work properly your XSL sheet has to generate the html code needed to format the page.
Of course the problem might also be that you are not setting the output method correctly in your XSL stylesheet.
khp at 2007-11-10 3:27:39 >

# 2 Re: How to add br within xml data??
<br>1.adfsdfsdfs</br>
:confused: What's in **** is that?
if U want to HTML to be XML parsable U should do that way:
<html>
<head>
...
</head>
<body>
1.adfsdfsdfs<br/>
2.cdcvdvsd<br/>
3.dcdsvdsv<br/>
</body>
</html>
Best regards,
Krzemo.
Krzemo at 2007-11-10 3:28:39 >
