Boris Kolpackov-2 wrote:
>
> Hi Raymond,
>
> "Raymond.F" <[EMAIL PROTECTED]> writes:
>
>> Hi, I need some help with creating the XML declaration. I'm using
>> Xerces-c++
>> 2.7.0 with MS VC++ 6. When creating an XML file through Xerces, by
>> default
>> it creates the XML declaration like this:
>>
>> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
>>
>> I would like to exclude the encoding and standalone information, so the
>> output of the XML declaration would look like this:
>>
>> <?xml version="1.0" ?>
>>
>> I'm able to change the encoding and standalone attributes, but not
>> suppress
>> them. Is there way to exclude them? Any help will be greatly appreciated.
>
> One way (which may also be the only way) would be to suppress XML
> declaration
> altogether and generate it manually. See the XMLUni::fgDOMXMLDeclaration
> feature in the docs.
>
> hth,
> -boris
> Hi,
> I'm creating an XML by using following code,
> DOMImplementation* impl =
> DOMImplementationRegistry::getDOMImplementation(X("Core"));
> DOMDocument* doc = impl->createDocument( 0, X("Books"),0);
> DOMElement* rootElem = doc->getDocumentElement();
>
> and then keep on appending the DOMElements to rootElem. After popultting
> the DOM i get first element as follows:
> <?xml version="1.0" encoding="UTF8" standalone="no" ?>.
>
> When i validate it aginst my parser using XSD it gives me error that the
> document can not be opened. Now to get everything working i have three
> options :
> 1. remove the standalone attribute from DOM.
> 2. modify my parser or( evenif i set XMLUni::fgDOMXMLDeclaration = true or
> false it keeps on throwing error where as other validators pass the same
> file).
> 3. some change in xsd(Am i right??)
>
> How to achive the any of above three?
>
> --
> Boris Kolpackov
> Code Synthesis Tools CC
> http://www.codesynthesis.com
> Open-Source, Cross-Platform C++ XML Data Binding
>
>
>
--
View this message in context:
http://www.nabble.com/Removing-%22encoding%22-and-%22standalone%22-attributes-from-XML-declaration-tf1890108.html#a12978712
Sent from the Xerces - C - Users mailing list archive at Nabble.com.