Subject: [xml2rfc] Outdenting sourcecode

From: Carsten Bormann <[email-masked]>
Date: Thu, 22 Jul 2021 09:38:29 +0200

When I was younger, xml2rfc outdented artwork that was too wide, giving us a whopping three characters more horizontal space.

I still get messages that it does, and it sometimes actually does, but then there are cases where it doesn’t.

Before I go on a goose chase: What’s going on here?

(I use xml generated with kramdown-rfc 1.5.2 from https://github.com/ietf-rats-wg/basic-yang-module/blob/master/draft-ietf-rats-yang-tpm-charra.md
Yes, one can argue how wise it is to have artwork sources indented by four spaces and relying on xml2rfc to reduce its own indent by three so everything just fits, but that’s the way it used to work, and I don’t see how that broke.)

Grüße, Carsten

---

From: Kesara Rathnayake <[email-masked]>
Date: Fri, 23 Jul 2021 15:33:02 +1200

> I still get messages that it does, and it sometimes actually does, but then there are cases where it doesn’t.

Do you have an example where xml2rfc outdented artwork CDATA?

> Yes, one can argue how wise it is to have artwork sources indented by four spaces and relying on xml2rfc to reduce its own indent by three so everything just fits, but that’s the way it used to wor…

This could be down to how pretty_print in lxml prints CDATA because 
pretty_print_prep function in xml2rfc doesn't seem to be doing anything 
on CDATA.

   --Kesara
> 
> Grüße, Carsten
> 
> _______________________________________________
> xml2rfc mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/xml2rfc
> 

-- 
Kesara Rathnayake
Senior Software Development Engineer - IETF LLC
[email-masked]

---

From: Carsten Bormann <[email-masked]>
Date: Sun, 25 Jul 2021 20:03:16 +0200

> Do you have an example where xml2rfc outdented artwork CDATA?

As I said, it never outdents the artwork itself, but it does remove the additional indent of 3 characters.

(And it doesn’t make a difference whether the artwork is CDATA or #PCDATA.)

> This could be down to how pretty_print in lxml prints CDATA because pretty_print_prep function in xml2rfc doesn't seem to be doing anything on CDATA.

Again, this has nothing to do with CDATA and all with computing indents.
Normally, when xml2rfc outdents, you get a message, but not in all cases of the above file.

Grüße, Carsten