How can I put an angle bracket ("<") in my xml attribute?
I'm trying to store an SQL query, but this seems to be illegal.
<add key="query" value="SELECT DISTINCT index FROM table WHERE langCode <> 'FR'"/>
Note: The square brackets ( [ ] ) in the Edit Element dialog box represent XML opening and closing tags. To type a square bracket in the text of your design, use the following codes: &left; for “[“ or &right; for “]”. Select the XML element for which you want to edit the text content in the XML Tree.
The escape character for XML is the ampersand, &. The other dangerous character is the left angle bracket, the “less than,” <. Mostly to be symmetric, we also handle the right angle bracket, the “greater than,” >, similarly.
What Does Angle Bracket Mean? The angle bracket (< or >), which is also called an “inequality sign” for its use in mathematics, is a kind of sideways caret that can be used to include tags or pieces of code. This ASCII set of characters is common in web design and other types of coding projects.
Square brackets do not need a specific notation in XML but they have a special meaning when used in XPath expressions for XSL transformations.
Use <
and >
instead of <
and >
:
<add key="query" value="SELECT DISTINCT index FROM table WHERE langCode <> 'FR'"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With