Index: /code/branches/FICN/src/tinyxml/tinyxml.cc
===================================================================
--- /code/branches/FICN/src/tinyxml/tinyxml.cc	(revision 739)
+++ /code/branches/FICN/src/tinyxml/tinyxml.cc	(revision 740)
@@ -22,4 +22,5 @@
 distribution.
 */
+#include "tinyxml.h"
 
 #include <ctype.h>
@@ -29,6 +30,4 @@
 #include <iostream>
 #endif
-
-#include "tinyxml.h"
 
 
@@ -1467,4 +1466,78 @@
 }
 
+TiXmlStylesheetReference::TiXmlStylesheetReference( const char * _type,
+													const char * _href )
+	: TiXmlNode( TiXmlNode::STYLESHEETREFERENCE )
+{
+	type = _type;
+	href = _href;
+}
+
+
+#ifdef TIXML_USE_STL
+TiXmlStylesheetReference::TiXmlStylesheetReference(	const std::string& _type,
+													const std::string& _href )
+	: TiXmlNode( TiXmlNode::STYLESHEETREFERENCE )
+{
+	type = _type;
+	href = _href;
+}
+#endif
+
+
+TiXmlStylesheetReference::TiXmlStylesheetReference( const TiXmlStylesheetReference& copy )
+	: TiXmlNode( TiXmlNode::STYLESHEETREFERENCE )
+{
+	copy.CopyTo( this );
+}
+
+
+void TiXmlStylesheetReference::operator=( const TiXmlStylesheetReference& copy )
+{
+	Clear();
+	copy.CopyTo( this );
+}
+
+
+void TiXmlStylesheetReference::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const
+{
+	if ( cfile ) fprintf( cfile, "<?xml-stylesheet " );
+	if ( str )	 (*str) += "<?xml-stylesheet ";
+
+	if ( !type.empty() ) {
+		if ( cfile ) fprintf (cfile, "type=\"%s\" ", type.c_str ());
+		if ( str ) { (*str) += "type=\""; (*str) += type; (*str) += "\" "; }
+	}
+	if ( !href.empty() ) {
+		if ( cfile ) fprintf (cfile, "href=\"%s\" ", href.c_str ());
+		if ( str ) { (*str) += "href=\""; (*str) += href; (*str) += "\" "; }
+	}
+	if ( cfile ) fprintf (cfile, "?>");
+	if ( str )	 (*str) += "?>";
+}
+
+void TiXmlStylesheetReference::CopyTo( TiXmlStylesheetReference* target ) const
+{
+	TiXmlNode::CopyTo( target );
+
+	target->type = type;
+	target->href = href;
+}
+
+bool TiXmlStylesheetReference::Accept( TiXmlVisitor* visitor ) const
+{
+	return visitor->Visit( *this );
+}
+
+TiXmlNode* TiXmlStylesheetReference::Clone() const
+{
+	TiXmlStylesheetReference* clone = new TiXmlStylesheetReference();
+
+	if ( !clone )
+		return 0;
+
+	CopyTo( clone );
+	return clone;
+}
 
 void TiXmlUnknown::Print( FILE* cfile, int depth ) const
Index: /code/branches/FICN/src/tinyxml/tinyxml.h
===================================================================
--- /code/branches/FICN/src/tinyxml/tinyxml.h	(revision 739)
+++ /code/branches/FICN/src/tinyxml/tinyxml.h	(revision 740)
@@ -42,4 +42,10 @@
 #if defined( _DEBUG ) && !defined( DEBUG )
 #define DEBUG
+#endif
+
+#ifdef TIXML_USE_TICPP
+	#ifndef TIXML_USE_STL
+		#define TIXML_USE_STL
+	#endif
 #endif
 
@@ -81,5 +87,5 @@
 		#define TIXML_SSCANF   sscanf
 	#endif
-#endif	
+#endif
 
 class TiXmlDocument;
@@ -90,4 +96,5 @@
 class TiXmlText;
 class TiXmlDeclaration;
