Hi, I've missed the CreateDOMDocument example :D
Merging those two samples I was able to correctly create the Schema,
thank you very much!! :)
I've also noticed that the segfaults were caused by an incorrect
handling of pointers due to the continuous cut&paste over samples.
Now only a simple question remains open for me: how can I correctly
format the resulting document? I mean, I found no way to correctly
insert newlines in the document: I've tried using the setNewLine()
method of DOMWriter passing "\n" and "\r\n" (even if I'm under Linux),
but none of them works...
Thank you again for your help!
                              Roberto

Alberto Massari wrote:
> Ciao Roberto,
> writing an XMLSchema is not different from serializing a DOM tree (e.g.
> see the samples CreateDOMDocument + DOMPrint); could you share your code
> so that we can spot what is going wrong?
> 
> Alberto
> 
> Roberto Rigamonti wrote:
>> Hello, I'm trying to create a schema file from scratch using Xerces in
>> C++, but the documentation in the net seems to me very obscure
>> (excluding Doxygen-generated documentation, I haven't found much
>> examples other than those included in the Xerces pack, and several
>> methods are presented for writing an XML file, but none works for me
>> because they bloat the result with DOCTYPE/other unwanted stuff).
>> I'd like to have a result like the following one:
>>
>> <?xml version="1.0"?>
>> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>>             elementFormDefault="qualified">
>>   <xsd:include schemaLocation="lib3DVisLine.xsd"/>
>>   <xsd:include schemaLocation="lib3DVisPoint.xsd"/>
>>
>>   <xsd:element name="visor">
>>     <xsd:complexType>
>>       <xsd:choice minOccurs="0" maxOccurs="unbounded">
>>       <xsd:element name="line" type="lib3DVisLine"/>
>>       <xsd:element name="point" type="lib3DVisPoint"/>
>>       </xsd:choice>
>>     </xsd:complexType>
>>   </xsd:element>
>> </xsd:schema>
>>
>> I've tried many approaches, but the resulting code, even if it compiles
>> successfully, throws a DOMException or segfaults without any good
>> reason...
>> Does anyone know a "good way" to create a XML Schema from scratch?
>> Thanks in advance to anyone who replies.
>>                                           Roberto
>>
>>
>>   
> 
> 
> 

Reply via email to