From: Peter C. <Pet...@me...> - 2005-05-25 16:16:28
|
> From: [...] Colin Tatham > I like option 3, and storing the namespace prefix, presumably=20 > separate from the rest of the element name... Noted. I'm coming round to it if we can do it. > Isn't the SAX parsing a problem for option 2 too? Re-reading the relevant bit of spec... SAX2 guarantees that all implementations will provide the namespace URI, the qName and the undecorated element name, but doesn't guarantee to pass through the xmlns:* attributes (from http://java.sun.com/j2se/1.4.2/docs/api/org/xml/sax/ContentHandler.html) . LexicalHandler is also optional. This means that there might be no central way of retrieving qname to namespace mappings - although I now think it's possible to pick the mappings up piecemeal in the elements and attributes, so this may not in fact be an issue. > If I'm understanding what you're saying, parsing (on import?)=20 > might not provide the namespace, so it won't get the URI=20 > either will it? >=20 > In the example you quoted, is the element name being stored=20 > as imsmd:record? Yes. > That suggests a problem in parsing i.e. it=20 > doesn't understand what a prefix is (unless it's a quirky=20 > Bodington way to store the prefixes). XMLRepository is currently coded to store the QName, not the localName. So anything with namespace prefixes will be stored with those prefixes. This is why I want to change it. - Peter |