Results 1 to 4 of 4

Thread: XML Reader with complex tags in xml

  1. #1
    Sencha User
    Join Date
    Dec 2007
    Posts
    12
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,894
    Answers
    3970
    Vote Rating
    1327
      0  

    Default

    Try this:

    Code:
    { name : 'link', mapping : 'link@href' }
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Dec 2007
    Posts
    12
    Vote Rating
    0
      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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,894
    Answers
    3970
    Vote Rating
    1327
      0  

    Default

    Really? I inspected the store and the href worked perfectly for me.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •