#3 .//*[@name = following::*/@name]

closed-invalid
nobody
None
5
2005-01-11
2005-01-11
No

I expect that the code

[code]
(define tree
'(dummy (@ ((name "www")))
(dummy (@ ((name "aaa"))))
(dummy (@ ((name "zzz")))
(dummy (@ ((name "aaa")))))))
(write ((txpath ".//*[@name = following::*/@name]") tree))
(newline)
[/code]

should produce the result

[expected]
(dummy (@ ((name "aaa"))))
[/expected]

Actually. I've got

[result]
()
[/result]

--------------------------------

Plain XML/XLST solution gives what I want:

$ cat test.xml
<?xml version="1.0"?>
<dummy name="www">
<dummy name="aaa"/>
<dummy name="zzz">
<dummy name="aaa"/>
</dummy>
</dummy>

$ cat test.xsl
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:template match="/">
<x>
<xsl:copy-of select=".//*[@name =
following::*/@name]"/>
</x>
</xsl:template>

</xsl:stylesheet>

$ xsltproc test.xsl test.xml
<?xml version="1.0"?>
<x><dummy name="aaa"/></x>

Discussion

  • Oleg Paraschenko

    • status: open --> closed-invalid
     
  • Oleg Paraschenko

    Logged In: YES
    user_id=534833

    I'm very sorry. It's a first day after long holidays. The
    right SXML, obviously is:

    (define tree
    '(dummy (@ (name "www"))
    (dummy (@ (name "aaa")))
    (dummy (@ (name "zzz"))
    (dummy (@ (name "aaa"))))))

    And all works.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks