XSLT xml to xml simple question about formatting

K

kbozek

I have an XSLT transform that will create an XML to XML transformation
in the parent child format.

I really want to output the elements and attributes on a single line
such as:

<image name="car.jpg" size="5000" /><image type = "jpg" compression =
"20" />
....
....
<image name="talk.jpg" size="15000" /><image type = "jpg" compression
= "11" />
....
....

Yet, fooling around with the xsl:elements and xsl:attribute does not
quite get me there. Perhaps I am misunderstanding something in the
descriptions of elements and attributes. I've tried searching for the
answer but have come up blank so far.

Thanks.
Keith
 
J

Joseph Kesselman

I really want to output the elements and attributes on a single line

Should be simple: Make sure you don't output any text nodes, and don't
turn on indendataion.

I'd bet you're inadvertantly copying whitespace from the source
document. But since you didn't show us an example that demonstrates the
problem, I can't tell you how to fix it.

Note that you shouldn't have to use xsl:element and xsl:attribute in
most cases...
 

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

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,831
Latest member
HealthSmartketoReviews

Latest Threads

Top