[rfc-i] sourcecode preparation

paul.hoffman at vpnc.org (Paul Hoffman) Sat, 13 February 2016 20:58 UTC

From: paul.hoffman at vpnc.org (Paul Hoffman)
Date: Sat, 13 Feb 2016 12:58:18 -0800
Subject: [rfc-i] sourcecode preparation
In-Reply-To: <3E1AA856-580C-4F8D-84B1-30D2856C7EBF@cisco.com>
References: <3E1AA856-580C-4F8D-84B1-30D2856C7EBF@cisco.com>
Message-ID: <3CB362CD-0BF9-4FF6-8B72-08507760332A@vpnc.org>

On 12 Feb 2016, at 12:48, Joe Hildebrand (jhildebr) wrote:

> Say my input XML3RFCv3 doc has this:
>
> <sourcecode src="foo/bar.py"/>
>
> Is it reasonable that the preptool might output this?
>
> <sourcecode name="bar.py" type="python">
>
> code here
> </sourcecode>
>
> If so, we would need to following two preptool rules:
>
> - If a <sourcecode> element contains a src attribute, but not a name 
> attribute, copy the basename of the src attribute into the name 
> attribute
> - If a <sourcecode> element contains a src attribute, but not a type 
> attribute, and the preptool can tell what the type attribute should be 
> from the filename in the src attribute, the tool MAY insert the 
> correct type attribute.
>
> Thoughts?

This seems good, modulo PaulK's note that you need to check that a 
created "name" attribute value doesn't conflict with one already in the 
document.

--Paul Hoffman