Home | History | Annotate | Download | only in xmllite

Lines Matching refs:ns

90 XmlnsStack::PrefixMatchesNs(const std::string & prefix, const std::string & ns) {
94 return (*match == ns);
98 XmlnsStack::PrefixForNs(const std::string & ns, bool isattr) {
99 if (ns == NS_XML)
101 if (ns == NS_XMLNS)
103 if (isattr ? ns == STR_EMPTY : PrefixMatchesNs(STR_EMPTY, ns))
109 if (*(pos + 1) == ns &&
110 (!isattr || !pos->empty()) && PrefixMatchesNs(*pos, ns))
127 XmlnsStack::AddXmlns(const std::string & prefix, const std::string & ns) {
129 pxmlnsStack_->push_back(ns);
153 static std::string SuggestPrefix(const std::string & ns) {
154 size_t len = ns.length();
155 size_t i = ns.find_last_of('.');
161 if (IsAsciiLetter(ns[last])) {
165 if (!IsAsciiLetter(ns[first - 1]))
171 std::string candidate(AsciiLower(ns.substr(first, last - first)));
177 return "ns";
182 XmlnsStack::AddNewPrefix(const std::string & ns, bool isAttr) {
183 if (PrefixForNs(ns, isAttr).second)
186 std::string base(SuggestPrefix(ns));
195 AddXmlns(result, ns);