Undef in XML

I am writing some code that converts a Perl HASH to XML data. I didn’t know how to write Undef in XML. It seems this is the common way to write this:
- empty value: <string />
- undefined value: <string defined=”false” />
- normal value: <string>abc</string>
Because you can have empty keys perhaps “” => undef must be written like this <item key=”" defined=”false” /> ?? This rules out Undef keys but I think I can live with it.
Post Links
Flux Share |
Bookmark |
Permalink | Trackback |
Email to a Friend |
Comments
2 Responses to “Undef in XML”
Leave a Reply
Well, although a undef key is possible in Perl, it’s probably not a good idea to use one anyway.
BTW, that should be (forward slash), not (backslash), right?
Yes, I will change the slashes in this post now.