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

Robert Priest Robert.Priest at bentley.com
Thu Oct 30 14:26:38 PST 2003


Thanks jason!

That worked.

I was originally calling: 
XMLOutputter outp = new XMLOutputter();
outp.setTextNormalize(true);


but I removed the setTextNormalize(true) call and it worked.


Thanks for the response.

-----Original Message-----
From: Jason Hunter [mailto:jhunter at servlets.com]
Sent: Thursday, October 30, 2003 5:18 PM
To: Robert Priest
Cc: 'jdom-interest at jdom.org'
Subject: Re: [jdom-interest] preserving linefeeds and carriage returns
in transform.


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@yourhos
t.com
> 



More information about the jdom-interest mailing list