I’m running into an issue where I need to use a hashtag in the name of an XML node, and the hashtag is causing parsing errors. I’ve tried encoding the # without luck, perhaps I implemented the coding wrong.
<?xml version="1.0" encoding="UTF-8"?>
<dataset>
<properties#tags pk1="1" pk2="1" />
</dataset>
According to the XML specification,
#is not a valid character in an XML name, so it won’t work. You need to find another character.Even trying to encode with
#or#for#will not allow you to use a character that isn’t valid for an XML name.