Jump to content

XML/Input: Difference between revisions

added J
(added J)
Line 44:
}
</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 &#10; or something) -->
<xsl:text><![CDATA[
]]></xsl:text>
</xsl:template>
</xsl:stylesheet>
)
 
=={{header|Visual Basic .NET}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.