Reputation: 21
I am using Oracle 11g in which I am passing file name to a function say
FUNCTION test(file_name IN XMLTYPE)
It accepts file name like <file1.xml/>
but when I am passing file name as <123.xml/>
then it is throwing Oracle type exception error. But if I pass file name starting with character again as <T123.xml/>
then it is working fine.
Please tell me what need to do to process file name as <123.xml/>
Upvotes: 1
Views: 115
Reputation: 206833
<123.xml/>
is not valid XML: tag names can't start with a digit (or a .
or -
). The Wikipedia article on XML has a good summary on well-formedness. The other two examples you posted are valid XML though, the tag names are well-formed.
Your use-case looks very strange though. If you want to pass a simple filename to that function, why don't you pass a plain string? If you do want to pass a filename encoded in an XML container, something like this would make more sense:
<file name="foo.bar"/>
Upvotes: 2