XML/Output: Difference between revisions
Content added Content deleted
m (Removed stray newline) |
m (→{{header|Lua}}) |
||
Line 1,271: | Line 1,271: | ||
print(root)</lang> |
print(root)</lang> |
||
{{out}} |
{{out}} |
||
< |
<lang xml><CharacterRemarks> |
||
<Character name="April">Bubbly: I'm > Tam and <= Emily</Character> |
<Character name="April">Bubbly: I'm > Tam and <= Emily</Character> |
||
<Character name="Tam O'Shanter">Burns: "When chapman billies leave the street ..."</Character> |
<Character name="Tam O'Shanter">Burns: "When chapman billies leave the street ..."</Character> |
||
<Character name="Emily">Short & shrift</Character> |
<Character name="Emily">Short & shrift</Character> |
||
</CharacterRemarks></ |
</CharacterRemarks></xml> |
||
Note also that LuaXML escapes quote marks and apostrophes, which makes the output slightly different to the task requirement. This can be 'fixed' if necessary using Lua's in-built string.gsub function: |
Note also that LuaXML escapes quote marks and apostrophes, which makes the output slightly different to the task requirement. This can be 'fixed' if necessary using Lua's in-built string.gsub function: |
||
<lang Lua>xmlStr = xml.str(root):gsub("'", "'"):gsub(""", '"') |
<lang Lua>xmlStr = xml.str(root):gsub("'", "'"):gsub(""", '"') |
||
print(xmlStr)</lang> |
print(xmlStr)</lang> |
||
{{out}} |
{{out}} |
||
< |
<lang xml><CharacterRemarks> |
||
<Character name="April">Bubbly: I'm > Tam and <= Emily</Character> |
<Character name="April">Bubbly: I'm > Tam and <= Emily</Character> |
||
<Character name="Tam O'Shanter">Burns: "When chapman billies leave the street ..."</Character> |
<Character name="Tam O'Shanter">Burns: "When chapman billies leave the street ..."</Character> |
||
<Character name="Emily">Short & shrift</Character> |
<Character name="Emily">Short & shrift</Character> |
||
</CharacterRemarks></ |
</CharacterRemarks></xml> |
||
=={{header|Mathematica}}== |
=={{header|Mathematica}}== |