Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

Re: [jdom-interest] preserving linefeeds and carriage returns in
transform.

Jason Hunter

2003-10-30

Replies:

If you use XMLOutputter in its default configuration it doesn't do any
beautification and it'll output whitespace exactly as held within the
Document.

-jh-

Robert Priest wrote:

> Hello,
>
> I know that the documentation says for XmlOutputter
> (http://www.jdom.org/docs/apidocs/org/jdom/output/XMLOutputter.html)
>
> says:
>
> "In the case where the only content between the start and end tags is
> textual, the start tag, text, and end tag are all printed on the same line.
> "
>
> But is there anyway around this?
> In my stylesheet I have a VBScript function :
> <script language="vbscript">
>        function doSomething(test)
>     if test = 1 Then
>          MsgBox("got 1")
>     Else
>      MsgBox("Got Something Other Than 1")
>     End if
>        end function
>      </script>
>
> but when I transform this with xml I get that all on one line:
> <script language="vbscript">function doSomething(test) if test = 1 Then
> MsgBox("got 1") Else MsgBox("Got Something Other Than 1") End if end
> function</script>
>
> I would like that on separate lines. I know msxml2 does it. It should look
> like:
>
> <script language="vbscript">
>         function doSomething(test)
>          if test = 1 Then
>              MsgBox("got 1")
>          Else
>              MsgBox("Got Somethin
>         End if
>         end function
>   </script>
>
> Does anyone have any insight as to how that can be achieved using JDOM?
>
> Thanks in advance.
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)
>

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.