Skip to main content
Update in response to comments.
Source Link
Martin Maat
  • 18.7k
  • 3
  • 33
  • 59

CDATA sections in XML should do.

Here's a stackoverflow post about it: https://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean

I remember it took me a while to understand how to use them. A DOM parser has a dedicated instruction for creating a CDATA section but there is no equivalent statement for reading them. Reading is transparent, you just read the contents of the element that has the CDATA section in it to have the literal text returned.

Here's an example taken from the input data file of a code scrutinizer I once made. It allows the definition of the forms of problematic code fragments using regular expressions.

<IssueBuster type="Basic" name="Suspicious lambdas" skip="true">
    <Description>
        <!-- See https://stackoverflow.com/questions/2465040/using-lambda-expressions-for-event-handlers -->
        A lambda expression is used for event handlers which inhibits unsubscribing.
    </Description>
    <Regex><![CDATA[\+\=\s*\([^\s\,]+\,\s*[^\s\)]+\)\s*=>]]></Regex>
    <SkipFileNames>
        <!-- If any of these inner texts appears in a file path, this buster will ignore that file. -->
        <FileName>SMMdataComponent\DeltaPlusGenerator\TestForm.cs</FileName>
        <FileName>Toolchain\Validate-TranslationEnums</FileName>
        <FileName>Tools\JcSimulator</FileName>
        <FileName>Tools\AR3toGps</FileName>
        <FileName>Tools\XMLConverter</FileName>
        <FileName>GitManipulator.cs</FileName>
    </SkipFileNames>
</IssueBuster>

Note that CDATA takes this form:

<![CDATA[your_literal_text]]>

Whatever you put in between the inner square brackets will be returned verbatim.

To wrap this up: in the unlikely event you have to include a ]]> sequence in the content, you can split the content after the second ] and create two consecutive CDATA sections. This can easily be implemented recursively.

CDATA sections in XML should do.

Here's a stackoverflow post about it: https://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean

I remember it took me a while to understand how to use them. A DOM parser has a dedicated instruction for creating a CDATA section but there is no equivalent statement for reading them. Reading is transparent, you just read the contents of the element that has the CDATA section in it to have the literal text returned.

Here's an example taken from the input data file of a code scrutinizer I once made. It allows the definition of the forms of problematic code fragments using regular expressions.

<IssueBuster type="Basic" name="Suspicious lambdas" skip="true">
    <Description>
        <!-- See https://stackoverflow.com/questions/2465040/using-lambda-expressions-for-event-handlers -->
        A lambda expression is used for event handlers which inhibits unsubscribing.
    </Description>
    <Regex><![CDATA[\+\=\s*\([^\s\,]+\,\s*[^\s\)]+\)\s*=>]]></Regex>
    <SkipFileNames>
        <!-- If any of these inner texts appears in a file path, this buster will ignore that file. -->
        <FileName>SMMdataComponent\DeltaPlusGenerator\TestForm.cs</FileName>
        <FileName>Toolchain\Validate-TranslationEnums</FileName>
        <FileName>Tools\JcSimulator</FileName>
        <FileName>Tools\AR3toGps</FileName>
        <FileName>Tools\XMLConverter</FileName>
        <FileName>GitManipulator.cs</FileName>
    </SkipFileNames>
</IssueBuster>

Note that CDATA takes this form:

<![CDATA[your_literal_text]]>

Whatever you put in between the inner square brackets will be returned verbatim.

CDATA sections in XML should do.

Here's a stackoverflow post about it: https://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean

I remember it took me a while to understand how to use them. A DOM parser has a dedicated instruction for creating a CDATA section but there is no equivalent statement for reading them. Reading is transparent, you just read the contents of the element that has the CDATA section in it to have the literal text returned.

Here's an example taken from the input data file of a code scrutinizer I once made. It allows the definition of the forms of problematic code fragments using regular expressions.

<IssueBuster type="Basic" name="Suspicious lambdas" skip="true">
    <Description>
        <!-- See https://stackoverflow.com/questions/2465040/using-lambda-expressions-for-event-handlers -->
        A lambda expression is used for event handlers which inhibits unsubscribing.
    </Description>
    <Regex><![CDATA[\+\=\s*\([^\s\,]+\,\s*[^\s\)]+\)\s*=>]]></Regex>
    <SkipFileNames>
        <!-- If any of these inner texts appears in a file path, this buster will ignore that file. -->
        <FileName>SMMdataComponent\DeltaPlusGenerator\TestForm.cs</FileName>
        <FileName>Toolchain\Validate-TranslationEnums</FileName>
        <FileName>Tools\JcSimulator</FileName>
        <FileName>Tools\AR3toGps</FileName>
        <FileName>Tools\XMLConverter</FileName>
        <FileName>GitManipulator.cs</FileName>
    </SkipFileNames>
