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: desperate for xmlstrip
Date: Mon, 15 Mar 2010 16:15:31 +0100	[thread overview]
Message-ID: <7F8E748C-3847-4D33-AEEE-858874E9B8EB@uva.nl> (raw)

[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]

I really need to remove the leading and trailing whitespace from nodes.
Tried in vain to get \xmlstrip (and friends like \xmlstripnolines)  
working.
Just doing \xmlstripped{node}{lpath} is not adequate, because I want  
to order the output when a node contains several subnodes (using  
\xmlfilter for this).
Below a minimal example. Tweaking the \xmlstrip in all sorts of way  
did not help.

Hans van der Meer

\startxmlsetups xml:testsetups
	\xmlsetsetup{test}{test|a|b|c}{xml:*}
\stopxmlsetups
\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:test
	\xmlstrip{#1}{}
	\xmltext{#1}{} No spaces should showup between nodes!
\stopxmlsetups

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

\startxmlsetups xml:b
	\xmltext{#1}{}
\stopxmlsetups

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

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

Input xml-file:
<?xml version="1.0" encoding="UTF-8"?>
<test>
	<a>
		This is node a:
		<b>
			:Node b:
		</b>
		<c>
			:Node c:
		</c>
	</a>
</test>

The result:

[-- Attachment #2: test.pdf --]
[-- Type: application/pdf, Size: 8480 bytes --]

[-- Attachment #3: Type: text/plain, Size: 5 bytes --]







[-- Attachment #4: 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-15 15:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=7F8E748C-3847-4D33-AEEE-858874E9B8EB@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).