How to resolve the algorithm XML/XPath step by step in the TUSCRIPT programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm XML/XPath step by step in the TUSCRIPT programming language

Table of Contents

Problem Statement

Perform the following three XPath queries on the XML Document below: XML Document:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm XML/XPath step by step in the TUSCRIPT programming language

Source code in the tuscript programming language

$$ MODE TUSCRIPT,{}
MODE DATA
$$ XML=*

  
Invisibility Cream 14.50 Makes you invisible Levitation Salve 23.99 Levitate yourself for up to 3 hours per application
Blork and Freen Instameal 4.95 A tasty meal in a tablet; just add water Grob winglets 3.56 Tender winglets of Grob. Just add water
$$ MODE TUSCRIPT FILE = "test.xml" ERROR/STOP CREATE (file,fdf-o,-std-) FILE/ERASE/UTF8 $FILE = xml BUILD S_TABLE beg="::::" BUILD S_TABLE end="::::" BUILD S_TABLE modifiedbeg=":::" BUILD S_TABLE modifiedend=":::" firstitem=names="",countitem=0 ACCESS q: READ/STREAM/UTF8 $FILE s,a/beg+t+e/end LOOP READ/EXIT q IF (a=="") names=APPEND(names,t) IF (a=="") PRINT t IF (a.sw." IF (countitem==1) THEN firstitem=CONCAT(firstitem,a) firstitem=CONCAT(firstitem,t) firstitem=CONCAT(firstitem,e) IF (e=="") THEN COUNTITEM=0 MODIFY ACCESS q s_TABLE modifiedbeg,-,modifiedend ENDIF ENDIF ENDLOOP ENDACCESS q ERROR/STOP CLOSE (file) firstitem=EXCHANGE (firstitem,":{2-00} ::") firstitem=INDENT_TAGS (firstitem,-," ") names=SPLIT(names) TRACE *firstitem,names

You may also check:How to resolve the algorithm Repeat a string step by step in the VBA programming language
You may also check:How to resolve the algorithm Discordian date step by step in the Go programming language
You may also check:How to resolve the algorithm Doubly-linked list/Traversal step by step in the Objeck programming language
You may also check:How to resolve the algorithm Arrays step by step in the Io programming language
You may also check:How to resolve the algorithm Loops/Infinite step by step in the ARM Assembly programming language