1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    4
    Vote Rating
    1
    Barr is on a distinguished road

      0  

    Default Answered: Configure reader.Xml to read custom format

    Answered: Configure reader.Xml to read custom format


    So the native reader.Xml can handle xml with this format:

    Code:
    <users>
        <user>
            <id>1</id>
            <name>Ed Spencer</name>
            <email>ed@sencha.com</email>
        </user>
        <user>
            <id>2</id>
            <name>Abe Elias</name>
            <email>abe@sencha.com</email>
        </user>
    </users>
    But my framework uses xml like this:

    Code:
    <users>
        <user id="1" name="Ed Spancer" email="ed@sencha.com"/>
        <user id="2" name="Abe Elias" email="abe@sencha.com"/>
    </users>
    How would you go about solving this?

    Kind Regards,
    Barr

  2. I don't think you need to do anything special with the reader but you'll need to specify mappings on your fields:

    http://docs.sencha.com/ext-js/4-0/#!...ld-cfg-mapping

    Use @ before an attribute name.

    If you can't get it to work then please post the code for your reader and field definitions.

  3. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,510
    Answers
    528
    Vote Rating
    288
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    I don't think you need to do anything special with the reader but you'll need to specify mappings on your fields:

    http://docs.sencha.com/ext-js/4-0/#!...ld-cfg-mapping

    Use @ before an attribute name.

    If you can't get it to work then please post the code for your reader and field definitions.

Thread Participants: 1