Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Ext JS Premium Member
    Join Date
    May 2007
    Posts
    46
    Vote Rating
    1
    fshort is on a distinguished road

      0  

    Default xml namespaces with Ext.DomQuery

    xml namespaces with Ext.DomQuery


    Hi,
    I have an xml document which contains element names consisting of namespaces, i.e.:

    <cam:Alertcode>3000</cam:AlertCode>

    I'd like to use the DomQuery class to select this node from the document but it throws an error:

    Code:
     Ext.DomQuery.pseudos[name] is not a function.
    The command I'm using to do the select is

    Code:
    Ext.DomQuery.selectNode("cam:AlertCode", doc.firstChild);
    Is there a way to use DomQuery to select elements who's name contains a namespace reference?
    Last edited by mystix; 29 Nov 2007 at 6:42 PM. Reason: moved to 1.x Help from 1.x Bugs

  2. #2
    Ext User
    Join Date
    Jan 2008
    Location
    Paris (Les Lilas)
    Posts
    4
    Vote Rating
    0
    Hadrien is on a distinguished road

      0  

    Default


    I you want to use xml namespaces with DomQuery you have to modify a little bit the source code :

    replace
    Code:
    var tagTokenRe = /^(#)?([\w-\*]+)/;
    by
    Code:
    var tagTokenRe = /^(#)?([\w-\*]+:?[\w-\*]+)/
    and
    Code:
    re: /^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
    select: 'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'
    by
    Code:
    re: /^(?:([\[\{])(?:@)?([\w-:]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
    [\]\}])/,
    select: 'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'
    add
    Code:
    var namespaceRe = /^([\w]+:)?([\w-\*]+)/;
    just after
    Code:
    var tagTokenRe = /^(#)?([\w]+:?[\w]+|\*)/;
    and thus modify

    Code:
            if(!mode){
                for(var i = 0, ni; ni = ns[i]; i++){
                    cs = ni.getElementsByTagName(tagName);
                    for(var j = 0, ci; ci = cs[j]; j++){
                        result[++ri] = ci;
                    }
                }
    like this

    Code:
            if(!mode){
                for(var i = 0, ni; ni = ns[i]; i++){
                    cs = ni.getElementsByTagName(tagName.match(namespaceRe)[2]);
                    for(var j = 0, ci; ci = cs[j]; j++){
                        result[++ri] = ci;
                    }
                }
    You can ask me by PM if I'm not clear.

    Is a modification is planned for this problem ?

    Because with ns, DomQuery is so amazing

    EDIT :

    I realized that selectValue didn't work, to correct edit ext-all-debug like this :

    Code:
    		re: /^@([\w-]+:?[\w-]+)/,
    //              re: /^@([\w-]+)/,
                    select: 'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'

  3. #3
    Ext User
    Join Date
    Jan 2009
    Location
    Russian
    Posts
    5
    Vote Rating
    0
    smails is on a distinguished road

      0  

    Default


    Thank you very much for the information at this time it works

  4. #4
    Ext User
    Join Date
    Jan 2009
    Location
    Russian
    Posts
    5
    Vote Rating
    0
    smails is on a distinguished road

      0  

    Default


    When using the modified class are not working class library ExtJS. But I created a class Ext.nsDomQueryYu in which the modification and use it for their needs. A class Ext.DomQuery using library classes.

  5. #5
    Ext User
    Join Date
    Jan 2009
    Posts
    7
    Vote Rating
    0
    velislav is on a distinguished road

      0  

    Default Changes failed

    Changes failed


    I'm trying to fulfill instructions. But

    Code:
    re: /^(?:([\[\{])(?:@)?([\w-:]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
    [\]\}])/,
    select: 'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'
    raises error in EXTJS.
    Would you post the whole source as attachment?

  6. #6
    Ext User
    Join Date
    Jan 2009
    Location
    Russian
    Posts
    5
    Vote Rating
    0
    smails is on a distinguished road

      0  

    Default


    Code:
    re: /^(?:([\[\{])(?:@)?([\w-:]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
    [\]\}])/,
    select: 'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'
    Syntax error. Try this:
    Code:
    re: /^(?:([\[\{])(?:@)?([\w-:]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
    select: 'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'
    But with these changes, the library ExtJS does not work. I created a
    separate class for working with namespaces. Full source file
    ext-all-debug.js as an attachment.
    Attached Files

  7. #7
    Sencha User
    Join Date
    Mar 2008
    Location
    France
    Posts
    56
    Vote Rating
    0
    Gordon25 is on a distinguished road

      0  

    Default


    I have the same problem, I downloaded your version of ext-all-debug.js and
    I put in my html file:

    Code:
    <script type="text/javascript" src="../../ext-all.js"></script>
    by

    Code:
    <script type="text/javascript" src="../../ext-all-debug.js"></script>
    but it does not

  8. #8
    Ext User
    Join Date
    Jan 2009
    Location
    Russian
    Posts
    5
    Vote Rating
    0
    smails is on a distinguished road

      0  

    Default


    Could you write more?

  9. #9
    Sencha User
    Join Date
    Mar 2008
    Location
    France
    Posts
    56
    Vote Rating
    0
    Gordon25 is on a distinguished road

      0  

    Default


    I make the changes as Hadrian, and when I use a feedviewer it does not work so I tested the solution smail.

    this solution does not work too, I know how to use it?

  10. #10
    Ext User
    Join Date
    Jan 2009
    Location
    Russian
    Posts
    5
    Vote Rating
    0
    smails is on a distinguished road

      0  

    Default


    Ext JS will not work with any version of files.

    But, you can use the class nsDomQuery for their own needs. For example query xpath.

    If you want to receive data from a server in the format of XML, which uses a namespace, you must convert the data from XML to any format and then use the transformed data in the widgets Ext JS.