doujiang1832 2014-12-12 09:17
浏览 33

如何使用AJAX解析XML文档以查看元素是否存在以及是否存在,将其传递给PHP文件

I have been stuck on this for the past couple days. The exact question is :

"Using Ajax write an application that allows the user to enter an item name (from above XML and display a relevant message if found in the document and the information about the item quantity"

XML File :

<?xml version="1.0" encoding="UTF-8"?>
<Recipe>
    <Name>Lime Jello Marshmellow Cottage Cheese Suprise</Name>
    <Description>My grandma's favourite (may she rest in peace).</Description>
    <Ingredients>
        <Ingredient>
            <Qty unit="box">1</Qty>
            <Item>Lime Gelatin</Item>
        </Ingredient>
        <Ingredient>
            <Qty unit="g">500</Qty>
            <Item>Multi Coloured tiny marshmallows</Item>
        </Ingredient>
        <Ingredient>
            <Qty unit="ml">500</Qty>
            <Item>Cottage Cheese</Item>
        </Ingredient>
        <Ingredient>
            <Qty unit="dash"/>
            <Item optional="1">Tabasco sauce</Item>
        </Ingredient>
    </Ingredients>
    <Instruction>
        <step>Prepare line gelatin according to package instructions</step>
    </Instruction>
</Recipe>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于smbclient 库的使用
    • ¥15 微信小程序协议怎么写
    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画