1. #1
    Sencha User
    Join Date
    Dec 2007
    Posts
    11
    Vote Rating
    0
    stefano is on a distinguished road

      0  

    Default Unanswered: XML Reader with complex tags in xml

    Unanswered: XML Reader with complex tags in xml


    Hi,
    I am using a store with an XML reader.
    In XML I have these tags:
    Code:
    <featureTypes>
      <featureType>
        <name>cities</name>
        <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/tpi/featuretypes/cities.xml" type="application/xml"/>
      </featureType>
      <featureType>
        <name>world</name>
        <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/workspaces/tpi/featuretypes/world.xml" type="application/xml"/>
      </featureType>
    </featureTypes>
    How can I configure fields property on model object in order to read also the "href" attribute in "atom:link" tags?
    I tried with the following code but I have an error:
    Code:
        fields: [
           {name: 'name'}
           , {name: 'link', mapping: 'atom:link@href'}
        ]
    What is the correct value in mapping property in order to load the value in XML for the tag atom:link?

    Thank you
    bye
    stefano

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Try this:

    Code:
    { name : 'link', mapping : 'link@href' }
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Dec 2007
    Posts
    11
    Vote Rating
    0
    stefano is on a distinguished road

      0  

    Default


    I tried with the code you suggested me, but not works, the column is empty.

    Quote Originally Posted by mitchellsimoens View Post
    Try this:

    Code:
    { name : 'link', mapping : 'link@href' }

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Really? I inspected the store and the href worked perfectly for me.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread