XML/Input: Difference between revisions

(→‎{{header|Go}}: library change)
Line 1,716:
Emily
</pre>
 
=={{header|TXR}}==
 
No support for the HTML syntax &#xABCD to properly render Emily with the grave accent over the E.
 
Actual Unicode is fully supported: all I/O in TXR is UTF-8.
 
 
<lang txr>#!/usr/local/bin/txr -f
<Students>
@(collect)
@ (some)
<Student Name="@NAME" Gender="@GENDER"@/ +/DateOfBirth="@YEAR-@MONTH-@DAY"@/.*/
@ (or)
<Student DateOfBirth="@YEAR-@MONTH-@DAY" Gender="@GENDER" Name="@NAME"@/.*/
@ (end)
@ (maybe)
<Pet Type="@PET_TYPE" Name="@PET_NAME" />
@ (or)
@ (bind PET_TYPE "none")
@ (bind PET_NAME "")
@ (end)
@(until)
</Students>
@(end)
@(output)
NAME G DOB PET
@ (repeat)
@{NAME 12} @GENDER @YEAR-@MONTH-@DAY @PET_TYPE @PET_NAME
@ (end)
@(end)
</lang>
 
Sample run:
<pre>$ ./students.txr students.xml
NAME G DOB PET
April F 1989-01-02 none
Bob M 1990-03-04 none
Chad M 1991-05-06 none
Dave M 1992-07-08 dog Rover
&#x00C9;mily F 1993-09-10 none
</pre>
 
 
=={{header|Vedit macro language}}==
Anonymous user