1. #1
    Sencha User
    Join Date
    May 2011
    Location
    Italy
    Posts
    71
    Vote Rating
    7
    Wilky is on a distinguished road

      0  

    Default Write nested XML

    Write nested XML


    Hi fellas,
    I'm trying to write nested XML data via XmlWriter but all my experiments are failed.
    I used model associations, proxy and XML writer.

    So, I finally reach this point: maybe I can't write nested XML with ExtJS.

    Here's an example of the XML I want to write (and send) to my server app:

    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <list>
      <user>
        <id>1</id>
        <name>Wilk</name>
        <age>25</age>
      </user>
      <user>
        <id>2</id>
        <name>Kilw</name>
        <age>52</age>
      </user>
      <user>
        <id>3</id>
        <name>Ilkw</name>
        <age>252</age>
      </user>
    </list>
    How can I write that XML with Ext.data.writer.Xml? Is it possible?

    Thanks in advance.

    Cyaz

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,976
    Vote Rating
    453
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      1  

    Default


    The writer does not support nesting at this time.

    Scott.

  3. #3
    Sencha User
    Join Date
    May 2011
    Location
    Italy
    Posts
    71
    Vote Rating
    7
    Wilky is on a distinguished road

      0  

    Default


    Got it! Thanks Scott

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    3
    Vote Rating
    0
    Moksh is on a distinguished road

      0  

    Default I want to read an XML which has same elements multiple times .

    I want to read an XML which has same elements multiple times .


    For example an XML:
    <root>
    <record>
    <element>element1</element>
    <element>element2</element>
    <element>element3</element>
    </record>
    <record><element>element4</element></record>
    <record><element>element5</element></record>
    <record><element>element6</element></record>
    </root>

    I am reading this XML with a model. The mapping used is as follows:
    fields: [
    { name: 'record', mapping: 'record > element'}
    ]

    But I can't find the values element2 and element3. Only values element1,element4,element5 nad element6 I got. Please help.

  5. #5
    Sencha User
    Join Date
    Feb 2013
    Posts
    10
    Vote Rating
    0
    RSSoll is on a distinguished road

      0  

    Default


    How about now? Is it supported?