A demo showing Partial Updates of an (X)HTML Page

This is a demo showing how parts of an existing XHTML page could be replaced from the server using ordinary XHML but just embedded for transport and resolve on the client side.

Flow

Each row demonstrate an example

Columns

Purpose
Here we desbribe what we want to achive
pseudoSQL
We look at the present client XHTML as an addressable tree. XMLElements which we want to update has a unique id and can therefore be treated sa a table called views. They are traditional id attribute which most HTML Elements can have. Like div, td etc. We call them view here
XML
This is the oepration to be performaed at the client side. If a content portion is required it's length is calculated in able to reduce the parsing at tteh client.
TryIt
Perform the action and compare Before and After columns
X
Y
X
Y
 
PurposepseudoSQLXMLTry itBeforeAfter
The content of view 'view1' should be updated to the value 'DATA1'UPDATE views
SET content ='DATA1'
WHERE id ='viewid1'
<uv id='viewid1' length='5' />DATA1
viewid1
viewid1
The view 'viewid2' should deletedDELETE view
WHERE id='viewid2'
<dv id='viewid2'/>
viewid2DATA2
viewid2
DATA2
A sibling should be inserted before view 'viewid3'UPDATE view
insert sibling
'<li>(ett+tva)/2/</li>'
before
WHERE id='viewid3'
<isb id='viewid3' length='99'/><li>(ett+tva)/2/</li>
  • ett
  • viewid3tva
  • tre
  • ett
  • viewid3tva
  • tre
A sibling should be inserted after view 'viewid4'UPDATE view
insert sibling
<li>(tva+tre)/2</li>
after
WHERE id='viewid4'
<iss id='viewid3' length='99'/><li>(tva+tre)/2</li>
  • ett
  • viewid4tva
  • tre
  • ett
  • viewid4tva
  • tre
A sibling should be inserted first in the view 'viewid5'UPDATE view
add child
'(noll)'
as first WHERE id='view5'
<icf length='99' id='view5'/>(noll)
viewid5
  • ett
  • tva
  • tre
viewid5
  • ett
  • tva
  • tre
A sibling should be inserted last in the view 'viewid6'UPDATE view
add child
'(noll)'
as last WHERE id='view6'
<icl length='99' id='view6'/>(noll)
viewid6
  • ett
  • tva
  • tre
viewid6
  • ett
  • tva
  • tre
An attribute for the 'viewid7' is updated UPDATE view
SET value ='newvalue'
WHERE id ='viewid7' and attribute='attr'
<uva id='view7' attr='dir' value='rtl'/>
viewid7
  • ett
  • tva
  • tre
viewid7
  • ett
  • tva
  • tre
An attribute value for a class is changedUPDATE classes
SET value ='green'
WHERE id ='LIIMPORTANT' and attribute='color'
<uca id='LIIMPORTANT' attr='color' value='green'/>
  • ett
  • viewid8tva
  • tre
  • ett
  • viewid8tva
  • tre