XML tweaks

This commit is contained in:
Dick Hollenbeck 2010-08-19 09:02:49 -05:00
parent 8ec67570ea
commit 92d58ffea4
3 changed files with 26 additions and 2 deletions

View File

@ -27,7 +27,7 @@
#include "macros.h"
typedef wxXmlProperty XATTR;
#define GetAttribs GetProperties
void XNODE::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError )
{
@ -53,7 +53,7 @@ void XNODE::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError
std::string utf8;
// output attributes first if they exist
for( XATTR* attr = (XATTR*) GetAttribs(); attr; attr = (XATTR*) attr->GetNext() )
for( XATTR* attr = (XATTR*) GetAttributes(); attr; attr = (XATTR*) attr->GetNext() )
{
utf8 = CONV_TO_UTF8( attr->GetValue() ); // capture the content

View File

@ -2,6 +2,9 @@
<!--XSL style sheet to EESCHEMA Generic Netlist Format to PADS netlist format
Copyright (C) 2010, SoftPLC Corporation.
GPL v2.
How to use:
https://lists.launchpad.net/kicad-developers/msg05157.html
-->
<!DOCTYPE xsl:stylesheet [

View File

@ -65,6 +65,27 @@ public:
* @throw IOError if a system error writing the output, such as a full disk.
*/
virtual void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError );
#if wxABI_VERSION < 20811 // change the if as needed
wxString GetAttribute( const wxString& attrName, const wxString& defaultVal ) const
{
return GetPropVal(attrName, defaultVal);
}
bool GetAttribute( const wxString& attrName, wxString *value ) const
{
return GetPropVal(attrName, value);
}
void AddAttribute( const wxString& attrName, const wxString& value )
{
AddProperty(attrName, value);
}
wxXmlProperty* GetAttributes() const
{
return GetProperties();
}
#endif // wx < 2.8.11
};
#endif // _XATTR_H_