1. #1
    Ext User Davi Baldin's Avatar
    Join Date
    Jul 2007
    Location
    Campinas, S
    Posts
    25
    Vote Rating
    0
    Davi Baldin is on a distinguished road

      0  

    Cool XmlReader mapping to XML attribute

    XmlReader mapping to XML attribute


    People,

    Hotwo mapping XML attributes in XmlReader like mapping XML Elements ?

    I whant:

    <item name="" value="" .../>
    <item name="" value="" .../>
    <item name="" value="" .../>

    not this...

    <item>
    <name></name>
    <value></value>
    </item>

    thanks...
    Davi

  2. #2
    Ext User
    Join Date
    Jul 2007
    Location
    Milan, Italy
    Posts
    1
    Vote Rating
    0
    tywand is on a distinguished road

      0  

    Default


    Same problem, nothing new?

    thanx,

    Ty

    Quote Originally Posted by Davi Baldin View Post
    People,

    Hotwo mapping XML attributes in XmlReader like mapping XML Elements ?

    I whant:

    <item name="" value="" .../>
    <item name="" value="" .../>
    <item name="" value="" .../>

    not this...

    <item>
    <name></name>
    <value></value>
    </item>

    thanks...
    Davi

  3. #3
    Sencha User fay's Avatar
    Join Date
    Apr 2007
    Location
    Ireland
    Posts
    1,750
    Vote Rating
    9
    fay will become famous soon enough fay will become famous soon enough

      0  

    Default


    Try:

    PHP Code:
    // ...
    reader: new Ext.data.XmlReader(
      {
    record'item'}, 
      [
        {
    name'Name'mapping'@name'}, 
        {
    name'Value'mapping'@value'}
      ]
    )
    // ... 

  4. #4
    Sencha User
    Join Date
    May 2009
    Posts
    7
    Vote Rating
    0
    max_zoro is on a distinguished road

      0  

    Question Mapping into the xml problem

    Mapping into the xml problem


    Help me somebody! I can't do mapping for these tags:

    <grade title="php" number="30015" points="5.00">95</grade>

    I need all of data of this tag in my grid, both of attributes and value, but i getting only attributes

    xml file look like this:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <student>
    + <messages del_link_prefix="https://yedion.jce.ac.il/yedion/fire...ege&arguments=">
    - </messages>

    + <courses course_link_prefix="https://yedion.jce.ac.il/yedion/fireflyweb.aspx?">
    </courses>

    - <grades>
    <grade title="יסודות התכנות" number="30015" points="5.00">95</grade>

    <grade title="מבוא למסלולי הנדסה" number="91003" points="2.00">92</grade>

    <grade title="אלגברה ליניארית" number="30002" points="4.50">92</grade>

    <grade title="מבוא לגורמי אנוש" number="30018" points="2.50">70</grade>


    </grades>
    </student>

  5. #5
    Sencha User
    Join Date
    Jun 2011
    Location
    Spain
    Posts
    2
    Vote Rating
    0
    jap1968 is on a distinguished road

      0  

    Exclamation Same problem here

    Same problem here


    Working with ExtJS 4.0
    I need to populate a grid with XML just in the same form that in your case:

    <dicom>
    <attr tag="00020000" vr="UL" len="4">180</attr>
    <attr tag="00020001" vr="OB" len="2">00\01</attr>
    <attr tag="00020002" vr="UI" len="28">1.2.840.10008.5.1.4.1.1.12.2</attr>
    <attr tag="00020003" vr="UI" len="46">1.3.46.670589.6.1.0.21521427.2010092109392072</attr>
    <attr tag="00020010" vr="UI" len="22">1.2.840.10008.1.2.4.70</attr>
    <attr tag="00020012" vr="UI" len="16">1.2.40.0.13.1.1</attr>
    ...
    </dicom>

    This is the output generated by a third part Dicom to XML conversion tool. I can get the attribute values, but so far I am not able to get the node values.

  6. #6
    Sencha User
    Join Date
    Jun 2011
    Location
    Spain
    Posts
    2
    Vote Rating
    0
    jap1968 is on a distinguished road

      0  

    Default Getting attributes and main value

    Getting attributes and main value


    Solved!

    Quote Originally Posted by jap1968 View Post
    Working with ExtJS 4.0
    I need to populate a grid with XML just in the same form that in your case:

    <dicom>
    <attr tag="00020000" vr="UL" len="4">180</attr>
    <attr tag="00020001" vr="OB" len="2">00\01</attr>
    <attr tag="00020002" vr="UI" len="28">1.2.840.10008.5.1.4.1.1.12.2</attr>
    <attr tag="00020003" vr="UI" len="46">1.3.46.670589.6.1.0.21521427.2010092109392072</attr>
    <attr tag="00020010" vr="UI" len="22">1.2.840.10008.1.2.4.70</attr>
    <attr tag="00020012" vr="UI" len="16">1.2.40.0.13.1.1</attr>
    ...
    </dicom>
    That works as expected, at least with Ext JS 4.0

    Code:
        Ext.define('DicomAttr',{
            extend: 'Ext.data.Model',
            fields: [
                {name: 'tag', mapping: '@tag', type: 'string'},
                {name: 'vr', mapping: '@vr', type: 'string'},
                {name: 'len', mapping: '@len', type: 'int'},
                {name: 'value', mapping: '/', type: 'string'}
            ]
        });
    Regards,

    José Antonio

  7. #7
    Sencha User
    Join Date
    May 2009
    Posts
    7
    Vote Rating
    0
    max_zoro is on a distinguished road

      0  

    Default


    Thanks a lot!!!

  8. #8
    Sencha User
    Join Date
    Oct 2008
    Posts
    27
    Vote Rating
    0
    JAD1951 is on a distinguished road

      0  

    Default trees inside 4 version

    trees inside 4 version


    I have a tree for which each node (root including) have differents attributes. In which way I can load a full tree : each node with his own model ? !!!

    Thanks,

    JAD1951