View Single Post
  #21   Report Post  
Posted to uk.d-i-y
John Rumm John Rumm is offline
external usenet poster
 
Posts: 25,191
Default [OT] Wordperfect and other older progs

On 03/05/2016 16:32, Clive George wrote:
On 03/05/2016 16:12, John Rumm wrote:

Its partly down to completely different internal architectures - WP used
embedded controls in much the same way as XML uses tags - notionally
they come in pairs and denote a "block", but you could create them
individually and it could cope with them not being properly nested. Word
on the other hand does not seem to have individual tags as such, but
only attributes that can be applied to a block - so even if you give it
a "reveal codes" type capability, its never going to work in the same
way.


What does it look like in the XML now? (.docx is zipped XML).


Good question - I have not looked... lets see:

Well for a test doc I just created with the content of:

"Test Document *bold* _underline_ normal again"

You get XML with a block created for each section - the "Test Document"
in the first, then a separate "bold" one, then the "underline" and
lastly the "normal again", with appropriate tags specified for the whole
section:

?xml version="1.0" encoding="UTF-8" standalone="yes"?
w:document
xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns="urn:schemas-microsoft-comfficeffice"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"
xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
xmlns:w10="urn:schemas-microsoft-comffice:word"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml"
xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"
xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk"
xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"
mc:Ignorable="w14 wp14"
w:body
w w:rsidR="00342492" w:rsidRDefault="001C4AF8"
w:r
w:t xml:space="preserve"Test Document /w:t
/w:r
w:r w:rsidRPr="001C4AF8"
w:rPr
w:b/
/w:rPr
w:tbold/w:t
/w:r
w:r
w:t xml:space="preserve"
/w:t
/w:r
w:bookmarkStart w:id="0" w:name="_GoBack"/
w:bookmarkEnd w:id="0"/
w:r w:rsidRPr="001C4AF8"
w:rPr
w:u w:val="single"/
/w:rPr
w:tunderline/w:t
/w:r
w:r
w:t xml:space="preserve" normal again/w:t
/w:r
/w
w:sectPr w:rsidR="00342492"
wgSz w:w="11906" w:h="16838"/
wgMar w:top="1440" w:right="1440" w:bottom="1440"
w:left="1440" w:header="708" w:footer="708" w:gutter="0"/
w:cols w:space="708"/
w:docGrid w:linePitch="360"/
/w:sectPr
/w:body
/w:document


If I now edit the doc and place a italic section that spans some of the
"bold" and the "underline" bits you get:



?xml version="1.0" encoding="UTF-8" standalone="yes"?
w:document
xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns="urn:schemas-microsoft-comfficeffice"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"
xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
xmlns:w10="urn:schemas-microsoft-comffice:word"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml"
xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"
xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk"
xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"
mc:Ignorable="w14 wp14"
w:body
w w:rsidR="00342492" w:rsidRDefault="001C4AF8"
w:r
w:t xml:space="preserve"Test Document /w:t
/w:r
w:r w:rsidRPr="001C4AF8"
w:rPr
w:b/
/w:rPr
w:tbo/w:t
/w:r
w:r w:rsidRPr="00D66634"
w:rPr
w:b/
w:i/
/w:rPr
w:tld/w:t
/w:r
w:r w:rsidRPr="00D66634"
w:rPr
w:i/
/w:rPr
w:t xml:space="preserve"
/w:t
/w:r
w:r w:rsidRPr="00D66634"
w:rPr
w:i/
w:u w:val="single"/
/w:rPr
w:tunde/w:t
/w:r
w:r w:rsidRPr="001C4AF8"
w:rPr
w:u w:val="single"/
/w:rPr
w:tr/w:t
/w:r
w:bookmarkStart w:id="0" w:name="_GoBack"/
w:bookmarkEnd w:id="0"/
w:r w:rsidRPr="001C4AF8"
w:rPr
w:u w:val="single"/
/w:rPr
w:tline/w:t
/w:r
w:r
w:t xml:space="preserve" normal again/w:t
/w:r
/w
w:sectPr w:rsidR="00342492"
wgSz w:w="11906" w:h="16838"/
wgMar w:top="1440" w:right="1440" w:bottom="1440"
w:left="1440" w:header="708" w:footer="708" w:gutter="0"/
w:cols w:space="708"/
w:docGrid w:linePitch="360"/
/w:sectPr
/w:body
/w:document


So basically it has maintained the proper XML nesting of the sections
and created extra blocks to prevent there being any skewed or overlapped
tags.

So quite different from the WP way which would have no qualms about doing:

"Test Document [b]b[i]old[b] [u]unde[i]rline[u] normal again"


--
Cheers,

John.

/================================================== ===============\
| Internode Ltd - http://www.internode.co.uk |
|-----------------------------------------------------------------|
| John Rumm - john(at)internode(dot)co(dot)uk |
\================================================= ================/