XML/Input: Difference between revisions
Content added Content deleted
(added J) |
|||
Line 44: | Line 44: | ||
} |
} |
||
</actionscript> |
</actionscript> |
||
=={{header|J}}== |
|||
J's system includes XML processing libraries -- this task is best addressed with the XSLT library: |
|||
load 'xml/xslt' |
|||
XSL xslt XML |
|||
April |
|||
Bob |
|||
Chad |
|||
Dave |
|||
Emily |
|||
with the appropriate definitions of <tt>XSL</tt> and <tt>XML</tt>: |
|||
XML =: noun define |
|||
<Students> |
|||
<Student Name="April" /> |
|||
<Student Name="Bob" /> |
|||
<Student Name="Chad" /> |
|||
<Student Name="Dave" /> |
|||
<Student Name="Emily" /> |
|||
</Students> |
|||
) |
|||
XSL =: noun define |
|||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:h="http://www.w3.org/1999/xhtml"> |
|||
<xsl:output method="text" encoding="UTF-8" media-type="text/plain" /> |
|||
<xsl:template match="/"> |
|||
<xsl:apply-templates select="/Students/Student" /> |
|||
</xsl:template> |
|||
<xsl:template match="/Students/Student"> |
|||
<xsl:value-of select="@Name" /> |
|||
<!-- Platform-independent line breaks (instead of or something) --> |
|||
<xsl:text><![CDATA[ |
|||
]]></xsl:text> |
|||
</xsl:template> |
|||
</xsl:stylesheet> |
|||
) |
|||
=={{header|Visual Basic .NET}}== |
=={{header|Visual Basic .NET}}== |