ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Bernd Militzer <bernd@militzer.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: xml problem
Date: Mon, 16 Apr 2007 17:29:35 +0200	[thread overview]
Message-ID: <4623965F.4030109@militzer.net> (raw)

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

Hi Hans,

first thanks for your help at Epen, but reading the different documents 
I could not find out how to define a macro to get the value of a 
specific element of an xml-file.
Running your example I get all elements.

For example:
I wont to get the value of the first name for <person pid="66">

\def\getFirstName#1{{\enableXML\getvalue{person:#1}}} % what is  here to 
change?

Thanks for help again

Bernd

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Data.xml --]
[-- Type: text/xml; x-mac-type="0"; x-mac-creator="0"; name="Data.xml", Size: 4683 bytes --]

<?xml version="1.0"?>

<start> 
	<ref name="persons"/> 
</start> 

<define name="persons"> 
	<element name="persons"> 
		<zeroOrMore> 
			<choice> 
			<ref name="persons.person"/> 
			</choice> 
		</zeroOrMore> 
	</element> 
</define> 


<define name="persons.person"> 
	<element name="person"> 
		<interleave> 
			<optional> <ref name="person.Fam"/> </optional> 
			<optional> <ref name="person.Nam"/> </optional> 
			<optional> <ref name="person.Vor"/> </optional> 
			<optional> <ref name="person.Ruf"/> </optional> 
			<optional> <ref name="person.Geb"/> </optional> 
			<optional> <ref name="person.GebOrt"/> </optional> 
			<optional> <ref name="person.GebZeit"/> </optional>
			<optional> <ref name="person.Tau"/> </optional> 
			<optional> <ref name="person.TauOrt"/> </optional> 
			<optional> <ref name="person.Konf"/> </optional>
			<optional> <ref name="person.Pate1"/> </optional>  
			<optional> <ref name="person.Pate2"/> </optional>  
			<optional> <ref name="person.Pate3"/> </optional>  
			<optional> <ref name="person.Pate4"/> </optional> 
			<optional> <ref name="person.Konfi"/> </optional> 
			<optional> <ref name="person.KonfiOrt"/> </optional>
			<optional> <ref name="person.Kommu"/> </optional> 
			<optional> <ref name="person.KommuOrt"/> </optional>
			<optional> <ref name="person.Hei"/> </optional> 
			<optional> <ref name="person.HeiOrt"/> </optional> 
			<optional> <ref name="person.Amt"/> </optional> 
			<optional> <ref name="person.AmtOrt"/> </optional>
			<optional> <ref name="person.Partner"/> </optional>
			<optional> <ref name="person.Tod"/> </optional> 
			<optional> <ref name="person.TodOrt"/> </optional> 
			<optional> <ref name="person.TodZeit"/> </optional> 
			<optional> <ref name="person.Alter"/> </optional> 
			<optional> <ref name="person.Urs"/> </optional>
			<optional> <ref name="person.Grab"/> </optional> 
			<optional> <ref name="person.GrabOrt"/> </optional> 
			<optional> <ref name="person.Ber"/> </optional> 
			<optional> <ref name="person.Zus"/> </optional> 
			<optional> <ref name="person.GeschwZahl"/> </optional> 
			<optional> <ref name="person.Geschw1"/> </optional> 
			<optional> <ref name="person.Geschw2"/> </optional> 
			<optional> <ref name="person.Geschw3"/> </optional> 
			<optional> <ref name="person.KinderZahl"/> </optional> 
			<optional> <ref name="person.Kind1"/> </optional> 
			<optional> <ref name="person.Kind2"/> </optional> 
			<optional> <ref name="person.Kind3"/> </optional> 
			<optional> <ref name="person.Kind4"/> </optional> 
			<optional> <ref name="person.Vater"/> </optional> 
			<optional> <ref name="person.Mutter"/> </optional>
			<optional> <ref name="person.UGebKi"/> </optional> 
			<optional> <ref name="person.UGebAmt"/> </optional> 
			<optional> <ref name="person.UTaufe"/> </optional> 
			<optional> <ref name="person.UKonfi"/> </optional> 
			<optional> <ref name="person.UHeiKi"/> </optional> 
			<optional> <ref name="person.UHeiAmt"/> </optional> 
			<optional> <ref name="person.UTodKi"/> </optional> 
			<optional> <ref name="person.UtodAmt"/> </optional> 
		</interleave> 
		<attribute name="pid"/> 
	</element> 
</define> 


  <define name="person.Fam">
    <element name="Familienname">
      <text/>
    </element>
  </define>



<persons>
	<person pid="1a"> 
		<Fam>Militzer</Fam> 
		<Vor>Kai Uwe</Vor> 
		<Ruf>Kai</Ruf>
		<Geb>21. August 1980</Geb>
		<GebOrt>Krefeld</GebOrt>
		<Vater>2</Vater>
		<Mutter>3</Mutter>
	</person> 

	<person pid="1c"> 
		<Fam>Militzer</Fam> 
		<Vor>Jan Erik</Vor> 
		<Ruf>Jan</Ruf>
		<Geb>3. September 1981</Geb>
		<GebOrt>Krefeld</GebOrt>
		<Vater>2</Vater>
		<Mutter>3</Mutter>
	</person> 

	<person pid="66"> 
		<Fam>Militzer</Fam> 
		<Vor>Johann Christoph Erdmann</Vor> 
		<Ruf>Johann</Ruf>
		<Geb>27. August 1797</Geb>
		<GebOrt>Unterkoskau</GebOrt>
		<Vater>132</Vater>
		<Mutter>133</Mutter>
	</person> 
	
	<person pid="67"> 
		<Fam>Rudolph</Fam> 
		<Vor>Johanne Christiane Friedericke</Vor> 
		<Ruf>Johanne</Ruf>
		<Geb>21. Juli 1804</Geb>
		<GebOrt>Oberkoskau Obermühle</GebOrt>
		<Vater>134</Vater>
		<Mutter>135</Mutter>
	</person> 

	
	<person pid="2112"> 
		<Fam>Militzer</Fam> 
		<Vor>Adam</Vor> 
		<Ruf>Adam</Ruf>
		<Tau>16. November 1670</Tau>
		<GebOrt>Unterkoskau</GebOrt>
		<Vater>4224</Vater>
		<Mutter>4225</Mutter>
	</person> 
	
	<person pid="4224"> 
		<Fam>Militzer</Fam> 
		<Vor>Johannes</Vor> 
		<Ruf>Hans</Ruf>
		<Tau>4. Januar 1630</Tau>
		<GebOrt>Unterkoskau</GebOrt>
		<Vater>8448</Vater>
		<Mutter>8449</Mutter>
	</person> 



</persons>



[-- Attachment #3: getData.tex --]
[-- Type: application/x-tex, Size: 720 bytes --]

[-- Attachment #4: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

                 reply	other threads:[~2007-04-16 15:29 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=4623965F.4030109@militzer.net \
    --to=bernd@militzer.net \
    --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).