From oinos@gmx.es Mon Jul 19 16:27:22 2021 From: Pablo Rodriguez To: ntg-context@ntg.nl Subject: [NTG-context] \xmlrefatt as node? Date: Mon, 19 Jul 2021 16:27:19 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5354980593419432605==" --===============5354980593419432605== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Dear list, I have the following sample: \startbuffer[test] \stopbuffer \startxmlsetups xml:testsetups \xmlsetsetup{#1}{*}{-} \xmlsetsetup{#1}{document|div|p|a}{xml:flushing} \xmlsetsetup{#1}{a}{xml:*} \stopxmlsetups \xmlregistersetup{xml:testsetups} \startxmlsetups xml:flushing \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:a \xmlattribute{#1}{ancestor::div[@class='section level1 hidden']}{id}\\ \xmlrefatt{#1}{href}:\ \doifelse {\xmlrefatt{#1}{href}} {\xmlattribute{#1}{ancestor::div[@class='section level1 hidden']}{id}} {yes}{no}\blank \stopxmlsetups \starttext \xmlprocessbuffer{main}{test}{} \stoptext I need to check whether the link is inside the same div or not. I know how to obtain the destination identifier (\xmlreffatt{#1}{href} and I know how to obtain the identifier of the contaning div (\xmlattribute{#1}{ancestor::div[@class='section level1 hidden']}{id}}). But I don’t know how to ge the identifier of the div which contains the destination idetifier. How could I get that? Many thanks for your help, Pablo -- http://www.ousia.tk --===============5354980593419432605==--