Algorithm/Procedure to Translate any HTML File into a Sequence of Tag+arguments & Text strings
$10-25 USD
Færdiggjort
Slået op cirka 4 år siden
$10-25 USD
Betales ved levering
I would like a procedure, written in (structured) English and/or PHP to translate an arbitrary HTML file into a list of Tag and argument, or Text.
Define array A as:
n=1,2,3 . . . for each Tag or Text.
m=1,2,3, . . . for each Tag argument space piece.
For text: A[n]="E", A[n][0]=Text
For tag: A[n]="A", A[n][0]=Tag, A[n][m]=Tag argument space piece
The HTML for the home page of [login to view URL] on my PC begins,
<!doctype html><html dir="ltr" lang="en"><head><meta charset="utf-8"><title>New Tab</title><style>
Then:
A[1] : A
A[1][0] : !doctype
A[1][1] : html
A[2] : A
A[2][0] : html
A[2][1] : dir="ltr"
A[2][2] : lang="en"
A[3] : A
A[3][0] : head
. . .
A[6] : E
A[6][0] : New Tab
A[7] : A
A[7][0] : /title
etc.
The problem is when an argument contains > or < or a tag is special like script. (I know only a little HTML.)