I am creating text node
DOMText* prodDataVal = xmldoc->createTextNode(XMLString::transcode("0"));
currentNode->appendChild(prodDataVal);But this text node has a value of boolean and sometimes my node is empty,basically value is not set...as minOccurs=0 can i have empty tags of boolean without values in it??? same is the case when i use datetime type... schema is <xs:element name="Tracking" type="xs:boolean" minOccurs="0"/> <xs:element name="CreateTime" type="xs:dateTime" minOccurs="0"/> Please i have to create XML and set values to those element minOccurs=1 by creating the textnodes as above and leave the rest blank ...so my parser complains abt the boolean and datatime being empty. thanks, On Mon, Aug 17, 2009 at 5:09 PM, David Bertoni <[email protected]> wrote: > ss ak wrote: > >> I am new xerces api and using to XercesDOMParser to parse my xml with my >> schema...i think it works well... >> >> When validating aganist Boolean... >> >> PARSOING >> Error at file "prodInfo", line 32, column 24 >> Message: buffer not initialized >> Error at file "prodInfo", line 36, column 26 >> Message: buffer not initialized >> Error at file "prodInfo", line 37, column 24 >> Message: buffer not initialized >> > This is an internal error message that indicates an empty or null buffer > was provided to the XMLDateTime class. Can you please post a minimal schema > document and instance document? > > Error at file "prodInfo", line 39, column 19 >> Message: value '' not in enumeration >> Error at file "prodInfo", line 40, column 28 >> Message: value '' is invalid boolean >> > This indicates the text node is empty, and an empty string is not a valid > lexical value for a bool. > > Error at file "prodInfo", line 49, column 24 >> Message: buffer not initialized >> >> >> <xs:element name="Tracking" type="xs:boolean" minOccurs="0"/> >> >> <xs:element name="CreateTime" type="xs:dateTime" minOccurs="0"/> >> >> How do i create these nodes or set values to the node so tht parser can >> take... >> >> right now I am setting teh value for each tag like this... >> >> DOMText* prodDataVal = xmldoc->createTextNode("false"); >> > DOMDocument::createTextNode() accepts a string encoded in UTF-16, not a > regular character string. This code should not compile. > > > currentNode->appendChild(prodDataVal); >> > How are you creating this text node? > > Dave >
