XML/Input: Difference between revisions

Content added Content deleted
m (→‎{{header|Tcl}}: shorten code a bit)
(more complicated document model for a better example)
Line 4: Line 4:


<lang xml><Students>
<lang xml><Students>
<Student Name="April" />
<Student Name="April" Gender="F" DateOfBirth="1989-01-02" />
<Student Name="Bob" />
<Student Name="Bob" Gender="M" DateOfBirth="1990-03-04" />
<Student Name="Chad" />
<Student Name="Chad" Gender="M" DateOfBirth="1991-05-06" />
<Student Name="Dave" />
<Student Name="Dave" Gender="M" DateOfBirth="1992-07-08">
<Student Name="Emily" />
<Pet Type="dog" Name="Rover" />
</Student>
<Student DateOfBirth="1993-09-10" Gender="F" Name="Emily" />
</Students></lang>
</Students></lang>


Line 46: Line 48:




=={{header|AWK}}==
==[[AWK]]==
{{incorrect|AWK}}
AWK has no XML support. However, careful analysis of the task shows that it just asks for the strings in double quotes. So, here goes - split on quotes, and keep every other content:
AWK has no XML support. However, careful analysis of the task shows that it just asks for the strings in double quotes. So, here goes - split on quotes, and keep every other content:
<lang awk>
<lang awk>