[
https://issues.apache.org/jira/browse/XALANJ-2388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510497
]
Brian Minchau commented on XALANJ-2388:
---------------------------------------
As I mentioned in xalanj-2387, the lack of a newline right after the XML header
is intentional.
I'll talk to the Xerces folks on the issue of splitting the attribute values
across multiple lines. I hadn't thought of that.
As for setting the default width to some value, that sounds interesting. I
just don't know what to do if an attribute name, or element name is say 200
characters long and the output width is say 50.
On the area of indentation of attributes, which seems to be the only new thing
in this issue other than the newline after the XML header, how sensitive are
you on the order of the attributes? What if this came out (in reverse
alphabetic order)?
<Server
type="checkProtocolVersion"
serialNumber="09665"
result="Failed"
macAddress="00-14-22-38-AA-43"
licenseStatus="0"
ipAddress="10.1.41.70"
friendlyName="CSMP2610"
failureText="Protocol Version not supported"
deviceType="Admin"
cookie="-7dfe3a9b:11377ee20de:-7fdd" >
You shouldn't be sensitive to this either because the order of the attributes
in serialized XML is
implementation dependant, and is an acceptable difference from one processor to
another.
Does your code depend on attribute order?
- Brian Minchau
> Line wrapping and indenting while pretty-printing
> -------------------------------------------------
>
> Key: XALANJ-2388
> URL: https://issues.apache.org/jira/browse/XALANJ-2388
> Project: XalanJ2
> Issue Type: Improvement
> Components: Xalan
> Affects Versions: 2.7
> Environment: Window XP and Apple OS X
> Reporter: Eric Kolotyluk
> Priority: Minor
>
> When using the pretty-printing fearure in LSSeralizer the output looks like
> <?xml version="1.0" encoding="UTF-8"?><Server
> cookie="-7dfe3a9b:11377ee20de:-7fdd" deviceType="Admin" failureText="Protocol
> Version not supported" friendlyName="CSMP2610" ipAddress="10.1.41.70"
> licenseStatus="0" macAddress="00-14-22-38-AA-43" result="Failed"
> serialNumber="09665" type="checkProtocolVersion">
> <VersionInfo>
> <AdminServer versionBuild="23" versionMajor="3" versionMinor="1"
> versionOther="5" versionPatch="5"/>
> </VersionInfo>
> <Event eid="85008" hr="0" timeStamp="1183127997"/>
> </Server>
> When using XMLSerializer it looks like
> <?xml version="1.0" encoding="UTF-8"?>
> <Server cookie="-7dfe3a9b:11377ee20de:-7fdd" deviceType="Admin"
> failureText="Protocol Version not supported" friendlyName="CSMP2610"
> ipAddress="10.1.41.70" licenseStatus="0" macAddress="00-14-22-38-AA-43"
> result="Failed" serialNumber="09665" type="checkProtocolVersion">
> <VersionInfo>
> <AdminServer versionBuild="23" versionMajor="3" versionMinor="1"
> versionOther="5" versionPatch="5"/>
> </VersionInfo>
> <Event eid="85008" hr="0" timeStamp="1183127997"/>
> </Server>
> where elements with a long list of attributes are wrapped and indented to
> make the XML more readable. LSSerializer should do the same. It would also be
> nice to specify the maximum line width in the API, otherwise a default of 80
> or 100 characters would be fine (or whatever the default is used in
> XMLSerializer).
> While this problem is trivial, it is blocking me from converting my code from
> using the deprecated XMLSerializer to using the official LSSerializer instead.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]