Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XSLT xml to xml simple question about formatting

Thread Tools

XSLT xml to xml simple question about formatting
Posts: n/a
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.


Reply With Quote
Joseph Kesselman
Posts: n/a
      06-07-2007 Removed) wrote:
> 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...

Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting XML with an XSLT without access to the XML cp XML 2 08-20-2007 06:50 PM
XSLT question: How to lookup another tag's children in XSLT XML 18 10-03-2006 11:22 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Including XSLT/XML document within a XSLT document XML 4 12-13-2005 02:26 AM
ANN: New low-cost XML Editor, XSLT Editor, XSLT Debugger, DTD/Schema Editor Stylus Studio Java 0 08-03-2004 03:53 PM