Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: dynamic database processing

From: =?ISO-8859-1?Q?J=FCrgen_Kahrs?= <Juergen.KahrsDELETETHIS@------.-->
To: NULL
Date: 9/5/2004 2:31:00 PM
Thomas Mann wrote:

> I have a xml-database with a changing amount of elements <A>. How do I write
> a XSLT-Script to find out how many elements <A> are inside the database in
> order to write them to an output file ?

This problem is so simple that you don't need
XSLT for it. Here is a script in xmlgawk (tested):

BEGIN                { XMLMODE=1                   }

XMLSTARTELEM  == "A" { inA=1; count ++             }
XMLENDELEM    == "A" { inA=0                       }

XMLCHARDATA   && inA { print "element:", $0        }

END       { print "There are", count, "elements A" }

The script counts elements "A" and prints each of
them to standard output.

> example:
> 
> <A> P0 </A>
> <A> P1 </A>
> ...
> <A> Pn </A>

The result for this example is:

element:  P0 
element:  P1 
element:  Pn 
There are 3 elements A


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent