|
Revision 111, 1.5 kB
(checked in by mido, 18 years ago)
|
|
pridana knihovna XSD (a jeji chlebodarkyne XERCES), v ramci Win32 zprovoznen priklad tests/test_xsd_hello.cxx
|
| Line | |
|---|
| 1 | // file : xsd/cxx/xml/dom/elements.txx |
|---|
| 2 | // author : Boris Kolpackov <boris@codesynthesis.com> |
|---|
| 3 | // copyright : Copyright (c) 2005-2008 Code Synthesis Tools CC |
|---|
| 4 | // license : GNU GPL v2 + exceptions; see accompanying LICENSE file |
|---|
| 5 | |
|---|
| 6 | #include <xsd/cxx/xml/string.hxx> |
|---|
| 7 | |
|---|
| 8 | namespace xsd |
|---|
| 9 | { |
|---|
| 10 | namespace cxx |
|---|
| 11 | { |
|---|
| 12 | namespace xml |
|---|
| 13 | { |
|---|
| 14 | namespace dom |
|---|
| 15 | { |
|---|
| 16 | template <typename C> |
|---|
| 17 | qualified_name<C> |
|---|
| 18 | name (const xercesc::DOMAttr& a) |
|---|
| 19 | { |
|---|
| 20 | const XMLCh* n (a.getLocalName ()); |
|---|
| 21 | |
|---|
| 22 | // If this DOM doesn't support namespaces then use getName. |
|---|
| 23 | // |
|---|
| 24 | if (n != 0) |
|---|
| 25 | { |
|---|
| 26 | if (const XMLCh* ns = a.getNamespaceURI ()) |
|---|
| 27 | return qualified_name<C> (transcode<C> (n), transcode<C> (ns)); |
|---|
| 28 | else |
|---|
| 29 | return qualified_name<C> (transcode<C> (n)); |
|---|
| 30 | } |
|---|
| 31 | else |
|---|
| 32 | return qualified_name<C> (transcode<C> (a.getName ())); |
|---|
| 33 | } |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | template <typename C> |
|---|
| 37 | qualified_name<C> |
|---|
| 38 | name (const xercesc::DOMElement& e) |
|---|
| 39 | { |
|---|
| 40 | const XMLCh* n (e.getLocalName ()); |
|---|
| 41 | |
|---|
| 42 | // If this DOM doesn't support namespaces then use getTagName. |
|---|
| 43 | // |
|---|
| 44 | if (n != 0) |
|---|
| 45 | { |
|---|
| 46 | if (const XMLCh* ns = e.getNamespaceURI ()) |
|---|
| 47 | return qualified_name<C> (transcode<C> (n), transcode<C> (ns)); |
|---|
| 48 | else |
|---|
| 49 | return qualified_name<C> (transcode<C> (n)); |
|---|
| 50 | } |
|---|
| 51 | else |
|---|
| 52 | return qualified_name<C> (transcode<C> (e.getTagName ())); |
|---|
| 53 | } |
|---|
| 54 | } |
|---|
| 55 | } |
|---|
| 56 | } |
|---|
| 57 | } |
|---|