format adding whitespace
Posted: Thu Jul 07, 2005 3:50 am
Hello,
I'm sorting through the various methods for dealing with the addition and deletion of whitespace by the oXygen format feature. I've implemented the xml:space attribute in my DTD, but one instance of this problem seems to escape such systematic treatment.
In my original TEI document, I have the following encoding:
If I format the document instance, I get the following:
Thus, the format function effectively adds whitespace between the d and the w and between the w and the a.
What I don't understand is why "<add>d</add>" doesn't get a newline but "<del>w</del>" does. In other words, why doesn't the result of format look like this:
I realize that either result still adds text-only nodes to my document. So, I guess I really have two questions:
1. Why the formatting described above?
2. We can't specify that all whitespace-only nodes in <p> can be removed as there are instances when we intend there to be whitespace; however, we can't preserve these introduced whitespace-only nodes either. Any advice on how we can accomplish one without the other?
Thanks,
Andrea
I'm sorting through the various methods for dealing with the addition and deletion of whitespace by the oXygen format feature. I've implemented the xml:space attribute in my DTD, but one instance of this problem seems to escape such systematic treatment.
In my original TEI document, I have the following encoding:
Code: Select all
<p>pcdata content <del><del>alo<add>d</add><del>w</del></del> a</del> pcdata content</p>
Code: Select all
<p>pcdata content <del>
<del>alo<add>d</add>
<del>w</del>
</del> a</del> pcdata content</p>
What I don't understand is why "<add>d</add>" doesn't get a newline but "<del>w</del>" does. In other words, why doesn't the result of format look like this:
Code: Select all
<p>pcdata content <del>
<del>alo
<add>d</add>
<del>w</del>
</del>
a</del> pcdata content</p>
1. Why the formatting described above?
2. We can't specify that all whitespace-only nodes in <p> can be removed as there are instances when we intend there to be whitespace; however, we can't preserve these introduced whitespace-only nodes either. Any advice on how we can accomplish one without the other?
Thanks,
Andrea