Skip to content

Commit 6bfe219

Browse files
committed
Merge pull request #12 from mikk150/master
add support for case sensitive XML
2 parents 593013e + 104b79e commit 6bfe219

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/XMLParser/XMLParser.php

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class XMLParser {
1818

1919
private static $_defaultAttrTag = 'attr:';
2020

21+
public static $caseSensitive = false;
22+
2123
public static function encode ($data, $root = null)
2224
{
2325
if ($data instanceof SimpleXMLElement) {
@@ -113,6 +115,9 @@ private static function _formatName ($string)
113115
'/ /' => '_'
114116
];
115117
$string = preg_replace(array_keys($p), array_values($p), $string);
118+
if (self::$caseSensitive) {
119+
return $string;
120+
}
116121
return strtolower($string);
117122
}
118123

0 commit comments

Comments
 (0)