</IssueBuster>

Note that CDATA takes this form:

<![CDATA[your_literal_text]]>

Whatever you put in between the inner square brackets will be returned verbatim.

To wrap this up: in the unlikely event you have to include a ]]> sequence in the content, you can split the content after the second ] and create two consecutive CDATA sections. This can easily be implemented recursively.

spelling error
Source Link
Martin Maat
  • 18.7k
  • 3
  • 33
  • 59

CDATA sections in XML should do.

Here's a stackoverflow post about it: https://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean

I remember it took me a while to understand how to use them. A DOM parser has a dedicated instruction for creating a CDATA section but there is no equivalent statement for reading them. Reading is transparent, you just read the contents of the element that has the CDATA section in it to have the literal text returned.

Here's an example taken from the input data file of a code scrutinizer I once made. It allows the definition of the forms of problematic code fragments using regular expressions.

<IssueBuster type="Basic" name="Suspicious lambdas" skip="true">
    <Description>
        <!-- See https://stackoverflow.com/questions/2465040/using-lambda-expressions-for-event-handlers -->
        A lambda expression is used for event handlers which inhibits unsubscribing.
    </Description>
    <Regex><![CDATA[\+\=\s*\([^\s\,]+\,\s*[^\s\)]+\)\s*=>]]></Regex>
    <SkipFileNames>
        <!-- If any of these inner texts appears in a file path, this buster will ignoredignore that file. -->
        <FileName>SMMdataComponent\DeltaPlusGenerator\TestForm.cs</FileName>
        <FileName>Toolchain\Validate-TranslationEnums</FileName>
        <FileName>Tools\JcSimulator</FileName>
        <FileName>Tools\AR3toGps</FileName>
        <FileName>Tools\XMLConverter</FileName>
        <FileName>GitManipulator.cs</FileName>
    </SkipFileNames>
</IssueBuster>

Note that CDATA takes this form:

<![CDATA[your_literal_text]]>

Whatever you put in between the inner square brackets will be returned verbatim.

CDATA sections in XML should do.

Here's a stackoverflow post about it: https://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean

I remember it took me a while to understand how to use them. A DOM parser has a dedicated instruction for creating a CDATA section but there is no equivalent statement for reading them. Reading is transparent, you just read the contents of the element that has the CDATA section in it to have the literal text returned.

Here's an example taken from the input data file of a code scrutinizer I once made. It allows the definition of the forms of problematic code fragments using regular expressions.

<IssueBuster type="Basic" name="Suspicious lambdas" skip="true">
    <Description>
        <!-- See https://stackoverflow.com/questions/2465040/using-lambda-expressions-for-event-handlers -->
        A lambda expression is used for event handlers which inhibits unsubscribing.
    </Description>
    <Regex><![CDATA[\+\=\s*\([^\s\,]+\,\s*[^\s\)]+\)\s*=>]]></Regex>
    <SkipFileNames>
        <!-- If any of these inner texts appears in a file path, this buster will ignored that file. -->
        <FileName>SMMdataComponent\DeltaPlusGenerator\TestForm.cs</FileName>
        <FileName>Toolchain\Validate-TranslationEnums</FileName>
        <FileName>Tools\JcSimulator</FileName>
        <FileName>Tools\AR3toGps</FileName>
        <FileName>Tools\XMLConverter</FileName>
        <FileName>GitManipulator.cs</FileName>
    </SkipFileNames>
</IssueBuster>

Note that CDATA takes this form:

<![CDATA[your_literal_text]]>

Whatever you put in between the inner square brackets will be returned verbatim.

CDATA sections in XML should do.

Here's a stackoverflow post about it: https://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean

I remember it took me a while to understand how to use them. A DOM parser has a dedicated instruction for creating a CDATA section but there is no equivalent statement for reading them. Reading is transparent, you just read the contents of the element that has the CDATA section in it to have the literal text returned.

Here's an example taken from the input data file of a code scrutinizer I once made. It allows the definition of the forms of problematic code fragments using regular expressions.