+class TiXmlStylesheetReference;
 class TiXmlParsingData;
 
@@ -96,5 +103,5 @@
 const int TIXML_PATCH_VERSION = 3;
 
-/*	Internal structure for tracking location of items 
+/*	Internal structure for tracking location of items
 	in the XML file.
 */
@@ -118,5 +125,5 @@
 	false, <b>no children of this node or its sibilings</b> will be Visited.
 
-	All flavors of Visit methods have a default implementation that returns 'true' (continue 
+	All flavors of Visit methods have a default implementation that returns 'true' (continue
 	visiting). You need to only override methods that are interesting to you.
 
@@ -144,4 +151,6 @@
 	/// Visit a declaration
 	virtual bool Visit( const TiXmlDeclaration& /*declaration*/ )	{ return true; }
+	/// Visit a stylesheet reference
+	virtual bool Visit( const TiXmlStylesheetReference& /*stylesheet*/ )	{ return true; }
 	/// Visit a text node
 	virtual bool Visit( const TiXmlText& /*text*/ )					{ return true; }
@@ -153,6 +162,6 @@
 
 // Only used by Attribute::Query functions
-enum 
-{ 
+enum
+{
 	TIXML_SUCCESS,
 	TIXML_NO_ATTRIBUTE,
@@ -193,5 +202,10 @@
 	@endverbatim
 */
+#ifdef TIXML_USE_TICPP
+#include "ticpprc.h"
+class TiXmlBase : public TiCppRC
+#else
 class TiXmlBase
+#endif
 {
 	friend class TiXmlNode;
@@ -206,8 +220,8 @@
 		or the string class (TiXmlString in non-STL mode, std::string
 		in STL mode.) Either or both cfile and str can be null.
-		
-		This is a formatted print, and will insert 
+
+		This is a formatted print, and will insert
 		tabs and newlines.
-		
+
 		(For an unformatted stream, use the << operator.)
 	*/
@@ -254,9 +268,9 @@
 	static const int utf8ByteTable[256];
 
-	virtual const char* Parse(	const char* p, 
-								TiXmlParsingData* data, 
+	virtual const char* Parse(	const char* p,
+								TiXmlParsingData* data,
 								TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0;
 
-	/** Expands entities in a string. Note this should not contian the tag's '<', '>', etc, 
+	/** Expands entities in a string. Note this should not contian the tag's '<', '>', etc,
 		or they will be transformed into entities!
 	*/
@@ -289,7 +303,7 @@
 
 	static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding );
-	inline static bool IsWhiteSpace( char c )		
-	{ 
-		return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' ); 
+	inline static bool IsWhiteSpace( char c )
+	{
+		return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' );
 	}
 	inline static bool IsWhiteSpace( int c )
@@ -376,5 +390,5 @@
     /// Field containing a generic user pointer
 	void*			userData;
-	
+
 	// None of these methods are reliable for any language except English.
 	// Good for approximation, not great for accuracy.
@@ -428,5 +442,5 @@
 
 public:
-	#ifdef TIXML_USE_STL	
+	#ifdef TIXML_USE_STL
 
 	    /** An input stream operator, for every class. Tolerant of newlines and
@@ -442,5 +456,5 @@
 		    a node to a stream is very well defined. You'll get a nice stream
 		    of output, without any extra whitespace or newlines.
-		    
+
 		    But reading is not as well defined. (As it always is.) If you create
 		    a TiXmlElement (for example) and read that from an input stream,
@@ -450,5 +464,5 @@
 		    A TiXmlDocument will read nodes until it reads a root element, and
 			all the children of that root element.
-	    */	
+	    */
 	    friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base);
 
@@ -469,4 +483,5 @@
 		TEXT,
 		DECLARATION,
+		STYLESHEETREFERENCE,
 		TYPECOUNT
 	};
@@ -532,5 +547,5 @@
 	const TiXmlNode* LastChild() const	{ return lastChild; }		/// The last child of this node. Will be null if there are no children.
 	TiXmlNode* LastChild()	{ return lastChild; }
-	
+
 	const TiXmlNode* LastChild( const char * value ) const;			/// The last child of this node matching 'value'. Will be null if there are no children.
 	TiXmlNode* LastChild( const char * _value ) {
@@ -702,4 +717,5 @@
 	virtual const TiXmlText*        ToText()        const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
 	virtual const TiXmlDeclaration* ToDeclaration() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+	virtual const TiXmlStylesheetReference* ToStylesheetReference() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
 
 	virtual TiXmlDocument*          ToDocument()    { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
@@ -709,11 +725,12 @@
 	virtual TiXmlText*	            ToText()        { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
 	virtual TiXmlDeclaration*       ToDeclaration() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+	virtual TiXmlStylesheetReference*       ToStylesheetReference() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
 
 	/** Create an exact duplicate of this node and return it. The memory must be deleted
-		by the caller. 
+		by the caller.
 	*/
 	virtual TiXmlNode* Clone() const = 0;
 
-	/** Accept a hierchical visit the nodes in the TinyXML DOM. Every node in the 
+	/** Accept a hierchical visit the nodes in the TinyXML DOM. Every node in the
 		XML tree will be conditionally visited and the host will be called back
 		via the TiXmlVisitor interface.
@@ -726,5 +743,5 @@
 
 		- http://www.saxproject.org/
-		- http://c2.com/cgi/wiki?HierarchicalVisitorPattern 
+		- http://c2.com/cgi/wiki?HierarchicalVisitorPattern
 
 		Which are both good references for "visiting".
@@ -823,5 +840,5 @@
 	/** QueryIntValue examines the value string. It is an alternative to the
 		IntValue() method with richer error checking.
-		If the value is an integer, it is stored in 'value' and 
+		If the value is an integer, it is stored in 'value' and
 		the call returns TIXML_SUCCESS. If it is not
 		an integer, it returns TIXML_WRONG_TYPE.
@@ -842,6 +859,6 @@
     #ifdef TIXML_USE_STL
 	/// STL std::string form.
-	void SetName( const std::string& _name )	{ name = _name; }	
-	/// STL std::string form.	
+	void SetName( const std::string& _name )	{ name = _name; }
+	/// STL std::string form.
 	void SetValue( const std::string& _value )	{ value = _value; }
 	#endif
@@ -850,5 +867,5 @@
 	const TiXmlAttribute* Next() const;
 	TiXmlAttribute* Next() {
-		return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Next() ); 
+		return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Next() );
 	}
 
@@ -856,5 +873,5 @@
 	const TiXmlAttribute* Previous() const;
 	TiXmlAttribute* Previous() {
-		return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Previous() ); 
+		return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Previous() );
 	}
 
@@ -892,5 +909,5 @@
 /*	A class used to manage a group of attributes.
 	It is only used internally, both by the ELEMENT and the DECLARATION.
-	
+
 	The set can be changed transparent to the Element and Declaration
 	classes that use it, but NOT transparent to the Attribute
@@ -982,9 +999,9 @@
 	/** QueryIntAttribute examines the attribute - it is an alternative to the
 		Attribute() method with richer error checking.
-		If the attribute is an integer, it is stored in 'value' and 
+		If the attribute is an integer, it is stored in 'value' and
 		the call returns TIXML_SUCCESS. If it is not
 		an integer, it returns TIXML_WRONG_TYPE. If the attribute
 		does not exist, then TIXML_NO_ATTRIBUTE is returned.
-	*/	
+	*/
 	int QueryIntAttribute( const char* name, int* _value ) const;
 	/// QueryDoubleAttribute examines the attribute - see QueryIntAttribute().
@@ -1004,5 +1021,5 @@
 		attribute into the specified type. Very easy, very powerful, but
 		be careful to make sure to call this with the correct type.
-		
+
 		NOTE: This method doesn't work correctly for 'string' types.
 
@@ -1024,5 +1041,5 @@
 	 This is - in theory - a bug fix for "QueryValueAtribute returns truncated std::string"
 	 but template specialization is hard to get working cross-compiler. Leaving the bug for now.
-	 
+
 	// The above will fail for std::string because the space character is used as a seperator.
 	// Specialize for strings. Bug [ 1695429 ] QueryValueAtribute returns truncated std::string
@@ -1081,5 +1098,5 @@
 		and concise, GetText() is limited compared to getting the TiXmlText child
 		and accessing it directly.
-	
+
 		If the first child of 'this' is a TiXmlText, the GetText()
 		returns the character string of the Text node, else null is returned.
@@ -1091,10 +1108,10 @@
 		@endverbatim
 
-		'str' will be a pointer to "This is text". 
-		
+		'str' will be a pointer to "This is text".
+
 		Note that this function can be misleading. If the element foo was created from
 		this XML:
 		@verbatim
-		<foo><b>This is text</b></foo> 
+		<foo><b>This is text</b></foo>
 		@endverbatim
 
@@ -1102,10 +1119,10 @@
 		another element. From this XML:
 		@verbatim
-		<foo>This is <b>text</b></foo> 
+		<foo>This is <b>text</b></foo>
 		@endverbatim
 		GetText() will return "This is ".
 
-		WARNING: GetText() accesses a child node - don't become confused with the 
-				 similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are 
+		WARNING: GetText() accesses a child node - don't become confused with the
+				 similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are
 				 safe type casts on the referenced node.
 	*/
@@ -1125,5 +1142,5 @@
 	virtual TiXmlElement*           ToElement()	          { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
 
-	/** Walk the XML tree visiting this node and all of its children. 
+	/** Walk the XML tree visiting this node and all of its children.
 	*/
 	virtual bool Accept( TiXmlVisitor* visitor ) const;
@@ -1179,5 +1196,5 @@
 	virtual TiXmlComment*  ToComment() { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
 
-	/** Walk the XML tree visiting this node and all of its children. 
+	/** Walk the XML tree visiting this node and all of its children.
 	*/
 	virtual bool Accept( TiXmlVisitor* visitor ) const;
@@ -1197,7 +1214,7 @@
 
 
-/** XML text. A text node can have 2 ways to output the next. "normal" output 
+/** XML text. A text node can have 2 ways to output the next. "normal" output
 	and CDATA. It will default to the mode it was parsed from the XML file and
-	you generally want to leave it alone, but you can change the output mode with 
+	you generally want to leave it alone, but you can change the output mode with
 	SetCDATA() and query it with CDATA().
 */
@@ -1206,5 +1223,5 @@
 	friend class TiXmlElement;
 public:
-	/** Constructor for text element. By default, it is treated as 
+	/** Constructor for text element. By default, it is treated as
 		normal, encoded text. If you want it be output as a CDATA text
 		element, set the parameter _cdata to 'true'
@@ -1242,5 +1259,5 @@
 	virtual TiXmlText*       ToText()       { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
 
-	/** Walk the XML tree visiting this node and all of its children. 
+	/** Walk the XML tree visiting this node and all of its children.
 	*/
 	virtual bool Accept( TiXmlVisitor* content ) const;
@@ -1318,5 +1335,5 @@
 	virtual TiXmlDeclaration*       ToDeclaration()       { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
 
-	/** Walk the XML tree visiting this node and all of its children. 
+	/** Walk the XML tree visiting this node and all of its children.
 	*/
 	virtual bool Accept( TiXmlVisitor* visitor ) const;
@@ -1336,4 +1353,68 @@
 };
 
+/** A stylesheet reference looks like this:
+	@verbatim
+		<?xml-stylesheet type="text/xsl" href="style.xsl"?>
+	@endverbatim
+
+	Note: In this version of the code, the attributes are
+	handled as special cases, not generic attributes, simply
+	because there can only be at most 2 and they are always the same.
+*/
+class TiXmlStylesheetReference : public TiXmlNode
+{
+public:
+	/// Construct an empty declaration.
+	TiXmlStylesheetReference()   : TiXmlNode( TiXmlNode::STYLESHEETREFERENCE ) {}
+
+#ifdef TIXML_USE_STL
+	/// Constructor.
+	TiXmlStylesheetReference(	const std::string& _type,
+								const std::string& _href );
+#endif
+
+	/// Construct.
+	TiXmlStylesheetReference(	const char* _type,
+								const char* _href );
+
+	TiXmlStylesheetReference( const TiXmlStylesheetReference& copy );
+	void operator=( const TiXmlStylesheetReference& copy );
+
+	virtual ~TiXmlStylesheetReference()	{}
+
+	/// Type. Will return an empty string if none was found.
+	const char *Type() const { return type.c_str (); }
+	/// Href. Will return an empty string if none was found.
+	const char *Href() const		{ return href.c_str (); }
+
+	/// Creates a copy of this StylesheetReference and returns it.
+	virtual TiXmlNode* Clone() const;
+	// Print this declaration to a FILE stream.
+	virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
+	virtual void Print( FILE* cfile, int depth ) const {
+		Print( cfile, depth, 0 );
+	}
+
+	virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+
+	virtual const TiXmlStylesheetReference* ToStylesheetReference() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+	virtual TiXmlStylesheetReference*       ToStylesheetReference()       { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+
+	/** Walk the XML tree visiting this node and all of its children.
+	*/
+	virtual bool Accept( TiXmlVisitor* visitor ) const;
+
+protected:
+	void CopyTo( TiXmlStylesheetReference* target ) const;
+	// used to be public
+	#ifdef TIXML_USE_STL
+	virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
+	#endif
+
+private:
+
+	TIXML_STRING type;
+	TIXML_STRING href;
+};
 
 /** Any tag that tinyXml doesn't recognize is saved as an
@@ -1363,5 +1444,5 @@
 	virtual TiXmlUnknown*           ToUnknown()	    { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
 
-	/** Walk the XML tree visiting this node and all of its children. 
+	/** Walk the XML tree visiting this node and all of its children.
 	*/
 	virtual bool Accept( TiXmlVisitor* content ) const;
@@ -1453,5 +1534,5 @@
 		- The ErrorDesc() method will return the name of the error. (very useful)
 		- The ErrorRow() and ErrorCol() will return the location of the error (if known)
-	*/	
+	*/
 	bool Error() const						{ return error; }
 
@@ -1464,5 +1545,5 @@
 	int ErrorId()	const				{ return errorId; }
 
-	/** Returns the location (if known) of the error. The first column is column 1, 
+	/** Returns the location (if known) of the error. The first column is column 1,
 		and the first row is row 1. A value of 0 means the row and column wasn't applicable
 		(memory errors, for example, have no row/column) or the parser lost the error. (An
@@ -1477,5 +1558,5 @@
 		to report the correct values for row and column. It does not change the output
 		or input in any way.
-		
+
 		By calling this method, with a tab size
 		greater than 0, the row and column of each node and attribute is stored
@@ -1505,9 +1586,9 @@
 		state is automatically cleared if you Parse a new XML block.
 	*/
-	void ClearError()						{	error = false; 
-												errorId = 0; 
-												errorDesc = ""; 
-												errorLocation.row = errorLocation.col = 0; 
-												//errorLocation.last = 0; 
+	void ClearError()						{	error = false;
+												errorId = 0;
+												errorDesc = "";
+												errorLocation.row = errorLocation.col = 0;
+												//errorLocation.last = 0;
 											}
 
@@ -1519,5 +1600,5 @@
 		calling code pust call delete[] on the return char* to avoid a memory leak.
 	*/
-	//char* PrintToMemory() const; 
+	//char* PrintToMemory() const;
 
 	/// Print this Document to a FILE stream.
@@ -1529,5 +1610,5 @@
 	virtual TiXmlDocument*          ToDocument()          { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
 
-	/** Walk the XML tree visiting this node and all of its children. 
+	/** Walk the XML tree visiting this node and all of its children.
 	*/
 	virtual bool Accept( TiXmlVisitor* content ) const;
@@ -1567,5 +1648,5 @@
 	@endverbatim
 
-	Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very 
+	Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very
 	easy to write a *lot* of code that looks like:
 
@@ -1587,5 +1668,5 @@
 
 	And that doesn't even cover "else" cases. TiXmlHandle addresses the verbosity
-	of such code. A TiXmlHandle checks for null	pointers so it is perfectly safe 
+	of such code. A TiXmlHandle checks for null	pointers so it is perfectly safe
 	and correct to use:
 
@@ -1608,5 +1689,5 @@
 
 	@verbatim
-	int i=0; 
+	int i=0;
 	while ( true )
 	{
@@ -1619,6 +1700,6 @@
 	@endverbatim
 
-	It seems reasonable, but it is in fact two embedded while loops. The Child method is 
-	a linear walk to find the element, so this code would iterate much more than it needs 
+	It seems reasonable, but it is in fact two embedded while loops. The Child method is
+	a linear walk to find the element, so this code would iterate much more than it needs
 	to. Instead, prefer:
 
@@ -1650,18 +1731,18 @@
 	TiXmlHandle FirstChildElement( const char * value ) const;
 
-	/** Return a handle to the "index" child with the given name. 
+	/** Return a handle to the "index" child with the given name.
 		The first child is 0, the second 1, etc.
 	*/
 	TiXmlHandle Child( const char* value, int index ) const;
-	/** Return a handle to the "index" child. 
+	/** Return a handle to the "index" child.
 		The first child is 0, the second 1, etc.
 	*/
 	TiXmlHandle Child( int index ) const;
-	/** Return a handle to the "index" child element with the given name. 
+	/** Return a handle to the "index" child element with the given name.
 		The first child element is 0, the second 1, etc. Note that only TiXmlElements
 		are indexed: other types are not counted.
 	*/
 	TiXmlHandle ChildElement( const char* value, int index ) const;
-	/** Return a handle to the "index" child element. 
+	/** Return a handle to the "index" child element.
 		The first child element is 0, the second 1, etc. Note that only TiXmlElements
 		are indexed: other types are not counted.
@@ -1679,5 +1760,5 @@
 	/** Return the handle as a TiXmlNode. This may return null.
 	*/
-	TiXmlNode* ToNode() const			{ return node; } 
+	TiXmlNode* ToNode() const			{ return node; }
 	/** Return the handle as a TiXmlElement. This may return null.
 	*/
@@ -1690,9 +1771,9 @@
 	TiXmlUnknown* ToUnknown() const		{ return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); }
 
-	/** @deprecated use ToNode. 
+	/** @deprecated use ToNode.
 		Return the handle as a TiXmlNode. This may return null.
 	*/
-	TiXmlNode* Node() const			{ return ToNode(); } 
-	/** @deprecated use ToElement. 
+	TiXmlNode* Node() const			{ return ToNode(); }
+	/** @deprecated use ToElement.
 		Return the handle as a TiXmlElement. This may return null.
 	*/
@@ -1754,5 +1835,5 @@
 	/// Query the indention string.
 	const char* Indent()							{ return indent.c_str(); }
-	/** Set the line breaking string. By default set to newline (\n). 
+	/** Set the line breaking string. By default set to newline (\n).
 		Some operating systems prefer other characters, or can be
 		set to the null/empty string for no indenation.
@@ -1762,10 +1843,10 @@
 	const char* LineBreak()							{ return lineBreak.c_str(); }
 
-	/** Switch over to "stream printing" which is the most dense formatting without 
+	/** Switch over to "stream printing" which is the most dense formatting without
 		linebreaks. Common when the XML is needed for network transmission.
 	*/
 	void SetStreamPrinting()						{ indent = "";
 													  lineBreak = "";
-													}	
+													}
 	/// Return the result.
 	const char* CStr()								{ return buffer.c_str(); }
Index: /code/branches/FICN/src/tinyxml/tinyxmlerror.cc
===================================================================
--- /code/branches/FICN/src/tinyxml/tinyxmlerror.cc	(revision 739)
+++ /code/branches/FICN/src/tinyxml/tinyxmlerror.cc	(revision 740)
@@ -3,10 +3,10 @@
 Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
 
-This software is provided 'as-is', without any express or implied
-warranty. In no event will the authors be held liable for any
+This software is provided 'as-is', without any express or implied 
+warranty. In no event will the authors be held liable for any 
 damages arising from the use of this software.
 
-Permission is granted to anyone to use this software for any
-purpose, including commercial applications, and to alter it and
+Permission is granted to anyone to use this software for any 
+purpose, including commercial applications, and to alter it and 
 redistribute it freely, subject to the following restrictions:
 
Index: /code/branches/FICN/src/tinyxml/tinyxmlparser.cc
===================================================================
--- /code/branches/FICN/src/tinyxml/tinyxmlparser.cc	(revision 739)
+++ /code/branches/FICN/src/tinyxml/tinyxmlparser.cc	(revision 740)
@@ -838,13 +838,22 @@
 	// - Comments: <!--
 	// - Decleration: <?xml
+	// - StylesheetReference <?xml-stylesheet
 	// - Everthing else is unknown to tinyxml.
 	//
 
 	const char* xmlHeader = { "<?xml" };
+	const char* xmlSSHeader = { "<?xml-stylesheet" };
 	const char* commentHeader = { "<!--" };
 	const char* dtdHeader = { "<!" };
 	const char* cdataHeader = { "<![CDATA[" };
 
-	if ( StringEqual( p, xmlHeader, true, encoding ) )
+	if ( StringEqual( p, xmlSSHeader, true, encoding ) )
+	{
+		#ifdef DEBUG_PARSER
+			TIXML_LOG( "XML parsing Stylesheet Reference\n" );
+		#endif
+		returnNode = new TiXmlStylesheetReference();
+	}
+	else if ( StringEqual( p, xmlHeader, true, encoding ) )
 	{
 		#ifdef DEBUG_PARSER
@@ -1637,2 +1646,77 @@
 }
 
+#ifdef TIXML_USE_STL
+void TiXmlStylesheetReference::StreamIn( std::istream * in, TIXML_STRING * tag )
+{
+	while ( in->good() )
+	{
+		int c = in->get();
+		if ( c <= 0 )
+		{
+			TiXmlDocument* document = GetDocument();
+			if ( document )
+				document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN );
+			return;
+		}
+		(*tag) += (char) c;
+
+		if ( c == '>' )
+		{
+			// All is well.
+			return;
+		}
+	}
+}
+#endif
+
+const char* TiXmlStylesheetReference::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding _encoding )
+{
+	p = SkipWhiteSpace( p, _encoding );
+	// Find the beginning, find the end, and look for
+	// the stuff in-between.
+	TiXmlDocument* document = GetDocument();
+	if ( !p || !*p || !StringEqual( p, "<?xml-stylesheet", true, _encoding ) )
+	{
+		if ( document ) document->SetError( TIXML_ERROR_PARSING_DECLARATION, 0, 0, _encoding );
+		return 0;
+	}
+	if ( data )
+	{
+		data->Stamp( p, _encoding );
+		location = data->Cursor();
+	}
+	p += 5;
+
+	type = "";
+	href = "";
+
+	while ( p && *p )
+	{
+		if ( *p == '>' )
+		{
+			++p;
+			return p;
+		}
+
+		p = SkipWhiteSpace( p, _encoding );
+		if ( StringEqual( p, "type", true, _encoding ) )
+		{
+			TiXmlAttribute attrib;
+			p = attrib.Parse( p, data, _encoding );
+			type = attrib.Value();
+		}
+		else if ( StringEqual( p, "href", true, _encoding ) )
+		{
+			TiXmlAttribute attrib;
+			p = attrib.Parse( p, data, _encoding );
+			href = attrib.Value();
+		}
+		else
+		{
+			// Read over whatever it is.
+			while( p && *p && *p != '>' && !IsWhiteSpace( *p ) )
+				++p;
+		}
+	}
+	return 0;
+}
