Re: Ambiguity in default output for publish_string

Georg Brandl <[email protected]>
Newsgroups gmane.comp.python.documentation
Message-ID <[email protected]>
Jeffrey C. Jacobs schrieb:

> However, when publish_string is called to output the tree for both of
> these expressions, they both return:
> 
> <document source="<string>">
>     <paragraph>
>         This paragraph has a very funny 
>         <strong>
>             indent
>             after that word, right?
> 
> which is not different.  As far as I can tell, the internal node structure
> is correct, it's just when the node structure is displayed in string form,
> the default function of publish_string.  Since this output is a
> serialization of the node structure, it seems that the output to
> publish_string should not be ambiguous in terms of what it truly
> represents.  Or, is there a better way to represent the internal doc tree
> unambiguously as a string?

What you see there is the "pseudo-XML" output format, which is nice for a
quick view but not unambiguous.

Try publish_string(..., writer_name='xml') for real XML output which is
unambiguous in all cases.

Georg

_______________________________________________
Doc-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/doc-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.