BurnzZ / xml-aligner

Generic Aligner/Prettifier for XML documents
0 stars 0 forks source link

Additional issues regarding alignment and closing brackets #5

Open perky8888 opened 8 years ago

perky8888 commented 8 years ago

5. If parent and child is aligned, they are both considered as children of some less indented children or parent tag.

Example: Given

<bookstore>
  <book>
  <title value = "XML 101" />
    <author name = "Burnzzz" />
  </book>

it returns

<bookstore>
  <book>
  <title  value = "XML 101" />
  <author name = "Burnzzz"  />
  </book>

instead of

<bookstore>
  <book>
    <title  value = "XML 101" />
    <author name = "Burnzzz"  />
  </book>

6. Spacing is inconsistent

Given

..<bookstore>
  ...<book>
     ..<title value = "XML 101" />

it returns

..<bookstore>
  ...<book>
     ..<title value = "XML 101" />

instead of

..<bookstore>
  ..<book>
    ..<title value = "XML 101" />

7. Initial closing brackets are used instead of last

Given

<bookstore>
  <book>
    <title value = "How to use closing bracket /> in XML" />
    <author name = "Burnzzz" birthdate = "Nov 31, 1994" color = "beige" />

it returns

<bookstore>
  <book>
    <title  value = "How to use closing bracket                          /> in XML" />
    <author name = "Burnzzz" birthdate = "Nov 31, 1994" color = "beige"  />

instead of

<bookstore>
  <book>
    <title  value = "How to use closing bracket /> in XML"               />
    <author name = "Burnzzz" birthdate = "Nov 31, 1994" color = "beige"  />
BurnzZ commented 8 years ago

Item 5 and 6 - the actual basis for correct group blocking would be the opening of a self-closing tag, xmllint can actually help with this by cleaning up the xml contents before the actual xml-aligner.py runs.

Item 7 - a bit of an edge case.. will look into implementing this.