Is it possible to use < and > in XML tags?
Like this: <tag><blah></tag>, so that when I read 'tag', the value of '<blah>' will be returned.
Thanks.
Printable View
Is it possible to use < and > in XML tags?
Like this: <tag><blah></tag>, so that when I read 'tag', the value of '<blah>' will be returned.
Thanks.
Yes but change <blah> to <blah>
Not quite like that.... you have to encode it first.... so that the < becomes < and the > becomes > ... once you have that.... you then need to encode the & so that XML parsers will validate it properly... so < and > become, &lt; and &gt; ..... then you can stick your data into the tags.... nutters I know, but that's the short of it.
-tg
Can you give me a push in the right direction on 'encoding characters'?
As my knowledge in XML is not quite up to it. ;)
They just did. To XML-encode a string, just change every < to < and every & to &. You can also change > to >, but that's not actually necessary.
Ah, that's easy. I thought it required some sort of coding, which confused me extra as I was always thaught that XML is not for actual programming, only for file structuring. :)
Thanks