如何将XML数据解析为角度2应用程序

时间:2018-02-01 08:56:39

标签: javascript xml angular dom

Fox示例我有以下XML数据

<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
    <book category="cooking">
       <title lang="en">Everyday Italian</title>
        <author>Giada De Laurentiis</author>
        <year>2005</year>
        <price>30.00</price>
    </book>
    <book category="children">
        <title lang="en">Harry Potter</title>
        <author>J K. Rowling</author>
        <year>2005</year>
        <price>29.99</price>
    </book>
    <book category="web">
        <title lang="en">XQuery Kick Start</title>
        <author>James McGovern</author>
        <author>Per Bothner</author>
        <author>Kurt Cagle</author>
        <author>James Linn</author>
        <author>Vaidyanathan Nagarajan</author>
        <year>2003</year>
        <price>49.99</price>
    </book>
    <book category="web" cover="paperback">
        <title lang="en">Learning XML</title>
        <author>Erik T. Ray</author>
        <year>2003</year>
        <price>39.95</price>
    </book>
</bookstore>

我如何解析这些数据并使用角度分量和显示来渲染它。如何访问数据并使用angular

获取结果

0 个答案:

没有答案