HRESULT XsiForPrimaryNS([out, retval] BSTR * uri);
The serializer factory keeps track of the current primary XSD namespace, which allows the serializer engine to serialize using the older XSD namespace. This allows a serializer to find out what the matching XSI [XML Schema Instance] namespace is for the current primary XSD Namespace (e.g. to generate xsi:type attributes)
A string containing the NamespaceURI of the XML Schema Instance for the current primary Schema Namespace
HRESULT CSerializerSimpleBase::WriteType(VARIANT * val, ISerializerContext * ctx, ISerializerOutput * dest )
{
if ( m_type.Length() )
{
CComPtr sf ;
ctx->get_SerializerFactory(&sf) ;
CComBSTR xsi ;
sf->XsiForPrimaryNS(&xsi) ;
static CComBSTR type (OLESTR("type")) ;
dest->QNameAttribute ( type, xsi, m_type, m_typeNS ) ;
}
return S_OK ;
}
Copyright © Simon Fell, 2000-2004. All rights reserved.