Re: Problem with SGML to SGML Conversion

Subject: Re: Problem with SGML to SGML Conversion
From: Jany Quintard <quintard.j@xxxxxx>
Date: Fri, 21 Jan 2000 10:51:44 +0100 (CET)
On Fri, 21 Jan 2000, Roland Schopf wrote:
> Hi all,
> 
> I'm trying to extract the content of an element of a tablecell and insert
> the value as an attribute of the whole row
> (normally only one <number> exits per row):
>        <table>
>        <row rowsep="1" colsep="0">
> 	<entry>xxxx</entry>

> 	into:
> 	<table>
>        <row rowsep="1" colsep="0" number="1234">
> 	<entry>xxxx</entry>
> 	</row>
> .../... 
> 	Using the following dsssl script, I receive the error:
> 	invalid value for "attributes" characteristic
> 	I also tried (parent(parent(current-node)), 
> 
> 
> (element row
>   (let ((nl_versorgungsnummern
>           (select-elements
>             (descendants (current-node)) "number")))
> 
> (mode m_number
>   (default 
>     (make empty-element
>           gi: "ROW" 
>   attributes: (list (list "NUMBER" (data(current-node)))
>                     (list "ROWSEP"
>                           (attribute-string "ROWSEP"
>                           (ancestor "ROW" (current-node))))
>                     (list "ROWSEP"
>                           (attribute-string "ROWSEP"
>                           (ancestor "ROW" (current-node))))
>  )
>)
> .../...
 
Roland,
Just to be sure : Am I right by assuming that nl-versorgungsnummern und 
nl-number are the same and that the difference is a typo ?

It seems that attribute-string doesnt return the value you need.
First, you can try to know what is really returned by using (debug ), like
this :
(debug (list "ROWSEP" ..... )

The debug doesn't modify the result. It returns its argument.
I guess the second member of the list will be #f (false).
The reason for this could be in your SGML declaration (NAMECASE), so that
jade (or SP) can't match lower and upper case attributes
(<row rowsep="1" colsep="0"> and ROWSEP COLSEP). And the same for
functions which use the gi of an element :
(ancestor "ROW" (current-node)) can't find <row rowsep="1" colsep="0">

This is the case if your input file is an XML one.

The best way is to use the same case in style sheet than in data file.
Yo can use the fonction (normalize string) (see in Norman Walsh docbook
stylesheet)

It seems that ROWSEP is added twice in your ROW output element ?

Hope it helps.

------------------------------------------------------
Jany Quintard             | Et les enfants de choeur
IBM Paris Laboratory      | Branlant du chef, opinent
Tel : 33 (0)2 51 16 40 36 |   G. Brassens (La religieuse)




 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread