Zyrano: xpath ausdruck für processing-instructions

Hi,
das hier hat nicht unbedingt was mit xsl zu tun, aber ich trage trotzdem mal mein problem vor:

<?xml version="1.0" encoding="iso-8859-1"?>  
<europa>  
    <land>  
       <?id x12123?>  
      <name>Deutschland</name>  
    </land>  
</europa>  

ich möchte gerne mit einem xpath-ausdruck den knoten mit der id bestimmen, bis jetzt habe ich es wie folgt versucht. bin aber noch nicht zu einem ergebnis gekommen:

"/europa/land/*[processing-instruction(id x12123)]"

habt ihr evtl noch eine Idee?

vielen dank

  1. Hello,

    "/europa/land/*[processing-instruction(id x12123)]"

    wie mir das W3C verrät würde ich es versuchen wie mit Textknoten: processing-instruction(). Die Rückgabe ist sodann das gesuchte "id x12123"

    MfG
    Rouven

    --
    -------------------
    sh:| fo:} ch:? rl:( br:& n4:{ ie:| mo:} va:) js:| de:] zu:| fl:( ss:) ls:& (SelfCode)
    Ambition is the last refuge of failure.  --  Oscar Wilde (Irish Poet, Novelist, Dramatist and Critic, 1854-1900)
    1. Hi, danke schonmal für deine schnelle antwort,ich hab es jetzt so versucht, kam aber nicht wesentlich weiter. wie würde wohl der ausdruck dafür lauten?

      "/europa/land/*[processing-instruction()='id x12123']"

      danke

      1. Hello,

        kam aber nicht wesentlich weiter.

        mach es in kleinen Schritten, schau dir doch erstmal an, was wo rauskommt...

        "/europa/land/*[processing-instruction()='id x12123']"

        ich glaube du bist in der Ebene verrutscht: du suchst das Land, das die Processing Instruction hat, und davon alles, also:
        /europa/land[processing-instruction()='id x12123']/*
        nur geraten...

        MfG
        Rouven

        --
        -------------------
        sh:| fo:} ch:? rl:( br:& n4:{ ie:| mo:} va:) js:| de:] zu:| fl:( ss:) ls:& (SelfCode)
        Inter Arma Enim Silent Leges  --  Cicero
        1. Super, hat prima funktioniert nur eine Kleinigkeit musste ich noch ändern.

          Für alle die es interessiert, der Aufruf war wie folgt:

            
          /europa/land[processing-instruction()='x12123']/*
          

          eben ohne das 'id'

          Besten Dank

  2. Hallo Zyrano,

    ich möchte gerne mit einem xpath-ausdruck den knoten mit der id bestimmen, bis jetzt habe ich es wie folgt versucht. bin aber noch nicht zu einem ergebnis gekommen:

    "/europa/land/*[processing-instruction(id x12123)]"

    habt ihr evtl noch eine Idee?

    /europa/land[processing-instruction('id')='x12123']

    bzw. für den Landnamen:

    /europa/land[processing-instruction('id')='x12123']/name

    Grüße,
    Thomas

  3. Hallo,

    das hier hat nicht unbedingt was mit xsl zu tun, aber ich trage trotzdem mal mein problem vor:

    <?xml version="1.0" encoding="iso-8859-1"?>

    <europa>
        <land>
           <?id x12123?>
          <name>Deutschland</name>
        </land>
    </europa>

    
    >   
    > ich möchte gerne mit einem xpath-ausdruck den knoten mit der id bestimmen,  
      
      
    "europa/land/processing-instruction('id')" liefert "x12123" als Ergebnis  
      
    Grüße  
    Thomas