At 10.57 20/07/2007 -0700, jerome.mariette wrote:
sorry for that:
/* Create the document */
XMLCh* rootvalue = XMLString::transcode("EventDataSet");
XMLCh* rootnamespace =
XMLString::transcode("http://www.w3.org/2001/XMLSchema-instance");
itsXMLdoc = impl->createDocument(rootnamespace, rootvalue, NULL);
XMLString::release(&rootvalue);
XMLString::release(&rootnamespace);
here is the begining in charge of this part of the document :)
Hi Jerome,
you are creating a root element that has name EventDataSet and
namespace http://www.w3.org/2001/XMLSchema-instance; as EventDataSet
has no namespace prefix, it means that the XSI namespace is the
default namespace, so a
xmlns="http://www.w3.org/2001/XMLSchema-instance" is added to ensure
this is still true when loading the XML file.
If you really wanted to have the XSI namespace associated with the
xsi prefix you should have done
itsXMLdoc = impl->createDocument(NULL, rootvalue, NULL);
XMLCh* xmlnsxsi = XMLString::transcode("xmlns:xsi");
itsXMLdoc->getDocumentElement()->setAttributeNS(XMLUni::fgXMLNSURIName,xmlnsxsi,rootnamespace);
XMLString::release(&xmlnsxsi);
Alberto
thanks for your help,
Jerome
Alberto Massari wrote:
>
> At 14.12 19/07/2007 -0700, jerome.mariette wrote:
>
>>Hi everybody,
>>I'm writing an XML file that I creat from scratch in my code, then check
it
>>with my xml schema to be sure it's ok. The problem is it still complaining
>>and say it's wrong ... I figured out it's because when I'm writing my XML
>>with my DOMWriter, this one forget to add ths xsi domain.
>>so instead of
>> <EventDataSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>>
>>it writes that:
>><EventDataSet xmlns="http://www.w3.org/2001/XMLSchema-instance">
>>
>>so I guess xmlns is then anderstood as an attribut !!
>>how can I say to xerces to write it ... as this is automatic when I creat
>>the xML.
>
> Hi Jerome,
> DOMWriter writes what you created... either you added an attribute
> named "xmlns" instead of "xmlns:xsi", or you created the EventDataSet
> element with a namespace of
> http://www.w3.org/2001/XMLSchema-instance. But in order to tell you
> what was wrong, we need to see the code that creates the DOM tree.
>
> Alberto
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/DOMWriter-tf4113752.html#a11713006
Sent from the Xerces - C - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]