ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans van der Meer <H.vanderMeer@uva.nl>
To: NTG ConTeXt <ntg-context@ntg.nl>
Subject: do not understand \xmlindex
Date: Sun, 14 Mar 2010 22:53:26 +0100	[thread overview]
Message-ID: <82E06E33-9DB6-4CC7-B109-23D65A0B7DCE@uva.nl> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 873 bytes --]

I do not understand the behaviour of \xmlindex in the code below. The  
goal is to extract the contents of node <abc>-number 1. The strange  
things is that \xmltext returns the contents of both the <abc> nodes,  
but \xmlindex returns nothing.
The returns of the \writestatus calls:
 >>1>> ab-2        : ::
 >>2>> ab-2        : :ABC-1ABC-2:


\startxmlsetups xml:testsetups
	\xmlsetsetup{test}{test|ab|abc}{xml:*}
\stopxmlsetups
\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:test
	\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:ab
	\writestatus{>>1>> \xmltag{#1}-\xmlcount{#1}{/abc}}{:\xmlindex{#1}{/ 
abc}{1}:}
	\writestatus{>>2>> \xmltag{#1}-\xmlcount{#1}{/abc}}{:\xmltext{#1}{/ 
abc}:}
\stopxmlsetups

\starttext
\xmlprocessfile{test}{test.xml}{}
\stoptext

Input is:
<test>
	<ab>
		<abc>ABC-1</abc>
		<abc>ABC-2</abc>
	</ab>
</test>

Hans van der Meer





[-- Attachment #1.2: Type: text/html, Size: 2644 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

             reply	other threads:[~2010-03-14 21:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-14 21:53 Hans van der Meer [this message]
2010-03-14 22:01 ` alignment explanation Mehdi Omidali
2010-03-14 22:51   ` Aditya Mahajan
2010-03-15  8:32     ` Mehdi Omidali
2010-03-15 16:40       ` Aditya Mahajan
2010-03-15 17:50         ` Mehdi Omidali
2010-03-15 19:29           ` Aditya Mahajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=82E06E33-9DB6-4CC7-B109-23D65A0B7DCE@uva.nl \
    --to=h.vandermeer@uva.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).