Revision 2712
Added by sgarg about 19 years ago
src/edu/ucsb/nceas/metacat/MetaCatServlet.java | ||
---|---|---|
1898 | 1898 |
{ |
1899 | 1899 |
// if prefix found then look for xmlns:prefix |
1900 | 1900 |
// element to find the ns |
1901 |
String namespaceWithPrefix = NAMESPACEKEYWORD + ":" + prefix; |
|
1901 |
String namespaceWithPrefix = NAMESPACEKEYWORD |
|
1902 |
+ ":" + prefix; |
|
1902 | 1903 |
startIndex = targetLine.indexOf(namespaceWithPrefix); |
1903 |
|
|
1904 |
// if xmlns:prefix not found, look |
|
1905 |
// for xmlns attribute to find the ns |
|
1906 |
if(startIndex == -1){ |
|
1907 |
startIndex = targetLine.indexOf(NAMESPACEKEYWORD); |
|
1908 |
} |
|
1904 |
|
|
1909 | 1905 |
} else { |
1910 | 1906 |
// if prefix not found then look for xmlns |
1911 | 1907 |
// attribute to find the ns |
Also available in: Unified diff
Modification in algo:
1. Find if the root element has prefix (e.g. <eml:eml>). If found, go to step
2, otheriwse go to step 3.
2. Look for xmlns:prefix element to find the ns
(e.g.:xmlns:eml="eml://ecoinformatics.org/eml-2.0.0")
2.a If not found go to step 4
3. Look for xmlns element to find the ns (e.g.:
xmlns="eml://ecoinformatics.org/eml-2.0.0")
4. If no xmlns element found, you the generic schemea.