Changeset 740 for code/branches/FICN/src/tinyxml/tinyxmlparser.cc
- Timestamp:
- Dec 31, 2007, 1:32:53 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/tinyxml/tinyxmlparser.cc
r738 r740 838 838 // - Comments: <!-- 839 839 // - Decleration: <?xml 840 // - StylesheetReference <?xml-stylesheet 840 841 // - Everthing else is unknown to tinyxml. 841 842 // 842 843 843 844 const char* xmlHeader = { "<?xml" }; 845 const char* xmlSSHeader = { "<?xml-stylesheet" }; 844 846 const char* commentHeader = { "<!--" }; 845 847 const char* dtdHeader = { "<!" }; 846 848 const char* cdataHeader = { "<![CDATA[" }; 847 849 848 if ( StringEqual( p, xmlHeader, true, encoding ) ) 850 if ( StringEqual( p, xmlSSHeader, true, encoding ) ) 851 { 852 #ifdef DEBUG_PARSER 853 TIXML_LOG( "XML parsing Stylesheet Reference\n" ); 854 #endif 855 returnNode = new TiXmlStylesheetReference(); 856 } 857 else if ( StringEqual( p, xmlHeader, true, encoding ) ) 849 858 { 850 859 #ifdef DEBUG_PARSER … … 1637 1646 } 1638 1647 1648 #ifdef TIXML_USE_STL 1649 void TiXmlStylesheetReference::StreamIn( std::istream * in, TIXML_STRING * tag ) 1650 { 1651 while ( in->good() ) 1652 { 1653 int c = in->get(); 1654 if ( c <= 0 ) 1655 { 1656 TiXmlDocument* document = GetDocument(); 1657 if ( document ) 1658 document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN ); 1659 return; 1660 } 1661 (*tag) += (char) c; 1662 1663 if ( c == '>' ) 1664 { 1665 // All is well. 1666 return; 1667 } 1668 } 1669 } 1670 #endif 1671 1672 const char* TiXmlStylesheetReference::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding _encoding ) 1673 { 1674 p = SkipWhiteSpace( p, _encoding ); 1675 // Find the beginning, find the end, and look for 1676 // the stuff in-between. 1677 TiXmlDocument* document = GetDocument(); 1678 if ( !p || !*p || !StringEqual( p, "<?xml-stylesheet", true, _encoding ) ) 1679 { 1680 if ( document ) document->SetError( TIXML_ERROR_PARSING_DECLARATION, 0, 0, _encoding ); 1681 return 0; 1682 } 1683 if ( data ) 1684 { 1685 data->Stamp( p, _encoding ); 1686 location = data->Cursor(); 1687 } 1688 p += 5; 1689 1690 type = ""; 1691 href = ""; 1692 1693 while ( p && *p ) 1694 { 1695 if ( *p == '>' ) 1696 { 1697 ++p; 1698 return p; 1699 } 1700 1701 p = SkipWhiteSpace( p, _encoding ); 1702 if ( StringEqual( p, "type", true, _encoding ) ) 1703 { 1704 TiXmlAttribute attrib; 1705 p = attrib.Parse( p, data, _encoding ); 1706 type = attrib.Value(); 1707 } 1708 else if ( StringEqual( p, "href", true, _encoding ) ) 1709 { 1710 TiXmlAttribute attrib; 1711 p = attrib.Parse( p, data, _encoding ); 1712 href = attrib.Value(); 1713 } 1714 else 1715 { 1716 // Read over whatever it is. 1717 while( p && *p && *p != '>' && !IsWhiteSpace( *p ) ) 1718 ++p; 1719 } 1720 } 1721 return 0; 1722 }
Note: See TracChangeset
for help on using the changeset viewer.