Hi Werner,

Thanks for your response.

I've created a castor.properties file as you suggested.

I've noticed I'm missing the schema references in the xml file.

i.e. 
        xmlns="http://<address>/PI" *
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="http://<address>/PI " +
        "http://<address>/schemas/version1.0/schemas/timeseries.xsd"

I've generated the java objects using the timeseries.xsd schema:

<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema";
xmlns:ex="http://<address>/PI" targetNamespace="http://<address>/PI"
elementFormDefault="qualified">
        <include schemaLocation="types.xsd"/>
        <element name="TimeSeries" type="ex:TimeSeriesComplexType">
                <annotation>
                        <documentation>Time series data represent data 
collected over a given
period of time at a specific location</documentation>
                </annotation>
        </element>

I haven't been able to find where to set the values.

Could you point me towards a basic example of something similar, generating
objects using schema as well as adding data, generating XML (incl.
references to  xmlns= ...  xmlns:xsi=... xsi:schemaLocation ...

I've tried the customer example although it has no reference to the schema
elements.

Thanks.
....

Werner Guttmann-6 wrote:
> 
> Hi,
> 
> you do not really provide a lot of information about the issue you are 
> looking into. As I don't see any Castor-specific errors, I cannot really 
> be of any help in this context.
> 
> Please see below as well ....
> 
> Regards
> Werner
> 
> On 15.02.2011 09:07, Jules001 wrote:
>>
>> Hello,
>>
>> I have generated my XML using the below method, the file stops half way.
>>
>> The message in the XML states:
>> The XML page cannot be displayed
>> Cannot view XML input using XSL style sheet. Please correct the error and
>> then click the Refresh button, or try again later.  Not enough storage is
>> available to complete this operation.
>>
>> I'm not sure where to start to debug the error.
>>
>> <code>
>>   public void generateXML(TimeSeries timeseries)
>>      {
>>          try
>>          {
>>              FileWriter out = new FileWriter("C:/file.xml");
>>              Marshaller.marshal(timeseries, out);
>>              out.close();
>>          } catch (Exception e)
>>          {
>>              System.out.println("Exception: " + e.getMessage());
>>          }
>>      }
>>
>> </code>
>>
>>
>> Changed the following settings in castor.properties to true by extracting
>> the library and creating another jar.
> That's definitely not the recommended way to go about this. Please 
> provide a user-specific castor.properties file on the classpath, and it 
> will be picked up by Castor and override any defaults.
>>
>>
>> # True if all documents should be indented on output by default
>> #
>> org.exolab.castor.indent=true
>>
>>
>> # True if xml documents should be validated by the SAX Parser
>> #
>> org.exolab.castor.parser.validation=true
>> org.exolab.castor.parser.namespaces=true
>>
>> # True if all documents should be validated by the marshalling framework
>> #
>> org.exolab.castor.marshalling.validation=true
>>
>> Thanks all.
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Error-in-XML-file-generated-by-Castor-tp30928766p30973989.html
Sent from the Castor - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to