0

I am working with the Firefox localstore.rdf file. Although it is an RDF file the syntax is essentially XML. I am dealing with long lines.

<NC:persist RDF:resource="#nav-bar"
  currentset="unified-back-forward-button,history-button,feed-button,abp-toolbarbutton,widget:jid0-HFFmJoceGjTSKDBEWPpzfX9By7I@jetpack-hds-link-detector,firebug-button,personal-bookmarks"/>

I would like to break these lines to fit 80 character if possible.

Zombo
  • 1
  • 62
  • 391
  • 407

2 Answers2

1

XML doesn't care about whitespace between elements, or between attributes within an element. Break it wherever that works.


One thing that will not work is to break the line in the middle of an attribute value. There is no way to do that.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
1

You can try if Firefox trims whitespace per each element in the currentset:

<NC:persist RDF:resource="chrome://browser/content/browser.xul#nav-bar"
    currentset="unified-back-forward-button,history-button,feed-button,
        abp-toolbarbutton,
        widget:jid0-HFFmJoceGjTSKDBEWPpzfX9By7I@jetpack-hds-link-detector,
        firebug-button,personal-bookmarks"/>

You would need to test if that works. According to Firefox sources, they keep the currentset attribute on a single line, always.

From what I know, even technically possible with XML (see Are line breaks in XML attribute values valid?), the pretty-printers I know do not distribute an attribute value across multiple lines (please see Attribute-Value Normalization), so I would run some tests if you really need that as this depends on which value the application expects.

Community
  • 1
  • 1
hakre
  • 193,403
  • 52
  • 435
  • 836