ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* desperate for xmlstrip
@ 2010-03-15 15:15 Hans van der Meer
  0 siblings, 0 replies; only message in thread
From: Hans van der Meer @ 2010-03-15 15:15 UTC (permalink / raw)
  To: NTG ConTeXt

[-- 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-15 15:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-15 15:15 desperate for xmlstrip Hans van der Meer

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).