← Back to team overview

yade-users team mailing list archive

Re: more XML editing

 

A slight correction:
 
> Yade requires some more massaging of xsltproc
> output.
> First the bodies need to be recounted and reindexed,
> my awk script:
> 
> BEGIN{i=0}
> $0 ~ /_className_="Body"/ {i++;
> sub(/id=\"[[:digit:]]*\"/,"id=\""i"\"");}

This line should read instead

$0 ~ /_className_="Body"/
{sub(/id=\"[[:digit:]]*\"/,"id=\""i"\"");i++}

so that the first id is 0 not 1.

> $0 ~ /<body size=/ {bs = NR}
> {ln[NR]= $0}
> END {
> ln[bs] = "<body size=\""i"\">"
> for (l = 1; l <= FNR; l++) print ln[l]
> }
 

_______________________________________________
Yade-users mailing list
Yade-users@xxxxxxxxxxxxxxxx
http://lists.berlios.de/mailman/listinfo/yade-users



References