Closed 418error closed 6 years ago
For your consideration. A very small change. When using the original code it was ignoring nodes with prefixes, such as:
<?xml version="1.0" encoding="UTF-8" ?> <prefix:books xmlns:prefix="http://www.somesite.com/XMLSchema/ns/somesystem"> <prefix:book ISBN="10-861003-324"> <prefix:title>The Handmaid's Tale</title> <prefix:price>19.95</price> </prefix:book> <prefix:book ISBN="10-861003-324"> <prefix:title>The Handmaid's Tale</title> <prefix:price>19.95</price> </prefix:book> </prefix:books>
Changing the regx from
/<(\w+)[>\s]/mg
to
/<([\w:]+)[>\s]/mg
now works for nodes with or without prefixes
looks good, thanks!
For your consideration. A very small change. When using the original code it was ignoring nodes with prefixes, such as:
Changing the regx from
to
now works for nodes with or without prefixes