pretty printer and PCDATA (summary)

Subject: pretty printer and PCDATA (summary)
From: Jany Quintard <quintard.j@xxxxxx>
Date: Wed, 8 Sep 1999 15:12:10 +0200 (MEST)
Thanks to all who have helped to find a solution.
I wanted to summarize the answers. Here is the result :

The question :
> I use data to retrieve the content of an
> element nmlist, which appears so:
>         <nameloc ID="entity5_lpublish">
>           <nmlist nametype="entity">entity5
>           </nmlist>
>         </nameloc>

> I get this:
> jade:/xo/vpp/sgml/stylesheet-dev/tmp.dsl:182:29:I: debug ""entity5

>           ""
> By the way, according to the definition of nmlist:
> <!ELEMENT  nmlist           (#PCDATA)* >
> this is not completely awkward.

> So, the question : is it allowed to pretty-print such an element ?
> Does anyone know of a solution or a workaround ?

Stephane Bortzmeyer <bortzmeyer@xxxxxxxxxx>
> It *seems* you were bitten by the infamous "Significant white-space in
> XML"   problem, in its "Valid white-space in PCDATA" variant.

> The spaces before the end-tag and the end-of-line after "entity5" are
> legal PCDATA and even Jade, which knowns your DTD, cannot find there are 
> semantically insignificant.

> - type '<nmlist nametype="entity">entity5</nmlist>'

This seems a very correct answer. And the more I think to it, I don't find
a reason that allow me to *modify* the content of an element containing
PCDATA by pretty-printing it.

Frank A. Christoph" <christo@xxxxxxxxxxxxxxxxxx>
> In DSSSL you would use process-children-trim in place of
> process-children when processing the parent of nmlist. 

Yes, but I don't process it using the recursive way (process-children),
but by climbing back the tree. 
BTW, how would the process-children-trim react on the end of line
characters ?

Pieter Rijken <pieter.rijken@xxxxxx> :

> The (i think) easiest solution is to define in your dtd:

> <!ELEMENT nmlist - - (#PCDATA)>      (NOT (#PCDATA)* !!)
> <!ATTLIST nmlist ...>

Well, I should modify the DTD, and I am not really the "baas" in this
matter. I will make some tests anyway, to feel the differences in
utilization.

Didier, do you believe this could be of some use to illustrate 
what Stephane called  the :
   infamous "Significant white-space in XML" problem, 
   in its "Valid white-space in PCDATA" variant
 ? 

Anyway, thanks to all.
JAny.


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


Current Thread