[Norton AntiSpam] [jdom-interest] Newlines between attributes

Klotz, Leigh Leigh.Klotz at xerox.com
Tue Mar 21 16:40:32 PST 2006


Dave,
TagSoup has a small SAX serializer you could start from if you need
example code for writing your own.
Leigh.

________________________________

From: jdom-interest-bounces at jdom.org
[mailto:jdom-interest-bounces at jdom.org] On Behalf Of Michael Kay
Sent: Tuesday, March 21, 2006 11:21 AM
To: 'David Patterson'; jdom-interest at jdom.org
Subject: RE: [Norton AntiSpam] [jdom-interest] Newlines between
attributes


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.
 
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.
 
Michael Kay
http://www.saxonica.com/


________________________________

	From: jdom-interest-bounces at jdom.org
[mailto:jdom-interest-bounces at jdom.org] On Behalf Of David Patterson
	Sent: 21 March 2006 18:09
	To: jdom-interest at jdom.org
	Subject: [Norton AntiSpam] [jdom-interest] Newlines between
attributes
	
	

	I'm using JDOM and like it very much for its ease of use.

	 

	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.

	 

	Is there a way to do this? Does it have to be done in a
post-processing task? 

	 

	I tried doing:

	        dmodule.setAttribute( "\nnoNamespaceSchemaLocation", 

	                "procedSchema.xsd", ns );

	 

	 ...but JDOM removed the leading NL character from the attribute
name.

	 

	Dave Patterson

	dpatterson at i-a-i.com

	 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20060321/9ff99473/attachment.htm


More information about the jdom-interest mailing list