void XSDParser::CreateTypeDefinition(DTDEntity::EType type) { string id, name, data; TToken tok; data += "<" + m_Raw; for ( tok = GetNextToken(); tok == K_ATTPAIR || tok == K_XMLNS; tok = GetNextToken()) { data += " " + m_Raw; if (IsAttribute("name")) { name = m_Value; id = CreateEntityId(name,type); m_MapEntity[id].SetName(name); } } data += m_Raw; if (name.empty()) { ParseError("name"); } m_MapEntity[id].SetData(data); m_MapEntity[id].SetType(type); m_MapEntity[id].SetParseAttributes( m_TargetNamespace, m_ElementFormDefault,m_AttributeFormDefault); if (tok == K_CLOSING) { ParseTypeDefinition(m_MapEntity[id]); } }
void Sintactico::_ParseTypeDefinitionList() { //Utilizamos PRIMERO ( TypeDefinitionList ) if ( proximo_token.GetTipo() == id ) { ParseTypeDefinition(); _ParseTypeDefinitionList(); } }
void XSDParser::ParseTypeDefinition(DTDEntity& ent) { string data = ent.GetData(); string closing; TToken tok; CComments comments; bool doctag_open = false; for ( tok=GetNextToken(); tok != K_ENDOFTAG; tok=GetNextToken()) { if (tok == T_EOF) { break; } { CComments comm; Lexer().FlushCommentsTo(comm); if (!comm.Empty()) { CNcbiOstrstream buffer; comm.PrintDTD(buffer); data += CNcbiOstrstreamToString(buffer); data += closing; closing.erase(); } if (!closing.empty()) { if (!comments.Empty()) { CNcbiOstrstream buffer; comments.Print(buffer, "", "\n", ""); data += CNcbiOstrstreamToString(buffer); comments = CComments(); } data += closing; closing.erase(); doctag_open = false; } } if (tok == K_DOCUMENTATION) { if (!doctag_open) { data += "<" + m_Raw; } m_Comments = &comments; ParseDocumentation(); if (!doctag_open) { if (m_Raw == "/>") { data += "/>"; closing.erase(); } else { data += ">"; closing = m_Raw; doctag_open = true; } } } else if (tok == K_APPINFO) { ParseAppInfo(); } else { data += "<" + m_Raw; for ( tok = GetNextToken(); tok == K_ATTPAIR || tok == K_XMLNS; tok = GetNextToken()) { data += " " + m_Raw; } data += m_Raw; } if (tok == K_CLOSING) { ent.SetData(data); ParseTypeDefinition(ent); data = ent.GetData(); } } if (!comments.Empty()) { CNcbiOstrstream buffer; comments.Print(buffer, "", "\n", ""); data += CNcbiOstrstreamToString(buffer); data += closing; } data += '\n'; data += m_Raw; ent.SetData(data); }
void Sintactico::ParseTypeDefinitionList() { ParseTypeDefinition(); _ParseTypeDefinitionList(); }