RosettaCodeData/Task/XML-Output/Vedit-macro-language/xml-output.vedit
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

18 lines
503 B
Text

// Replace special characters with entities:
Replace("&", "&", BEGIN+ALL+NOERR) // this must be the first replace!
Replace("<", "&lt;", BEGIN+ALL+NOERR)
Replace(">", "&gt;", BEGIN+ALL+NOERR)
Replace("'", "&apos;", BEGIN+ALL+NOERR)
Replace('"', "&quot;", BEGIN+ALL+NOERR)
// Insert XML marking
BOF
IT("<CharacterRemarks>") IN
Repeat(ALL) {
Search("^.", REGEXP+ERRBREAK)
IT(' <Character name="')
Replace('|T', '">')
EOL IT('</Character>')
}
EOF
IT("</CharacterRemarks>") IN