用 android 解析 XML 字符串

Parse a XML String with android

我正在尝试解析保存了 xml 的 String。我已经创建了这个 class,但我不知道如何通过我的String 到此 class,然后取标签内的值。

我的 string 包含这个 XML:

<?xml version="1.0" encoding="UTF-8"><productes><producte><id>4</id>      <nomordre>beguda</nomordre><nom>Aigua</nom><preu>1.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>6</id><nomordre>entrant</nomordre><nom>Amanida de formatge de cabra, nous i vinagreta de mel</nom><preu>11.00</preu><descripcio>Amanida de formatge de cabra, nous i vinagreta de mel xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>22</id><nomordre>entrant</nomordre><nom>Amanida verda</nom><preu>8.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>17</id><nomordre>beguda</nomordre><nom>Cava Cuvée Santamaria 07</nom><preu>49.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>24</id><nomordre>entrant</nomordre><nom>Coca de sardina amb albergínia fumada i pernil</nom><preu>9.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>13</id><nomordre>postre</nomordre><nom>Coulant de xocolata, ametlla garrapinyada amb gelat</nom><preu>6.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>8</id><nomordre>entrant</nomordre><nom>Croquetes de pernil ibèric</nom><preu>8.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>18</id><nomordre>beguda</nomordre><nom>Elisabet Raventós 05</nom><preu>45.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>9</id><nomordre>segon</nomordre><nom>Entrecot de buey amb patates fregides</nom><preu>16.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>27</id><nomordre>beguda</nomordre><nom>Fanta llimona</nom><preu>1.50</preu><descripcio>Fanta de llimona</descripcio><detall></detall><iva>21.00</iva><imatge>./img/productes/proimg_Fanta llimona.png</imatge><imatge_s1></imatge_s1><imatge_s2>./img/productes/proimg02_Fanta llimona.png</imatge_s2><imatge_s3></imatge_s3></producte><producte><id>5</id><nomordre>segon</nomordre><nom>Filet de vedella amb bolets</nom><preu>12.00</preu><descripcio>Filet de vedella amb bolets xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>23</id><nomordre>entrant</nomordre><nom>Gaspatxo a la andalusa</nom><preu>7.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>25</id><nomordre>segon</nomordre><nom>Graellada de verdures del temps amb salsa romesco</nom><preu>11.50</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>14</id><nomordre>postre</nomordre><nom>Llet fregida amb mel, pinyons i un toc cítric</nom><preu>5.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>26</id><nomordre>entrant</nomordre><nom>Ous fregits amb xanguets i xistorra</nom><preu>8.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>7</id><nomordre>entrant</nomordre><nom>Ous trencats i bolets</nom><preu>9.50</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>19</id><nomordre>beguda</nomordre><nom>Perrier Jouët Belle Epoque 99</nom><preu>235.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>20</id><nomordre>beguda</nomordre><nom>Pouilly Fumé Silex 04</nom><preu>230.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>21</id><nomordre>entrant</nomordre><nom>Sopa de Cadaqués</nom><preu>11.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>11</id><nomordre>entrant</nomordre><nom>Tac de foie rostit amb configura casera de tomàquet i terra de fruits secs</nom><preu>9.50</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>15</id><nomordre>postre</nomordre><nom>Tarta de formatge</nom><preu>5.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>12</id><nomordre>entrant</nomordre><nom>Tempura de verdura (salsa agridolça, salsa de mostassa i de soja</nom><preu>10.50</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>10</id><nomordre>segon</nomordre><nom>Tonyina vermella marinada amb soja, gingebre i fideus cruixents darrós</nom><preu>13.50</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>16</id><nomordre>postre</nomordre><nom>Torrija de taronja amb crema de xocolata i gelat de canella</nom><preu>7.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte></productes>

而我的 parser class 是:

public class XmlHandler extends DefaultHandler {
private List<productexml> productes;
private productexml producteActual;
public StringBuilder sbTexto;

public List<productexml> getProductes(){
    return productes;
}

@Override
public void characters(char[] ch, int start, int length)
        throws SAXException {

    super.characters(ch, start, length);

    if (this.producteActual != null)
        sbTexto.append(ch, start, length);
}

@Override
public void endElement(String uri, String localName, String name)
        throws SAXException {

    super.endElement(uri, localName, name);

    if (this.producteActual != null) {

        if (localName.equals("id")) {
            producteActual.setId(Integer.parseInt(sbTexto.toString()));
        } else if (localName.equals("nomordre")) {
            producteActual.setOrdre(sbTexto.toString());
        } else if (localName.equals("nom")) {
            producteActual.setNom(sbTexto.toString());
        } else if (localName.equals("preu")) {
            producteActual.setPreu(Double.parseDouble(sbTexto.toString()));
        } else if (localName.equals("descripcio")) {
            producteActual.setDescripcio(sbTexto.toString());
        } else if (localName.equals("iva")) {
            producteActual.setIVA(Double.parseDouble(sbTexto.toString()));
        }else if (localName.equals("imatge")) {
            producteActual.setImgPrincipal(sbTexto.toString());
        }else if (localName.equals("imatge_s1")) {
            producteActual.setImgDetall1(sbTexto.toString());
        }else if (localName.equals("imatge_s2")) {
            producteActual.setImgDetall2(sbTexto.toString());
        }else if (localName.equals("imatge_s3")) {
            producteActual.setImgDetall3(sbTexto.toString());
        }
        else if (localName.equals("producte")) {
            productes.add(producteActual);
        }
        sbTexto.setLength(0);
    }
}

@Override
public void startDocument() throws SAXException {

    super.startDocument();

    productes = new ArrayList<productexml>();
    sbTexto = new StringBuilder();
}

@Override
public void startElement(String uri, String localName,
                         String name, Attributes attributes) throws SAXException {

    super.startElement(uri, localName, name, attributes);

    if (localName.equals("producte")) {
        producteActual = new productexml();
    }
  }

编辑

以为@Yuva Raj 的问题得到了正确的回答,但是当我在我的项目中实现我的代码时,我注意到这段代码是针对 Java 而不是 Android,这是一个很好的尝试他因为有人正在寻找 java 问题的答案,但这个问题是针对 Android.

如果您需要更多代码或关于我的问题的更多解释,请告诉我,我会粘贴代码或回复您所需的内容。

使用 xmlPullParser 很简单。这是布局整洁的 xml 文件:

<productes>
    <producte>
        <id>4</id>
        <nomordre>beguda</nomordre>
        <nom>Aigua</nom>
        <preu>1.00</preu>
        <descripcio></descripcio>
        <detall></detall>
        <iva>21.00</iva>
        <imatge></imatge>
        <imatge_s1></imatge_s1>
        <imatge_s2></imatge_s2>
        <imatge_s3></imatge_s3>
    </producte>
    <producte>
        <id>6</id>
        <nomordre>entrant</nomordre>
        <nom>Amanida de formatge de cabra, nous i vinagreta de mel</nom>
        <preu>11.00</preu>
        <descripcio>Amanida de formatge de cabra, nous i vinagreta de mel xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</descripcio>
        <detall></detall>
        <iva>21.00</iva>
        <imatge></imatge>
        <imatge_s1></imatge_s1>
        <imatge_s2></imatge_s2>
        <imatge_s3></imatge_s3>
    </producte>
    ....
    ...
    ..
    </productes>

Here 是个不错的工具,您也可以尝试一下。

代码:

import java.io.IOException;
import java.io.StringReader;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;

public class TestClass {


    static String text;

       public static void main (String args[])
                 throws XmlPullParserException, IOException
             {
                 XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
                 factory.setNamespaceAware(true);
                 XmlPullParser xpp = factory.newPullParser();

// your xml content

                 String xmlString = "<productes><producte><id>4</id><nomordre>beguda</nomordre><nom>Aigua</nom><preu>1.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>6</id><nomordre>entrant</nomordre><nom>Amanida de formatge de cabra, nous i vinagreta de mel</nom><preu>11.00</preu><descripcio>Amanida de formatge de cabra, nous i vinagreta de mel xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>22</id><nomordre>entrant</nomordre><nom>Amanida verda</nom><preu>8.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>17</id><nomordre>beguda</nomordre><nom>Cava Cuvée Santamaria 07</nom><preu>49.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>24</id><nomordre>entrant</nomordre><nom>Coca de sardina amb albergínia fumada i pernil</nom><preu>9.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>13</id><nomordre>postre</nomordre><nom>Coulant de xocolata, ametlla garrapinyada amb gelat</nom><preu>6.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>8</id><nomordre>entrant</nomordre><nom>Croquetes de pernil ibèric</nom><preu>8.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>18</id><nomordre>beguda</nomordre><nom>Elisabet Raventós 05</nom><preu>45.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>9</id><nomordre>segon</nomordre><nom>Entrecot de buey amb patates fregides</nom><preu>16.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>27</id><nomordre>beguda</nomordre><nom>Fanta llimona</nom><preu>1.50</preu><descripcio>Fanta de llimona</descripcio><detall></detall><iva>21.00</iva><imatge>./img/productes/proimg_Fanta llimona.png</imatge><imatge_s1></imatge_s1><imatge_s2>./img/productes/proimg02_Fanta llimona.png</imatge_s2><imatge_s3></imatge_s3></producte><producte><id>5</id><nomordre>segon</nomordre><nom>Filet de vedella amb bolets</nom><preu>12.00</preu><descripcio>Filet de vedella amb bolets xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>23</id><nomordre>entrant</nomordre><nom>Gaspatxo a la andalusa</nom><preu>7.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>25</id><nomordre>segon</nomordre><nom>Graellada de verdures del temps amb salsa romesco</nom><preu>11.50</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>14</id><nomordre>postre</nomordre><nom>Llet fregida amb mel, pinyons i un toc cítric</nom><preu>5.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>26</id><nomordre>entrant</nomordre><nom>Ous fregits amb xanguets i xistorra</nom><preu>8.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>7</id><nomordre>entrant</nomordre><nom>Ous trencats i bolets</nom><preu>9.50</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>19</id><nomordre>beguda</nomordre><nom>Perrier Jouët Belle Epoque 99</nom><preu>235.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>20</id><nomordre>beguda</nomordre><nom>Pouilly Fumé Silex 04</nom><preu>230.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>21</id><nomordre>entrant</nomordre><nom>Sopa de Cadaqués</nom><preu>11.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>11</id><nomordre>entrant</nomordre><nom>Tac de foie rostit amb configura casera de tomàquet i terra de fruits secs</nom><preu>9.50</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>15</id><nomordre>postre</nomordre><nom>Tarta de formatge</nom><preu>5.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>12</id><nomordre>entrant</nomordre><nom>Tempura de verdura (salsa agridolça, salsa de mostassa i de soja</nom><preu>10.50</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>10</id><nomordre>segon</nomordre><nom>Tonyina vermella marinada amb soja, gingebre i fideus cruixents darrós</nom><preu>13.50</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte><producte><id>16</id><nomordre>postre</nomordre><nom>Torrija de taronja amb crema de xocolata i gelat de canella</nom><preu>7.00</preu><descripcio></descripcio><detall></detall><iva>21.00</iva><imatge></imatge><imatge_s1></imatge_s1><imatge_s2></imatge_s2><imatge_s3></imatge_s3></producte></productes>";

                 // passing your xml here
                 xpp.setInput(new StringReader (xmlString));
                 int eventType = xpp.getEventType();
                 // parses till it finds the end of document
                 while (eventType != XmlPullParser.END_DOCUMENT) {
                    // gets the tag name here                   
                     String tagname = xpp.getName();

                     switch (eventType) {
                        case XmlPullParser.START_TAG:

                              if (tagname.equalsIgnoreCase("producte")) {
                                   System.out.println("<prdoucte>");
                                }                         

                            break;

                        case XmlPullParser.TEXT:
                            text = xpp.getText();
                            break;

                        case XmlPullParser.END_TAG:

                            if (tagname.equalsIgnoreCase("producte")) {
                                   System.out.println("</prdoucte>");
                            } 

                            if (tagname.equalsIgnoreCase("id")) {
                                   System.out.println("Id is : " +text);
                                } 

                            if (tagname.equalsIgnoreCase("nomordre")) {
                                   System.out.println("nomordre is : " +text);
                                } 

                            if (tagname.equalsIgnoreCase("nom")) {
                                   System.out.println("nom is : " +text);
                                } 


                            // ....add what are the tags you want


                        default:
                            break;

                    }

                  eventType = xpp.next();
                 }
             }

}

上面的代码都是不言自明的。如果需要,您可以查看文档。

并且,这是输出。在这种情况下,我从一些标签(如 id、nomordre、nom)中获取内容。如果你愿意,你可以在下面添加更多标签 case XmlPullParser.END_TAG::

<prdoucte>
Id is : 4
nomordre is : beguda
nom is : Aigua
</prdoucte>
<prdoucte>
Id is : 6
nomordre is : entrant
nom is : Amanida de formatge de cabra, nous i vinagreta de mel
</prdoucte>
<prdoucte>
Id is : 22
nomordre is : entrant
nom is : Amanida verda
</prdoucte>
<prdoucte>
Id is : 17
nomordre is : beguda
nom is : Cava Cuvée Santamaria 07
</prdoucte>
<prdoucte>
Id is : 24
nomordre is : entrant
nom is : Coca de sardina amb albergínia fumada i pernil
</prdoucte>
<prdoucte>
Id is : 13
nomordre is : postre
nom is : Coulant de xocolata, ametlla garrapinyada amb gelat
</prdoucte>
<prdoucte>
Id is : 8
nomordre is : entrant
nom is : Croquetes de pernil ibèric
</prdoucte>
<prdoucte>
Id is : 18
nomordre is : beguda
nom is : Elisabet Raventós 05
</prdoucte>
<prdoucte>
Id is : 9
nomordre is : segon
nom is : Entrecot de buey amb patates fregides
</prdoucte>
<prdoucte>
Id is : 27
nomordre is : beguda
nom is : Fanta llimona
</prdoucte>
<prdoucte>
Id is : 5
nomordre is : segon
nom is : Filet de vedella amb bolets
</prdoucte>
<prdoucte>
Id is : 23
nomordre is : entrant
nom is : Gaspatxo a la andalusa
</prdoucte>
<prdoucte>
Id is : 25
nomordre is : segon
nom is : Graellada de verdures del temps amb salsa romesco
</prdoucte>
<prdoucte>
Id is : 14
nomordre is : postre
nom is : Llet fregida amb mel, pinyons i un toc cítric
</prdoucte>
<prdoucte>
Id is : 26
nomordre is : entrant
nom is : Ous fregits amb xanguets i xistorra
</prdoucte>
<prdoucte>
Id is : 7
nomordre is : entrant
nom is : Ous trencats i bolets
</prdoucte>
<prdoucte>
Id is : 19
nomordre is : beguda
nom is : Perrier Jouët Belle Epoque 99
</prdoucte>
<prdoucte>
Id is : 20
nomordre is : beguda
nom is : Pouilly Fumé Silex 04
</prdoucte>
<prdoucte>
Id is : 21
nomordre is : entrant
nom is : Sopa de Cadaqués
</prdoucte>
<prdoucte>
Id is : 11
nomordre is : entrant
nom is : Tac de foie rostit amb configura casera de tomàquet i terra de fruits secs
</prdoucte>
<prdoucte>
Id is : 15
nomordre is : postre
nom is : Tarta de formatge
</prdoucte>
<prdoucte>
Id is : 12
nomordre is : entrant
nom is : Tempura de verdura (salsa agridolça, salsa de mostassa i de soja
</prdoucte>
<prdoucte>
Id is : 10
nomordre is : segon
nom is : Tonyina vermella marinada amb soja, gingebre i fideus cruixents darrós
</prdoucte>
<prdoucte>
Id is : 16
nomordre is : postre
nom is : Torrija de taronja amb crema de xocolata i gelat de canella
</prdoucte>