<IssueBuster type="Basic" name="Suspicious lambdas" skip="true">
    <Description>
        <!-- See https://stackoverflow.com/questions/2465040/using-lambda-expressions-for-event-handlers -->
        A lambda expression is used for event handlers which inhibits unsubscribing.
    </Description>
    <Regex><![CDATA[\+\=\s*\([^\s\,]+\,\s*[^\s\)]+\)\s*=>]]></Regex>
    <SkipFileNames>
        <!-- If any of these inner texts appears in a file path, this buster will ignore that file. -->
        <FileName>SMMdataComponent\DeltaPlusGenerator\TestForm.cs</FileName>
        <FileName>Toolchain\Validate-TranslationEnums</FileName>
        <FileName>Tools\JcSimulator</FileName>
        <FileName>Tools\AR3toGps</FileName>
        <FileName>Tools\XMLConverter</FileName>
        <FileName>GitManipulator.cs</FileName>
    </SkipFileNames>
</IssueBuster>

Note that CDATA takes this form:

<![CDATA[your_literal_text]]>

Whatever you put in between the inner square brackets will be returned verbatim.

Added example.
Source Link
Martin Maat
  • 18.7k
  • 3
  • 33
  • 59

CDATA sections in XML should do.

Here's a stackoverflow post about it: https://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean

I remember it took me a while to understand how to use them. A DOM parser has a dedicated instruction for creating a CDATA section but there is no equivalent statement for reading them. Reading is transparent, you just read the contents of the element that has the CDATA section in it to have the literal text returned.

Here's an example taken from the input data file of a code scrutinizer I once made. It allows the definition of the forms of problematic code fragments using regular expressions.

<IssueBuster type="Basic" name="Suspicious lambdas" skip="true">
    <Description>
        <!-- See https://stackoverflow.com/questions/2465040/using-lambda-expressions-for-event-handlers -->
        A lambda expression is used for event handlers which inhibits unsubscribing.
    </Description>
    <Regex><![CDATA[\+\=\s*\([^\s\,]+\,\s*[^\s\)]+\)\s*=>]]></Regex>
    <SkipFileNames>
        <!-- If any of these inner texts appears in a file path, this buster will ignored that file. -->
        <FileName>SMMdataComponent\DeltaPlusGenerator\TestForm.cs</FileName>
        <FileName>Toolchain\Validate-TranslationEnums</FileName>
        <FileName>Tools\JcSimulator</FileName>
        <FileName>Tools\AR3toGps</FileName>
        <FileName>Tools\XMLConverter</FileName>
        <FileName>GitManipulator.cs</FileName>
    </SkipFileNames>
</IssueBuster>

Note that CDATA takes this form:

<![CDATA[your_literal_text]]>

Whatever you put in between the inner square brackets will be returned verbatim.

CDATA sections in XML should do.

Here's a stackoverflow post about it: https://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean

I remember it took me while to understand how to use them. A DOM parser has a dedicated instruction for creating a CDATA section but there is no equivalent statement for reading them. Reading is transparent, you just read the contents of the element that has the CDATA section in it to have the literal text returned.

CDATA sections in XML should do.

Here's a stackoverflow post about it: https://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean

I remember it took me a while to understand how to use them. A DOM parser has a dedicated instruction for creating a CDATA section but there is no equivalent statement for reading them. Reading is transparent, you just read the contents of the element that has the CDATA section in it to have the literal text returned.

Here's an example taken from the input data file of a code scrutinizer I once made. It allows the definition of the forms of problematic code fragments using regular expressions.

<IssueBuster type="Basic" name="Suspicious lambdas" skip="true">
    <Description>
        <!-- See https://stackoverflow.com/questions/2465040/using-lambda-expressions-for-event-handlers -->
        A lambda expression is used for event handlers which inhibits unsubscribing.
    </Description>
    <Regex><![CDATA[\+\=\s*\([^\s\,]+\,\s*[^\s\)]+\)\s*=>]]></Regex>
    <SkipFileNames>
        <!-- If any of these inner texts appears in a file path, this buster will ignored that file. -->
        <FileName>SMMdataComponent\DeltaPlusGenerator\TestForm.cs</FileName>
        <FileName>Toolchain\Validate-TranslationEnums</FileName>
        <FileName>Tools\JcSimulator</FileName>
        <FileName>Tools\AR3toGps</FileName>
        <FileName>Tools\XMLConverter</FileName>
        <FileName>GitManipulator.cs</FileName>
    </SkipFileNames>
</IssueBuster>

Note that CDATA takes this form:

<![CDATA[your_literal_text]]>

Whatever you put in between the inner square brackets will be returned verbatim.

added 435 characters in body
Source Link
Martin Maat
  • 18.7k
  • 3
  • 33
  • 59
Loading
Source Link
Martin Maat
  • 18.7k
  • 3
  • 33
  • 59
Loading