June 2000
Intermediate to advanced
556 pages
8h 45m
English
One small problem remains. Note the \n strings in the above output. These are literally the two characters “\” followed by “n” as the PYX format reports line ends in this escaped form. Before creating an xTree, we need to decode these into real line ends. The decode function below does the work.
CD-ROM reference=9020.txt
def Decode(s):
return string.replace (s,"\\n","\n"))
We now need to call this function before creating any new xData nodes.
The PYX2String method:
CD-ROM reference=9021.txt
elif L[0] == '_':
datum = xData(l[1:])
CD-ROM reference=9022.txt
elif L[0] == '_':
datum = xData(Decode(l[1:]))
We now get correct line ends in the regenerated XML created by the test harness.
CD-ROM reference=9023.txt
C>python ...Read now
Unlock full access