|
Subject: Re: Problems with attributes. From: Reyes <reyes.garcia@xxxxxxxxxx> Date: Wed, 20 Oct 1999 11:08:29 +0200 |
Hello Brandon
First to say that the current-old version didn't work because I have a
SGML like this:
<!doctype INSTAND SYSTEM "Little.DTD">
<INSTAND>
<IB-ABBAU>
<ABBAUGEN>
<INFOTYPE-ADDR>Abbau</INFOTYPE-ADDR>
</ABBAUGEN>
<ABBAU>
<ARBGRP-AB>
<BESCHEIN-AB>
<ARBSCHR-AB>
<ARBTXT>bla bla bla.</ARBTXT>
</ARBSCHR-AB>
<ARBSCHR-AB>
<ARBTXT>platte abnehmen.</ARBTXT>
</ARBSCHR-AB>
</BESCHEIN-AB>
<BESCHEIN-AB>
<ARBSCHR-AB>
<ARBTXT>Dichtringe aus den Nuten des herausnehmen</ARBTXT>
<WERK>
<ANZ>rrr</ANZ>
<SONW ANKER="#1">
<BENENNUNG>Ölablaßstutzen</BENENNUNG>
<TEILKENN>
<TKZ-RENK>5583160</TKZ-RENK>
</TEILKENN>
</SONW>
</WERK>
<WERK>
<ANZ>rrrCOPIA</ANZ>
<SONW ANKER="#1COPIA">
<BENENNUNG>ÖlablaßstutzenCOPIA</BENENNUNG>
<TEILKENN>
<TKZ-RENK>5583160COPIA</TKZ-RENK>
</TEILKENN>
</SONW>
</WERK>
<WERK>
<ANZ>rrr</ANZ>
<SONW ANKER="#1">
<BENENNUNG>Ölablaßstutzen</BENENNUNG>
<TEILKENN>
<TKZ-RENK>5583160</TKZ-RENK>
</TEILKENN>
</SONW>
</WERK>
<WERK>
<ANZ>rrrNUEVO</ANZ>
<WERKZEUG ANKER="#1NUEVO">
<BENENNUNG>Ölablaßstutzen</BENENNUNG>
</WERKZEUG>
</WERK>
</ARBSCHR-AB>
</BESCHEIN-AB>
<BESCHEIN-AB>
. . .
. . .
And Jade writes the first and the third WERK [ both have the same ANKER ].
By another hand, you are in the good way, this if with unique [ (if
(node-list-empty? (unique (node-list-first nl) son att)) ] isn't necesary.
I have change the procedure, the new is:
(define (unique-son node tag son att)
(let loop ((result (empty-node-list))
(nl (select-elements (descendants node) tag)) (list-att '()))
(if (node-list-empty? nl) result
(let son-loop ((son-result result)
(son-nl (select-elements
(descendants (node-list-first nl)) son))
(son-list-att list-att))
(if (node-list-empty? son-nl)
(loop son-result (node-list-rest nl) son-list-att)
(if (member (attribute-string att
(node-list-first son-nl)) son-list-att)
(son-loop son-result (node-list-rest son-nl)
son-list-att)
(son-loop (node-list son-result (node-list-first nl))
(node-list-rest son-nl)
(list son-list-att (attribute-string att
(node-list-first
son-nl))))))))))
, but the problem is the same.
Another thing is that when I changed:
(list son-list-att (attribute-string att
(node-list-first
son-nl))))))))))
for
(cons son-list-att (attribute-string att
(node-list-first
son-nl))))))))))
with or without reverse give me a error:
Jade:c:\StarDsssl\Renk-Jade\Little.dsl:40:8:E: 2nd argument for primitive
"member" of wrong type: "(() . "#1")" not a list
I'm sorry, I don't know what can I do. I have make a procedure similar [
unique ] but this looks only the attribute form WERK [ or the principal tag ].
This procedure is the next and works good :
(define (unique node tag att)
(let loop ((result (empty-node-list))
(nl (select-elements (descendants node) tag)) (list-att '()))
(if (node-list-empty? nl) result
(if (member (attribute-string att (node-list-first nl)) list-att)
(loop result (node-list-rest nl) list-att)
(loop (node-list result (node-list-first nl))
(node-list-rest nl)
(list list-att (attribute-string att
(node-list-first nl))))))))
Thanks and I hope "not to damage your head".
Regards,
Reyes
DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: Problems with attributes., Brandon Ibach | Thread | Re: Problems with attributes., Brandon Ibach |
| RE: sgml-parse, Pieter Rijken | Date | Re: Problems with attributes., Reyes |
| Month |