<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR>
<STYLE>@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; COLOR: black; FONT-FAMILY: Arial
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; COLOR: black; FONT-FAMILY: Arial
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; COLOR: black; FONT-FAMILY: Arial
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        FONT-WEIGHT: normal; COLOR: windowtext; FONT-STYLE: normal; FONT-FAMILY: Arial; TEXT-DECORATION: none; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=276431719-21032006><FONT face=Arial
color=#0000ff size=2>No XML serializers that I know of give you this much
control over the output. The Saxon serializer (which you could invoke to
serialize the JDOM) will put long attributes on separate lines, but using its
own algorithm, not yours. If you really want control at this level, you probably
have to write your own serializer.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=276431719-21032006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=276431719-21032006><FONT face=Arial
color=#0000ff size=2>Putting a newline as part of the attribute name is clearly
doomed - you're lucky it got stripped off rather than being rejected as an
invalid name character.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=276431719-21032006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=276431719-21032006><FONT face=Arial
color=#0000ff size=2>Michael Kay</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=276431719-21032006><FONT face=Arial
color=#0000ff size=2><A
href="http://www.saxonica.com/">http://www.saxonica.com/</A></FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> jdom-interest-bounces@jdom.org
[mailto:jdom-interest-bounces@jdom.org] <B>On Behalf Of </B>David
Patterson<BR><B>Sent:</B> 21 March 2006 18:09<BR><B>To:</B>
jdom-interest@jdom.org<BR><B>Subject:</B> [Norton AntiSpam] [jdom-interest]
Newlines between attributes<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: windowtext">I’m using JDOM and like it very
much for its ease of use.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: windowtext"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: windowtext">I’m now using JDOM to create a
series of XML files where the attribute values are long strings. As a
result, after 2-3 of them, the element definition is very long. I know how to
insert text objects between objects to force line breaks, but what I have been
so far unable to do is to specify line breaks at known places between
attributes in an element.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: windowtext"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: windowtext">Is there a way to do this? Does it
have to be done in a post-processing task? <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: windowtext"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: windowtext">I tried
doing:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: windowtext">
dmodule.setAttribute( "\nnoNamespaceSchemaLocation",
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: windowtext">
"procedSchema.xsd", ns );<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: windowtext"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: windowtext"> ...but JDOM removed the
leading NL character from the attribute name.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: windowtext"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt">Dave Patterson</SPAN></FONT><o:p></o:p></P>
<P class=MsoNormal><EM><I><FONT face=Arial color=black size=2><SPAN
style="FONT-SIZE: 10pt; FONT-STYLE: normal; FONT-FAMILY: Arial">dpatterson@i-a-i.com</SPAN></FONT></I></EM><o:p></o:p></P></DIV>
<P class=MsoNormal><FONT face=Arial color=black size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></DIV></BLOCKQUOTE></BODY></HTML>