Subject: RE: String problem From: "Maltby, David G" <david.g.maltby@xxxxxxxx> Date: Wed, 08 Mar 2000 09:48:32 -0500 |
In my typically brute-force fashion, you can try this: [untested] (element INDEX-ENTRY (let ((term-list (match-split (attribute-string (normalize "term")) ";")) (let loop ((t-list term-list)) (cond ((null? t-list) (empty-sosofo) ) (else (sosofo-append (make element gi: "index-entry" (let ((name-value-list (match-split (car t-list) ":"))) (sosofo-append (make element gi: "indexprimary" (literal (car name-value-list)) ) (make element gi: "indexsub" (literal (cdr name-value-list)) )))) (loop (cdr t-list)))))))) definition for (match-split) found at http://www.mulberrytech.com/dsssl/dsssldoc/procedures/index.html This procedure should split the term attribute value into a list of name-value pairs (delimited by the ";") and then loop through the list creating a <index-entry> set for each pair. It then splits the name-value pair on the delimiter ":" and puts the first part in <indexprimary> and the second part in <indexsub>. It keeps going until it runs out of name-value pairs. Hopes this works, David > -----Original Message----- > From: Dudley, Mark [mailto:Mark.Dudley@xxxxxxxxxxxxx] > Sent: Wednesday, March 08, 2000 8:32 AM > To: dssslist@xxxxxxxxxxxxxxxx > Subject: String problem > > > Hello, > > I have a problem and would sincerely appreciate some input. I > am conducting > an SGML to SGML transformation and have run across a bit of a > problem. I > have SGML that looks like this: > > <index-entry term = "No Content documents:description; Content: no > description"> > > and need it to look like this: > > <index-entry> > <indexprimary>No Content documents</indexprimary> > <indexsub>description</indexsub> > </index-entry> > <index-entry> > <indexprimary>Content</indexprimary> > <indexsub>no description</indexsub> > </index-entry> > > I was able to do this in XSL but that is not helpful to me as > I need valid > SGML out of the transformation process. Any help/direction > would be great. > Thanks. > > Mark Dudley > mark.dudley@xxxxxxxxxxxxx > > > DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
String problem, Dudley, Mark | Thread | RE: String problem, Dudley, Mark |
String problem, Dudley, Mark | Date | RE: String problem, Dudley, Mark |
Month |