Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Can appendchild add linefeed?

From: "Mike Sharp" <rdcpro@-------.--->
To: NULL
Date: 6/25/2003 1:39:00 PM
Yes, well that's one reason I use XMLSpy   ;^)

Seriously, I understand where you're coming from.  Been working a lot with
SQL XML lately, and I store the updategrams on the filesystem as a sort of
temporary transaction log for testing, along with a number of generated XML
files.  They're all on one line, so I always use XMLSpy">XMLSpy to open them up,
then click the pretty-print button...

It would be nice to add an item to my context menu (similar to the View
Stylesheet patch) so that I could right-click a file, and cause the
prettyprint xsl to transform the XML and dump it into textpad or notepad...

In case you missed my other post, my sample XSL pretty printer is at:
http://rdcpro.com/xmldev/prettyprint


Regards,
Mike Sharp

"Chris Barber" <chris@b...> wrote in message
news:%23EIWoA1ODHA.1720@T......
> I think the one that I've used is a double template XSL (not sure where
I've
> put it now). In terms of working with XML its neither here nor there and
> indeed single line XML docs seem to parse and stream to the browser faster
> anyway but for logging input / output during development (eg. Visual Basic
> debugging) I find it very difficult to see anything unless its pretty
> printed or at least on seperate lines.
> So .. thanks to Mike and Oleg although I'd guess you're getting pretty
bored
> with repeatedly answering this one question over and over again by now (I
> must have seeen it a hundred times in the last few months getting to grips
> with XML / XSL).
>
> Cheers,
>
> Chris.
>
> "Mike Sharp" <rdcpro@h...> wrote in message
> news:bdcopk$rqful$1@I......
> > That's not going to work. (at least it doesn't using MSXML)....The
output
> is
> > still on one line.
> >
> > I have to use the recursive approach to get multi-line output.  But it
> also
> > doesn't truly indent the result, which is what the OP wanted, so you'd
> need
> > the recursive approach anyway in order embed spaces.
> >
> > But I still think it's better to leave the XML as-is, and worry about
> > formatting for presentation only.
> >
> > Regards,
> > Mike Sharp
> >
> > "Oleg Tkachenko" <olegt@m...> wrote in message
> > news:OyJ8iVzODHA.1720@T......
> > > Chris Barber wrote:
> > >
> > > > There is a stylesheet somewhere in the group that you can apply to
the
> > > > output XML to 'format' it to human readable form. A lot of people
> say -
> > > > don't mix readability with validity (actually I made that quote up)
> but
> > they
> > > > obviously haven't ever tried to debug large dynamically generated
XML
> > > > documents (in text logs and the like) before!
> > > >
> > > > Ooh - found it again!
> > > >
> > > > <xsl:stylesheet version="1.0"
> > > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > > > <xsl:output method='xml' indent='yes' omit-xml-declaration='yes'/>
> > > > <xsl:template match="node() | @*">
> > > > <xsl:copy>
> > > > <xsl:apply-templates select="node() | @*"/>
> > > > </xsl:copy>
> > > > </xsl:template>
> > > > </xsl:stylesheet>
> > >
> > > btw, it can be done just by deep copy of root node, there is no need
to
> > copy
> > > each node recursively.
> > >
> > > <xsl:stylesheet version="1.0"
> > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > > <xsl:output method='xml' indent='yes' omit-xml-declaration='yes'/>
> > > <xsl:template match="/">
> > > <xsl:copy-of select=".">
> > > </xsl:template>
> > > </xsl:stylesheet>
> > >
> > > -- 
> > > Oleg Tkachenko
> > > http://www.tkachenko.com/blog
> > > Multiconn Technologies, Israel
> > >
> >
> >
>
>




transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent