Skip to content

Commit

Permalink
More adjustments in view of comments to usnistgov#452
Browse files Browse the repository at this point in the history
  • Loading branch information
wendellpiez committed Sep 17, 2019
1 parent 51e17f0 commit fe83db2
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
12 changes: 7 additions & 5 deletions build/metaschema/json/md-oscal-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,10 @@
<!-- next, explicit escape sequences -->
<replace match="\\&#34;">&amp;quot;</replace>
<replace match="\\&#39;">&amp;apos;</replace>
<replace match="\\\*" >&amp;#2A;</replace>
<replace match="\\`" >&amp;#60;</replace>
<replace match="\\~" >&amp;#7E;</replace>
<replace match="\\^" >&amp;#5E;</replace>
<replace match="\\\*" >&amp;#x2A;</replace>
<replace match="\\`" >&amp;#x60;</replace>
<replace match="\\~" >&amp;#x7E;</replace>
<replace match="\\^" >&amp;#x5E;</replace>

<!-- then, replacements based on $tag-specification -->
<xsl:for-each select="$tag-specification/*">
Expand Down Expand Up @@ -462,7 +462,9 @@
<xsl:variable name="examples" xml:space="preserve">
<p>**Markdown** and even " quoted text" and **more markdown**</p>
<p>


Just a plain old \* star, and another \* ...

See the FedRAMP Documents page under Key Cloud Service Provider (CSP) Documents, Plan of Action &amp; Milestones (POA&amp;M) Template Completion Guide [https://www.fedramp.gov/documents/](https://www.fedramp.gov/documents/)

Paragraph, \n\nand new paragraph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<!-- Pass $diagnostic as 'rough' for first pass, 'rectified' for second pass -->
<xsl:param name="diagnostic" as="xs:string">no</xsl:param>
<xsl:template match="text()" mode="md #default">
<xsl:value-of select="."/>
<xsl:value-of select="replace(., '([`~\^\*''&#34;])', '\\$1')"/>
</xsl:template>
<xsl:variable name="write-options" as="map(*)" expand-text="true">
<xsl:map>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<examples xmlns="http://csrc.nist.gov/ns/metaschema/unit-test/datatypes-dateTime">
<charstring>Here's a string including punctuation ' " \ . $</charstring>
<charstring>Here's a string with an ampersand &amp;</charstring>
<charstring>Here\'s a string including punctuation \' \" \ . $</charstring>
<charstring>Here\'s a string with an ampersand &amp;</charstring>
<charstring>Less-than and greater-than, as &lt;delimiters&gt; ...</charstring>
<charstring>The star aka asterisk * may be magical and maybe also the tick `</charstring>
<charstring>The star aka asterisk \* may be magical and maybe also the tick \`</charstring>
<markupline>Also, occasionally we have <a href="w3.org">links</a> and <em>other markup</em>.</markupline>
<markupline>And *sometimes*, we have \*very confusing stuff\* as well.</markupline>
</examples>
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

{ "examples" :
{ "character-strings" :
[ "Here's a string including punctuation ' \" \\ . $",
"Here's a string with an ampersand &",
[ "Here\\'s a string including punctuation \\' \\\" \\ . $",
"Here\\'s a string with an ampersand &",
"Less-than and greater-than, as <delimiters> ...",
"The star aka asterisk * may be magical and maybe also the tick `" ],
"markup-lines" : "Also, occasionally we have [links](w3.org) and *other markup*." } }
"The star aka asterisk \\* may be magical and maybe also the tick \\`" ],
"markup-lines" :
[ "Also, occasionally we have [links](w3.org) and *other markup*.",
"And *sometimes*, we have \\*very confusing stuff\\* as well." ] } }
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
<charstring>Here's a string with an ampersand &amp;</charstring>
<charstring>Less-than and greater-than, as &lt;delimiters> ...</charstring>
<charstring>The star aka asterisk * may be magical and maybe also the tick `</charstring>
<markupline>Also, occasionally we have <a href="w3.org">links</a> and <em>other markup</em>.</markupline>
<markupline>Also, occasionally we have <a href="w3.org">links</a> and <em>other markup</em>.</markupline>
<markupline>And <em>sometimes</em>, we have *very confusing stuff* as well.</markupline>
</examples>
12 changes: 7 additions & 5 deletions build/metaschema/xml/produce-xml-converter.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
<xsl:text>&#xA;</xsl:text>

<XSLT:character-map name="delimiters">
<!--<XSLT:output-character character="&lt;" string="\u003c"/>
<XSLT:output-character character="&gt;" string="\u003e"/>-->
<!-- Rewrites Unicode PUA char E0000 to reverse solidus -->
<!--<XSLT:output-character character="&#xE0000;" string="\"/>-->
</XSLT:character-map>

<XSLT:param name="json-indent" as="xs:string">no</XSLT:param>
Expand All @@ -65,9 +65,11 @@
-->
<XSLT:template match="text()" mode="md #default">
<!-- Escapes go here -->
<!--<XSLT:value-of select="replace(.,'\s+',' ') ! replace(.,'([`~\^\*])','\\$1')"/>-->
<!--<XSLT:value-of select="replace(., '([`~\^\*''&quot;])', '\\$1')"/>-->
<XSLT:value-of select="."/>
<!-- prefixes ` ~ ^ * with char E0000 from Unicode PUA -->
<!--<XSLT:value-of select="replace(., '([`~\^\*''&quot;])', '&#xE0000;$1')"/>-->
<!-- prefixes ` ~ ^ * ' " with backward solidus -->
<XSLT:value-of select="replace(., '([`~\^\*&quot;])', '\\$1')"/>
<!--<XSLT:value-of select="."/>-->
</XSLT:template>

<XSLT:variable name="write-options" as="map(*)" expand-text="true">
Expand Down

0 comments on commit fe83db2

Please sign in to comment.