0
 set @xml = '<a>demo</a>';
 select extractvalue(@xml ,'/a');

I want to extract value for both the string with < a > demo< /a > and < a > demo < /a > at the same time.

Is it possible using lower-case function or something. I want to extract values with case-insensitiveness for xml tags.

Ashish Kakkad
  • 23,586
  • 12
  • 103
  • 136
user3612181
  • 603
  • 1
  • 5
  • 8

1 Answers1

0

XML is case-sensitive, <a> and <A> are different tags. You can use a disjunct:

set @xml = '<a>demo</a>';
select extractvalue(@xml ,'/A|/a');

Or, better yet, normalise your XML.

Amadan
  • 191,408
  • 23
  • 240
  • 301
  • but what to do in case of < destiNation > 8989 < /destiNation > and < destination > 8989 < /destination > ? – user3612181 Aug 28 '15 at 10:36
  • You fire whoever made the XML file, then normalise the file. Go through every node and replace its name by a canonical one (e.g. by lowercasing them). If `destiNation` and `destination` denote the same kind of information, such an XML file should never have entered your database in the first place. It's like driving a taxi professionally with a bicycle tyre, a truck tyre, a car tyre and a dinner plate for your wheels. – Amadan Aug 28 '15 at 15:22